
1.配置IP地址 R1#conf t R1(config)#int loopback 1 R1(config-if)#ip add 8.8.8.8 255.255.255.255 R1(config-if)#no shutdown R1(config)#int f0/0 R1(config-if)#ip add 20.1.1.2 255.255.255.0 R1(config-if)#no shut R2#conf t R2(config)#int loopback 1 R2(config-if)#ip add 8.8.8.8 255.255.255.0 R2(config-if)#no shut R2(config)#int f0/0 R2(config-if)#ip add 20.1.2.2 255.255.255.0 R2(config-if)#no shut R3#conf t R3(config)#int 0/0 R3(config-if)#ip add 20.1.1.1 255.255.255.0 R3(config-if)#no shut R3(config-if)#int f0/1 R3(config-if)#ip add 20.1.2.1 255.255.255.0 R3(config-if)#no shut R3(config-if)#int f1/0 R3(config-if)#ip add 192.168.1.254 255.255.255.0 R3(config-if)#ip add 192.168.2.254 255.255.255.0 secondary R3(config-if)#no shutdown R4#conf t R4(config)#no ip routing //关闭交换机路由功能 R5#conf t R5(config)#no ip routing R5(config)#int f0/0 R5(config-if)#ip add 192.168.1.1 255.255.255.0 R5(config-if)#no shut R5(config)#ip default-gateway 192.168.1.254 R6#conf t R6(config)#no ip routing R6(config)#int f0/0 R6(config-if)#ip add 192.168.2.1 255.255.255.0 R6(config-if)#no shut R6(config)#ip default-gateway 192.168.2.254 2.配置策略路由 R3(config)#access-list 1 permit 192.168.1.0 0.0.0.255 R3(config)#access-list 2 permit 192.168.2.0 0.0.0.255 R3(config)#route-map r1 permit 10 R3(config-route-map)#match ip address 1 R3(config-route-map)#set ip next-hop 20.1.1.2 R3(config)#route-map r1 permit 20 R3(config-route-map)#match ip address 2 R3(config-route-map)#set ip next-hop 20.1.2.2 R3(config)#int f1/0 R3(config-if)#ip policy route-map r1 
3.在R1和R2上配置回程路由 R1(config)#ip route 0.0.0.0 0.0.0.0 20.1.1.1 R2(config)#ip route 0.0.0.0 0.0.0.0 20.1.2.1 4.检查配置  
|