News
发布日期:2023-09-22 浏览次数:1187 来源:WOLF-LAB赵顺杰
EI CCNA|CCNP培训基础IPv6-静态路由的书写方式含实验拓扑_出接口_下一跳的不同
学网络就选WOLFLAB(沃尔夫)网络实验室,思科认证CCNA、CCNP、CCIE培训咨询联系网站客服!
EI CCNA|CCNP培训-IPv6静态路由的书写
EI CCNA|CCNP培训-实验拓补:
R1配置:
R1(config)#int g0/0
R1(config)#ipv6 unicast-routing
R1(config-if)#no shutdown
R1(config-if)#ipv6 address 2001:12::1/64
R2配置:
R2(config)#ipv6 unicast-routing
R2(config)#int g0/0
R2(config-if)#no shutdown
R2(config-if)#ipv6 address 2001:12::2/64
R2(config)#int g0/1
R2(config-if)#no shutdown
R2(config-if)#ipv6 address 2001:23::2/64
R3配置:
R3(config)#ipv6 unicast-routing
R3(config-if)#no shutdown
R3(config-if)#ipv6 address 2001:23::3/64
配置IPv6静态路由跟出接口
R1配置:
R1(config)#ipv6 route 2001:23::/64 g0/0
R3配置:
R3(config)#ipv6 route 2001:12::/64 g0/1
R1的IPv6路由表:
R1#show ipv6 route
C 2001:12::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:12::1/128 [0/0]
via GigabitEthernet0/0, receive
S 2001:23::/64 [1/0]
via GigabitEthernet0/0, directly connected
L FF00::/8 [0/0]
via Null0, receive
R2路由表:
R2#show ipv6 route
C 2001:12::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:12::2/128 [0/0]
via GigabitEthernet0/0, receive
C 2001:23::/64 [0/0]
via GigabitEthernet0/1, directly connected
L 2001:23::2/128 [0/0]
via GigabitEthernet0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R3路由表:
R3#show ipv6 route
S 2001:12::/64 [1/0]
via GigabitEthernet0/1, directly connected
C 2001:23::/64 [0/0]
via GigabitEthernet0/1, directly connected
L 2001:23::3/128 [0/0]
via GigabitEthernet0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R1访问R3:
R1#ping 2001:23::3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:23::3, timeout is 2 seconds:
.....
访问失败!
由于静态路由跟出接口,如同曾经的ARP协议一样,不晓得数据流量的下一跳路由器只能够请求目的IPv6地址的对应MAC地址,这时R1发送的NS消息所指向的目的地址是2001:23::3的被请求节点组播地址.而R2的接口却并没有加入到此组播当中,对于这个组播数据包,R2当然置之不理,谁让我连这个组的组成员都不是呢(笑)
R1的NS消息数据包:
R2的G0/0 IPv6接口信息
R2#show ipv6 int g0/0
GigabitEthernet0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::5200:FF:FE06:0
No Virtual link-local address(es):
Global unicast address(es):
2001:12::2, subnet is 2001:12::/64
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:2
FF02::1:FF06:0
因此,在IPv6当中静态路由跟出接口是无法访问目的地址的,可能有人会想为啥R2不帮忙回复NA(笑),人家R2在IPv4里头帮忙回复原因是人家有代理ARP,在IPv6里头ARP都没了咋回.而且人家接口都没进组播组里头,收都不收,里面的内容看都不看就丢了,ARP包人家看的原因是ARP是二层广播,谁都能看,路由器才打开看看,然后根据路由表是否可达才考虑帮不帮忙回复ARP.这里人家看都看不到就丢了,所以,结论是,静态路由跟下一跳,寄.
IPv6当中的静态路由不能跟出接口,必须指定下一跳地址.以下是简单实验.
R1配置:
R1(config)#no ipv6 route 2001:23::/64 g0/0
R1(config)#ipv6 route 2001:23::/64 G0/0 FE80::5200:FF:FE06:0 //跟Link-Local时指定出接口
R3配置:
R3(config)#no ipv6 route 2001:12::/64 g0/1
R3(config)#ipv6 route 2001:12::/64 G0/1 FE80::5200:FF:FE06:1 //跟Link-Local时指定出接口
R1的IPv6路由表:
R1#show ipv6 route
C 2001:12::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:12::1/128 [0/0]
via GigabitEthernet0/0, receive
S 2001:23::/64 [1/0]
via FE80::5200:FF:FE06:0, GigabitEthernet0/0
L FF00::/8 [0/0]
via Null0, receive
R2路由表:
R2#show ipv6 route
C 2001:12::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:12::2/128 [0/0]
via GigabitEthernet0/0, receive
C 2001:23::/64 [0/0]
via GigabitEthernet0/1, directly connected
L 2001:23::2/128 [0/0]
via GigabitEthernet0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R3路由表:
R3#show ipv6 route
S 2001:12::/64 [1/0]
via FE80::5200:FF:FE06:1, GigabitEthernet0/1
C 2001:23::/64 [0/0]
via GigabitEthernet0/1, directly connected
L 2001:23::3/128 [0/0]
via GigabitEthernet0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R1访问R3:
R1#ping 2001:23::3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:23::3, timeout is 2 seconds:
R1#ping 2001:23::3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:23::3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/5/17 ms
访问成功!当静态路由跟下一跳时路由器很明确直到数据包该交给谁,这时发送的NS消息将会是下一跳路由器也就是R2的G0/0接口的Link-Local地址,并将获取的MAC地址封装数据包.
WOLFLAB官方微信:17316362402
WOLFLAB官方QQ:2569790740
思科认证CCNA、CCNP、CCIE培训咨询联系网站客服!课程循环开班!