首先有三台設備分別名為IOU1,IOU2,IOU3,實驗目的為 IOU1能Ping到IOU3
設定參數如下
IOU1 e0/0 IP:192.168.1.10
IOU2 e0/0 IP:192.168.1.20
IOU2 e0/1 IP:172.16.1.20
IOU3 e0/0 IP:192.168.1.30
指令如下
IOU1
IOU1(config)#
int e0/0
IOU1(config-if)#
ip address 192.168.1.10 255.255.255.0
IOU1(config-if)#
no shutdown
*Mar 8 08:17:03.883: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar 8 08:17:04.889: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
IOU2
IOU2(config)#
int e0/0
IOU2(config-if)#
ip address 192.168.1.20 255.255.255.0
IOU2(config-if)#
no shutdown
*Mar 8 08:18:44.548: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
IOU2(config-if)#
*Mar 8 08:18:45.551: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
IOU2(config)#
int e0/1
IOU2(config-if)#
ip address 172.16.1.20 255.255.255.0
IOU2(config-if)#
no shutdown
*Mar 8 08:20:00.967: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Mar 8 08:20:01.980: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to up
IOU3
IOU3(config)#
int e0/0
IOU3(config-if)#
ip address 172.16.1.30 255.255.255.0
IOU3(config-if)#
no shutdown
*Mar 8 08:21:04.171: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar 8 08:21:05.186: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
IOU1上執行ping IOU2的e0/0 (IP:192.168.1.20)為通的
但ping IOU2的e0/1 (IP:172.16.1.20)則不通
在IOU1上show 路由
IOU1#show ip route
顯示只有L (本地)跟C (直連的)看不到往172.16.1.0的路由
只好開始建立OSPF路由
IOU 1
IOU1(config)#
router ospf 10
IOU1(config-router)#
network 192.168.1.0 0.0.0.255 area 100
IOU 2
IOU2(config)#
router ospf 10
IOU2(config-router)#
network 192.168.1.0 0.0.0.255 area 100
IOU2(config)#
router ospf 10
IOU2(config-router)#
network 172.16.1.0 0.0.0.255 area 100
IOU3
IOU3(config)#
route ospf 10
IOU3(config-router)#
network 172.16.1.0 0.0.0.255 area 100
建立好OSPF
執行show ip route
發現多了172.16.1.0的路由,執行ping 172.16.1.20與172.16.1.30都能正常ping通