CCNA学习笔记12--静态选择路由(实验)
实验拓扑:

实验目的:
掌握静态选择路由的配置和理解最长匹配原则
实验步骤:
|
1.基本配置 |
|
2.配置对应的IP地址 |
|
3. 做相关配置,能让R1通过R2能够ping通R3的环回口地址 R1(config)#ip route 33.1.1.0 255.255.255.0 12.1.1.2 R2(config)#ip route 33.1.1.0 255.255.255.0 23.1.1.3 R3(config)#ip route 12.1.1.0 255.255.255.0 23.1.1.2 R1#ping 33.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 33.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms R1#traceroute 33.1.1.1 Type escape sequence to abort. Tracing the route to 33.1.1.1 VRF info: (vrf in name/id, vrf out name/id) 1 12.1.1.2 0 msec 0 msec 1 msec 2 23.1.1.3 0 msec * 1 msec |
|
4. 需求:R1去往33.1.1.1直接通过R1->R3即可 R1去往33.1.1.2, 33.1.1.3, 33.1.1.4需要R1->R2->R3 R1(config)#ip route 33.1.1.1 255.255.255.255 13.1.1.3 R1#show ip route 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 12.1.1.0/24 is directly connected, Ethernet0/1 L 12.1.1.1/32 is directly connected, Ethernet0/1 13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 13.1.1.0/24 is directly connected, Ethernet0/0 L 13.1.1.1/32 is directly connected, Ethernet0/0 33.0.0.0/8 is variably subnetted, 2 subnets, 2 masks S 33.1.1.0/24 [1/0] via 12.1.1.2 S 33.1.1.1/32 [1/0] via 13.1.1.3 R1#traceroute 33.1.1.1 Type escape sequence to abort. Tracing the route to 33.1.1.1 VRF info: (vrf in name/id, vrf out name/id) 1 13.1.1.3 1 msec * 1 msec R1#traceroute 33.1.1.2 Type escape sequence to abort. Tracing the route to 33.1.1.2 VRF info: (vrf in name/id, vrf out name/id) 1 12.1.1.2 3 msec 0 msec 0 msec 2 23.1.1.3 1 msec * 1 msec 解释说明:可以发现通往33.1.1.1的路由有两条,分别是33.1.1.0/24和33.1.1.1/32,实验可知通往33.1.1.1的路由是选择的是33.1.1.1/32。根据就是:最长匹配原则。(最长匹配原则实现了处于同一网段的IP包选择不同的出口) |
浙公网安备 33010602011771号