网络括谱图
静态路由网络部署
Router0配置如下
Router>enable #进入特权模式
Router#configure terminal #进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.11.1 255.255.255.0 #配置对应端口IP
Router(config-if)#no shutdown #开启端口
Router(config-if)#exit
Router(config)#interface FastEthernet0/1
Router(config-if)#ip address 192.168.12.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface FastEthernet0/0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip route 192.168.13.0 255.255.255.0 192.168.12.2 #配置静态路由(即手动指定去某个网段路径)
Router(config)#ip route 192.168.14.0 255.255.255.0 192.168.12.2
Router1配置如下
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.12.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface FastEthernet0/1
Router(config-if)#ip address 192.168.13.1 255.255.255.0
Router(config-if)#shutdown
Router(config-if)#exit
Router(config)#ip route 192.168.11.0 255.255.255.0 192.168.12.1 #配置静态路由(即手动指定去某个网段路径)
Router(config)#ip route 192.168.14.0 255.255.255.0 192.168.13.2
Router2配置如下
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.13.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface FastEthernet0/1
Router(config-if)#ip address 192.168.14.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip route 192.168.12.0 255.255.255.0 192.168.13.1 #配置静态路由(即手动指定去某个网段路径)
Router(config)#ip route 192.168.11.0 255.255.255.0 192.168.13.1
Router(config)#interface FastEthernet0/0
Router(config-if)#do show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
S 192.168.11.0/24 [1/0] via 192.168.13.1
S 192.168.12.0/24 [1/0] via 192.168.13.1
C 192.168.13.0/24 is directly connected, FastEthernet0/0
C 192.168.14.0/24 is directly connected, FastEthernet0/1
动态路由网络部署
Router0
Router(config)#no ip route 192.168.14.0 255.255.255.0 192.168.12.2 #关闭静态路由(即指示对应网段的路径)
Router(config)#no ip route 192.168.13.0 255.255.255.0 192.168.12.2
Router(config)#router rip
Router(config-router)#network 192.168.11.0 #配置动态路由(即将直连网段宣告出去)
Router(config-router)#exit
Router(config)#router rip
Router(config-router)#network 192.168.12.0
Router1
Router(config)#no ip route 192.168.14.0 255.255.255.0 192.168.12.2 #关闭静态路由
Router(config)#no ip route 192.168.13.0 255.255.255.0 192.168.12.2
Router(config)#router rip
Router(config-router)#network 192.168.11.0 #配置动态路由(即将直连网段宣告出去)
Router(config-router)#exit
Router(config)#router rip
Router(config-router)#network 192.168.12.0
Router2
Router(config)#no ip route 192.168.14.0 255.255.255.0 192.168.12.2 #关闭静态路由
Router(config)#no ip route 192.168.13.0 255.255.255.0 192.168.12.2
Router(config)#router rip
Router(config-router)#network 192.168.11.0 #配置动态路由(即将直连网段宣告出去)
Router(config-router)#exit
Router(config)#router rip
Router(config-router)#network 192.168.12.0