1.拓扑结构
2.主机配置
pc1:
pc2:
3.路由配置
R1:
#
interface Ethernet0/0/0
ip address 192.168.1.253 255.255.255.252
#
interface Ethernet0/0/1
ip address 192.168.1.30 255.255.255.224
#
interface GigabitEthernet0/0/0
ip address 192.168.1.245 255.255.255.252
#
ip route-static 192.168.1.64 255.255.255.192 192.168.1.254
ip route-static 192.168.1.64 255.255.255.192 192.168.1.246
ip route-static 192.168.1.240 255.255.255.252 192.168.1.246
ip route-static 192.168.1.248 255.255.255.252 192.168.1.254
#
R2:
#
interface Ethernet0/0/0
ip address 192.168.1.254 255.255.255.252
#
interface Serial0/0/0
link-protocol ppp
ip address 192.168.1.249 255.255.255.252
#
#
ip route-static 192.168.1.0 255.255.255.224 192.168.1.253
ip route-static 192.168.1.64 255.255.255.192 192.168.1.250
#
R3:
#
interface Ethernet0/0/0
ip address 192.168.1.126 255.255.255.192
#
interface Ethernet0/0/1
ip address 192.168.1.242 255.255.255.252
#
interface Serial0/0/0
link-protocol ppp
ip address 192.168.1.250 255.255.255.252
#
ip route-static 192.168.1.0 255.255.255.224 192.168.1.249
ip route-static 192.168.1.0 255.255.255.224 192.168.1.241 preference 70
ip route-static 192.168.1.244 255.255.255.252 192.168.1.241
ip route-static 192.168.1.252 255.255.255.252 192.168.1.249
#
R4:
#
interface Ethernet0/0/0
ip address 192.168.1.246 255.255.255.252
#
interface Ethernet0/0/1
ip address 192.168.1.241 255.255.255.252
#
ip route-static 192.168.1.0 255.255.255.224 192.168.1.245
ip route-static 192.168.1.64 255.255.255.192 192.168.1.242
#
4.测试
(1)PC2 ping PC1:
(2)关闭路由器R2进行测试:
R1-R3 上面一条路径 优先级:60 下面一条优先级:70