配置6to4中继示例
本举例介绍6to4中继的配置过程。
组网需求
如图5-3所示,DeviceA为6to4路由设备,其IPv6侧连接的是6to4网络。DeviceB为6to4中继路由设备,它和IPv6的Internet网络(2001:db8::/64)相连。DeviceA和DeviceB通过IPv4骨干网络相连。要求在配置DeviceA和DeviceB之间的6to4隧道,使6to4网络的主机与IPv6网络的主机互通。
6to4中继路由设备与普通6to4路由设备之间的隧道的配置方法与普通6to4路由设备之间的隧道的配置方法相同。但是为了让6to4网络与IPv6网络互访,需要在普通6to4路由设备配置到IPv6网络的静态路由。
配置注意事项
在配置过程中,需要注意以下事项:
首先创建Tunnel接口,然后才能配置Tunnel的其他参数。
在配置6to4隧道时,只需确定Tunnel的源,Tunnel的目的地址是从原始的IPv6报文的目的地址中获取的。但两个6to4隧道的源不允许相同。
在边界路由设备与6to4网络相连的接口上必须配置6to4地址,在边界路由设备与IPv4网络相连的接口上必须配置IPv4地址。为了支持路由协议,也需要配置Tunnel接口的网络地址。
操作步骤
- 配置DeviceA
# 配置IPv4/IPv6双协议栈。
<HUAWEI> system-view [~HUAWEI] sysname DeviceA [*HUAWEI] commit [~DeviceA] interface GigabitEthernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] ip address 1.1.1.1 255.0.0.0 [*DeviceA-GigabitEthernet0/1/0] undo shutdown [*DeviceA-GigabitEthernet0/1/0] quit [*DeviceA] interface gigabitethernet 0/2/0 [*DeviceA-GigabitEthernet0/2/0] ipv6 enable [*DeviceA-GigabitEthernet0/2/0] ipv6 address 2002:0101:0101:1::1 64 [*DeviceA-GigabitEthernet0/2/0] undo shutdown [*DeviceA-GigabitEthernet0/2/0] quit
# 配置6to4隧道。
[*DeviceA] interface Tunnel10 [*DeviceA-Tunnel10] tunnel-protocol ipv6-ipv4 6to4 [*DeviceA-Tunnel10] ipv6 enable [*DeviceA-Tunnel10] ipv6 address 2002:0101:0101::1 64 [*DeviceA-Tunnel10] source 1.1.1.1 [*DeviceA-Tunnel10] quit
# 配置到2002::/16的静态路由。
[*DeviceA] ipv6 route-static 2002:: 16 Tunnel10
# 配置到本地IPv6网络的缺省路由。
[*DeviceA] ipv6 route-static :: 0 2002:0202:0202::1 [*DeviceA] commit
- 配置DeviceB
# 配置IPv4/IPv6双协议栈。
<HUAWEI> system-view [~HUAWEI] sysname DeviceB [*HUAWEI] commit [~DeviceB] interface GigabitEthernet 0/1/0 [~DeviceB-GigabitEthernet0/1/0] ip address 2.2.2.2 255.0.0.0 [*DeviceB-GigabitEthernet0/1/0] undo shutdown [*DeviceB-GigabitEthernet0/1/0] quit [*DeviceB] interface gigabitethernet 0/2/0 [*DeviceB-GigabitEthernet0/2/0] ipv6 enable [*DeviceB-GigabitEthernet0/2/0] ipv6 address 2001:db8::1 64 [*DeviceB-GigabitEthernet0/2/0] undo shutdown [*DeviceB-GigabitEthernet0/2/0] quit
# 配置6to4隧道。
[*DeviceB] interface Tunnel 10 [*DeviceB-Tunnel10] tunnel-protocol ipv6-ipv4 6to4 [*DeviceB-Tunnel10] ipv6 enable [*DeviceB-Tunnel10] ipv6 address 2002:0202:0202::1 64 [*DeviceB-Tunnel10] source 2.2.2.2 [*DeviceB-Tunnel10] quit
# 配置到2002::/16的静态路由。
[*DeviceB] ipv6 route-static 2002:: 16 Tunnel10 [*DeviceB] commit
- 检查配置结果
# 从DeviceA可以Ping通DeviceB的接口GE0/2/0的IPv6地址。
[~DeviceA] ping ipv6 2001:db8::1 PING 2001:db8::1 : 56 data bytes, press CTRL_C to break Reply from 2001:db8::1 bytes=56 Sequence=1 hop limit=64 time=10 ms Reply from 2001:db8::1 bytes=56 Sequence=2 hop limit=64 time=2 ms Reply from 2001:db8::1 bytes=56 Sequence=3 hop limit=64 time=2 ms Reply from 2001:db8::1 bytes=56 Sequence=4 hop limit=64 time=2 ms Reply from 2001:db8::1 bytes=56 Sequence=5 hop limit=64 time=2 ms --- 2001:db8::1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 5/14/29 ms
配置文件
DeviceA的配置文件
# sysname DeviceA # admin interface GigabitEthernet0/1/0 undo shutdown ip address 1.1.1.1 255.0.0.0 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2002:101:101:1::1/64 # interface Tunnel 10 ipv6 enable ipv6 address 2002:101:101::1/64 tunnel-protocol ipv6-ipv4 6to4 source 1.1.1.1 # ipv6 route-static :: 0 2002:202:202::1 # ipv6 route-static 2002:: 16 Tunnel 10 # return
DeviceB的配置文件
# sysname DeviceB # admin interface GigabitEthernet0/1/0 undo shutdown ip address 2.2.2.2 255.0.0.0 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8::1/64 # interface Tunnel 10 ipv6 enable ipv6 address 2002:202:202::1/64 tunnel-protocol ipv6-ipv4 6to4 source 2.2.2.2 # ipv6 route-static 2002:: 16 Tunnel 10 # return