实验二:负载分担、浮动静态路由
实验要求:
1.选择router-PT路由器2台,PC-PT机2台,按拓扑图为PC机和路由器端口分配IP地址。
2.在R1上从端口S2/0、S3/0上做静态路由到PC33所在的网络192.x.33.0/24。
3.在R2上从端口S2/0、S3/0上做静态路由到PC11所在的网络192.x.11.0/24.
Router(config)#ip route 192.220.11.0 255.255.255.0 s2/0
Router(config)#ip route 192.220.11.0 255.255.255.0 s3/0
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
Gateway of last resort is not set
C 192.220.11.0/24 is directly connected, FastEthernet0/0
C 192.220.12.0/24 is directly connected, Serial2/0
C 192.220.21.0/24 is directly connected, Serial3/0
S 192.220.33.0/24 is directly connected, Serial2/0
is directly connected, Serial3/0
4.测试PC11到PC33的连通性,并在路由器上采用debug ip packet命令观察IP分组从那个端口转发。
Router#debug ip packet
Packet debugging is on
Router#
IP: tableid=0, s=192.220.11.1 (FastEthernet0/0), d=192.220.33.1 (Serial2/0), routed via RIB
IP: s=192.220.11.1 (FastEthernet0/0), d=192.220.33.1 (Serial2/0), g=192.220.33.1, len 128, forward
IP: tableid=0, s=192.220.33.1 (Serial2/0), d=192.220.11.1 (FastEthernet0/0), routed via RIB
IP: s=192.220.33.1 (Serial2/0), d=192.220.11.1 (FastEthernet0/0), g=192.220.11.1, len 128, forward
IP: tableid=0, s=192.220.11.1 (FastEthernet0/0), d=192.220.33.1 (Serial3/0), routed via RIB
IP分组从s2/0,s3/0都有转发
5.在R1、R2上将S3/0-S3/0链路的静态路由管理距离设置为100。
Router(config)#ip route 192.220.33.0 255.255.255.0 s3/0 100
Router(config)#ip route 192.220.11.0 255.255.255.0 s3/0 100
6.观察R1、R2上的路由表,测试PC11到PC33的连通性,并在路由器上采用debug ip packet命令观察IP分组从那个端口转发。
R1路由表:
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
Gateway of last resort is not set
C 192.220.11.0/24 is directly connected, FastEthernet0/0
C 192.220.12.0/24 is directly connected, Serial2/0
C 192.220.21.0/24 is directly connected, Serial3/0
S 192.220.33.0/24 is directly connected, Serial2/0
R2路由表
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
Gateway of last resort is not set
S 192.220.11.0/24 is directly connected, Serial2/0
C 192.220.12.0/24 is directly connected, Serial2/0
C 192.220.21.0/24 is directly connected, Serial3/0
C 192.220.33.0/24 is directly connected, FastEthernet0/0
Router#debug ip packet
Packet debugging is on
Router#
IP: tableid=0, s=192.220.33.1 (FastEthernet0/0), d=192.220.11.1 (Serial2/0), routed via RIB
IP: s=192.220.33.1 (FastEthernet0/0), d=192.220.11.1 (Serial2/0), g=192.220.11.1, len 128, forward
IP: tableid=0, s=192.220.11.1 (Serial2/0), d=192.220.33.1 (FastEthernet0/0), routed via RIB
IP: s=192.220.11.1 (Serial2/0), d=192.220.33.1 (FastEthernet0/0), g=192.220.33.1, len 128, forward
IP分组从S2/0端口转发
7.在R1或R2上将S2/0端口关闭(shutdown),测试PC11到PC33的连通性,并在路由器上采用debug ip packet命令观察IP分组从那个端口转发。
Router#debug ip packet
Packet debugging is on
Router#
IP: tableid=0, s=192.220.33.1 (FastEthernet0/0), d=192.220.11.1 (Serial3/0), routed via RIB
IP: s=192.220.33.1 (FastEthernet0/0), d=192.220.11.1 (Serial3/0), g=192.220.11.1, len 128, forward
IP: tableid=0, s=192.220.11.1 (Serial3/0), d=192.220.33.1 (FastEthernet0/0), routed via RIB
IP: s=192.220.11.1 (Serial3/0), d=192.220.33.1 (FastEthernet0/0), g=192.220.33.1, len 128, forward
IP分组从S3/0端口转发