IPv6 RIP(RIPng)
IPv6的RIP,所有路由规则与IPv4 RIPv2基本相同,不同之处是IPv4 RIPv2使用UDP端口520,而RIPng使用UDP端口521,IPv4 RIPv2数据包更新使用的地址224.0.0.9,而RIPng使用的更新地址是FF02::9。
在配置RIPng时,方法不同于IPv4 RIP,RIPng是采用先配置进程1,然后需要让哪些接口运行在RIPng下,就必须到相应的接口下明确指定,并不像IPv4 RIP那样在进程下通过network来发布。
配置RIPng
1.初始化配置:
R1初始配置:
R1(config)#ipv6 unicast-routing R1(config)#int f0/0 R1(config-if)#ipv6 address 2012:1:1:11::1/64 R1(config-if)#int loo1 R1(config-if)#ipv6 address 3001:1:1:11::1/64 R1(config-if)#int loo2 R1(config-if)#ipv6 address 3002:1:1:11::1/64 R1(config-if)#int loo3 R1(config-if)#ipv6 address 3003:1:1:11::1/64
R2初始配置:
R2#conf t R2(config)#ipv6 unicast-routing R2(config)#int f0/0 R2(config-if)#ipv6 address 2012:1:1:11::2/64 R2(config-if)#int loo0 R2(config-if)#ipv6 address 2022:2:2:22::2/64
2.启动RIPng进程
说明:Cisco IOS 最大同时支持4个RIPng的进程,不同进程使用不同名字来区分,并且进程名为本地有效。
在R1上启动RIPng进程
R1(config-if)#ipv6 router rip ccie R1(config-rtr)#exit
在R2上启动RIPng进程
R2(config)#ipv6 router rip ccie R2(config-rtr)#exit
3. 配置RIPng接口
将R1上的接口放进RIPng进程
R1(config)#int f0/0 R1(config-if)#ipv6 rip ccie enable R1(config-if)#int loopback 1 R1(config-if)#ipv6 rip ccie enable
将R2上的接口放进RIPng进程
R2(config)#int f0/0 R2(config-if)#ipv6 rip ccie enable R2(config-if)#int loo0 R2(config-if)#int loopback 0 R2(config-if)#ipv6 rip ccie enable
4. 查看RIPng路由
查看R1的RIPng路由
R1#show ipv6 route rip IPv6 Routing Table - 13 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 R 2022:2:2:22::/64 [120/2] via FE80::CE02:48FF:FE88:0, FastEthernet0/0
说明:由于RIPng配置正确,成功收到对方的路由条目,并且可以看出,动态路由学习到的IPv6路由条目,下一跳地址均与对端的链路本地地址。
查看R2的RIPng路由
R2#show ipv6 route rip IPv6 Routing Table - 8 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 R 2012:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0 R 3001:1:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0
说明:由于RIPng配置正确,成功收到对方路由条目。
5. 测试连通性
说明:因为动态路由学习到的IPv6路由条目,下一跳地址均为对端的链路本地地址,所以如果到对端的链路本地地址不通,那么到对端的IPv6网络也不会通。
测试R1的到对端的链路本地地址的连通性
R1#ping FE80::CE01:7AFF:FEA4:0 Output Interface: fastEthernet0/0 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to FE80::CE01:7AFF:FEA4:0, timeout is 2 seconds: Packet sent with a source address of FE80::CE01:7AFF:FEA4:0 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/4 ms
说明:到对端链路本地地址通信正常。
测试R1到对端IPv6网络的连通性
R1#ping 2022:2:2:22::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2022:2:2:22::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/48/56 ms
说明:由于到对端链路本地地址的通信正常,所以到对端的IPv6网络我通信业正常。
测试R2到对端的IPv6网络的连通性
R2#ping 3001:1:1:11::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3001:1:1:11::1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 24/44/64 ms
说明:到对端IPv6网络的通信也正常。
6. 重分布IPv6网段
说明:将R1上的剩余网段重分布进RIPng
在R1上配置重分布剩余网段进RIPng
R1(config)#route-map ccnp permit 10 R1(config-route-map)#match interface loopback2 R1(config-route-map)#exit R1(config)#route-map ccnp permit 20 R1(config-route-map)#match interface loopback 3 R1(config-route-map)#exit R1(config)#ipv6 router rip ccie R1(config-rtr)#redistribute connected route-map ccnp
在R2上查看重分布进RIPng的剩余网段
R2#show ipv6 route rip IPv6 Routing Table - 10 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 R 2012:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0 R 3001:1:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0 R 3002:1:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0 R 3003:1:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0
说明:可以看到,R1上的剩余网段成功被重分布进RIPng。
7. 过滤IPv6路由
说明:在R2上过滤掉IPv6路由,只留想要的网段,使用distribute-list过滤
配置只留3002:1:1:11::/64网段
R2(config)#ipv6 prefix-list ccna permit 3002:1:1:11::/64 R2(config)#ipv6 router rip ccie R2(config-rtr)#distribute-list prefix-list ccna in f0/0
注:IPv6的 prefix-list 同样支持ge,le等关键字来匹配范围。
查看过滤后的路由表情况
R2(config-rtr)#end R2# R2#show ipv6 route rip IPv6 Routing Table - 7 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 R 3002:1:1:11::/64 [120/2] via FE80::CE01:7AFF:FEA4:0, FastEthernet0/0
说明:路由表只剩余想要的网段,说明过滤成功。