路由器OSPF动态路由配置

实现:通过配置动态路由协议OSPF学习产生路由。
环境:
    CISCO 3560
    Router01
    Router02
    VLAN2-PC01
    PC02
    //拓扑:如图(110422-路由器OSPF动态路由配置)

      
    //配置CISCO 3560
    CISCO 3560>enable
    CISCO 3560#configure terminal
    CISCO 3560(config)#vlan 2
    CISCO 3560(config-vlan)#exit
    CISCO 3560(config)#vlan 3
    CISCO 3560(config-vlan)#exit
    CISCO 3560(config)#interface fastEthernet 0/1
    CISCO 3560(config-if)#switchport access vlan 2
    CISCO 3560(config-if)#exit
    CISCO 3560(config)#inter fastEthernet 0/24
    CISCO 3560(config-if)#switchport access vlan 3
    CISCO 3560(config-if)#exit
    CISCO 3560(config)#interface vlan 2
    CISCO 3560(config-if)#ip address 192.168.1.1 255.255.255.0
    CISCO 3560(config-if)#no shutdown
    CISCO 3560(config-if)#exit
    CISCO 3560(config)#interface vlan 3
    CISCO 3560(config-if)#ip address 192.168.3.1 255.255.255.0
    CISCO 3560(config-if)#no shutdown
    CISCO 3560(config-if)#exit
    CISCO 3560(config)#router ospf 1                 //进入OSPf视图
    CISCO 3560(config-router)#network 192.168.1.0 0.0.0.255 area 0    //发布直连路由
    CISCO 3560(config-router)#network 192.168.3.0 0.0.0.255 area 0
    CISCO 3560(config-router)#end
    CISCO 3560#write
    CISCO 3560#show vlan
    CISCO 3560#show ip router[nextpage]
    //配置Router01
    Router01>enable
    Router01#configure terminal
    Router01(config)#interface fastEthernet 1/0
    Router01(config-if)#no shutdown
    Router01(config-if)#ip address 192.168.3.2 255.255.255.0
    Router01(config-if)#exit
    Router01(config)#interface serial 2/0
    Router01(config-if)#ip address 192.168.4.1 255.255.255.0
    Router01(config-if)#clock rate 64000
    Router01(config-if)#no shutdown
    Router01(config-if)#exit
    Router01(config)#router ospf 1
    Router01(config-router)#network 192.168.3.0 0.0.0.255 area 0
    Router01(config-router)#network 192.168.4.0 0.0.0.255 area 0
    Router01(config-router)#end
    Router01#write
    //配置Router02
    Router02>enable
    Router02#configure terminal
    Router02(config)#interface fastEthernet 1/0
    Router02(config-if)#no shutdown
    Router02(config-if)#ip address 192.168.2.1 255.255.255.0
    Router02(config-if)#exit
    Router02(config)#interface serial 2/0
    Router02(config-if)#ip address 192.168.4.2 255.255.255.0
    Router02(config-if)#no shutdown
    Router02(config-if)#exit
    Router02(config)#router ospf 1
    Router02(config-router)#network 192.168.2.0 0.0.0.255 area 0
    Router02(config-router)#network 192.168.4.0 0.0.0.255 area 0
    Router02(config-router)#end
    Router02#write
    Router02#show ip router
    //测试:(终端计算机)
    VLAN2-PC01>ping 192.168.2.101
    Pinging 192.168.2.101 with 32 bytes of data:
    Reply from 192.168.2.101: bytes=32 time=23ms TTL=125
    Reply from 192.168.2.101: bytes=32 time=16ms TTL=125
    Ping statistics for 192.168.2.101:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 16ms, Maximum = 23ms, Average = 19ms
 

你可能感兴趣的:(职场,路由器,休闲,动态路由配置,路由器OSPF)