1 对于IPv6的静态NAT-PT配置案例
实验拓扑:
实验目标:
在R1上做静态ipv4和ipv6地址的NAT转换,实现纯ipv4环境中的R2与纯ipv6环境中的的R3路由器互通
实验环境:
gns3模拟器 版本:2.1.16
思科路由器(IOS版本:C7200-ADVENTERPRISEK9-M Version 15.3(3)XB12)
配置命令:
R2
interface Serial3/0
ip address 192.168.30.9 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.30.10 //配置ipv4默认路由
R1
no ip cef //因为cef不支持ipv6 nat-pt,所以必须关闭
ipv6 unicast-routing //开启ipv6单播路由,否则nat不成功
interface Serial3/0
ip address 192.168.30.10 255.255.255.0
ipv6 enable
ipv6 nat //开启ipv6 nat
interface Serial3/1
no ip address
ipv6 address 2001:DB8:3002::9/64
ipv6 enable
ipv6 nat //开启ipv6 nat
ipv6 route ::/0 2001:DB8:3002::10 //配置nat转换后的ipv6默认路由
ipv6 nat v4v6 source 192.168.30.9 2000::960B:202 //将ipv4地址192.168.30.9一对一转换为ipv6地址2000::960B:202
ipv6 nat v6v4 source 3001:11:0:1::1 150.11.3.1 //将ipv6地址2000::960B:202一对一转换为150.11.3.1
ipv6 nat prefix 2000::/96 //设定进行ipv6地址到ipv4地址转换的前缀,只有符合该前缀的ipv6地址会被转换成ipv4地址
R3
interface Loopback0
no ip address
ipv6 address 3001:11:0:1::1/64
interface Serial3/0
no ip address
ipv6 address 2001:DB8:3002::10/64
ipv6 route ::/0 2001:DB8:3002::9 //配置ipv6默认路由
2 对于ipv4主机访问ipv6主机的动态NAT-PT配置案例
实验拓扑:
实验目标:
在R3上配置动态NAT-PT,实现纯ipv4网络环境中的R1和R2能够主动访问纯ipv6网络环境中的R4和R5,但是R4和R5不能主动访问R1和R2
实验环境
gns3模拟器 版本:2.1.16
思科路由器(IOS版本:C7200-ADVENTERPRISEK9-M Version 15.3(3)XB12)
配置命令
R1
interface FastEthernet0/0
ip address 192.168.30.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.30.3 //配置ipv4默认路由,下一跳指向R3
R2
interface FastEthernet0/1
ip address 192.168.30.2 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.30.3 //配置ipv4默认路由,下一跳指向R3
R3
no ip cef //不能开启ip cef,cef不支持ipv6
ipv6 unicast-routing //开启ipv6单播路由
interface FastEthernet0/0
ip address 192.168.30.3 255.255.255.0
ipv6 enable //这个命令必须要在ipv4接口上配置
ipv6 nat //使能ipv6 nat
interface FastEthernet0/1
ipv6 address 2001:DB8:BBBB:1::3/64
ipv6 nat //使能ipv6 nat
ipv6 nat v4v6 source list 72 pool v6pool //指定ipv4地址池中的地址动态转换未ipv6地址池中的地址
ipv6 nat v4v6 pool v6pool 2001:DB8::1 2001:DB8::2 prefix-length 128 //配置ipv6地址池
ipv6 nat v6v4 source 2001:DB8:BBBB:1::4 10.21.8.4 //静态配置ipv6到ipv4地址的映射
ipv6 nat v6v4 source 2001:DB8:BBBB:1::5 10.21.8.5
ipv6 nat prefix 2001:DB8::/96 //用有该ipv6地址前缀的ipv6地址会被转换成ipv4地址
access-list 72 permit 192.168.30.0 0.0.0.255 //配置需要进行动态地址转换的ipv4地址段
R4
interface FastEthernet0/0
ipv6 address 2001:DB8:BBBB:1::4/64
ipv6 route ::/0 2001:DB8:BBBB:1::3 //配置ipv6默认路由,下一跳指向R3
R5
interface FastEthernet0/0
ipv6 address 2001:DB8:BBBB:1::5/64
ipv6 route ::/0 2001:DB8:BBBB:1::3 //配置ipv6默认路由,下一跳指向R3
3 对于ipv6主机访问ipv4主机的动态NAT-PT配置案例
实验拓扑:
实验目标:
在R3上配置动态NAT-PT,实现纯ipv6网络环境中的R3和R4能够主动访问纯ipv4网络环境中的R1和R2,但是R1和R2不能主动访问R4和R5
实验环境:
gns3模拟器 版本:2.1.16
思科路由器(IOS版本:C7200-ADVENTERPRISEK9-M Version 15.3(3)XB12)
配置命令:
R1 、R2、R4、R5的配置命令和ipv4主机访问ipv6主机的动态NAT-PT配置案例相同
R3
no ip cef
ipv6 unicast-routing
interface FastEthernet0/0
ip address 192.168.30.3 255.255.255.0
ipv6 enable //这个命令必须要在ipv4接口上配置
ipv6 nat
interface FastEthernet0/1
ipv6 address 2001:DB8:BBBB:1::3/64
ipv6 nat
ipv6 nat v4v6 source 192.168.30.1 2001:DB8::1 //配置ipv6地址到ipv4地址的静态映射
ipv6 nat v4v6 source 192.168.30.2 2001:DB8::2
ipv6 nat v6v4 source list pt-list1 pool v4pool //配置ipv6地址和ipv4地址的动态转换
ipv6 nat v6v4 pool v4pool 10.21.8.1 10.21.8.2 prefix-length 24 //配置动态转换用的ipv4地址池
ipv6 nat prefix 2001:DB8::/96 //配置需要进行动态地址转换的ipv6地址包含的前缀
ipv6 access-list pt-list1
permit ipv6 2001:DB8:BBBB:1::/64 any //定义哪些ipv6地址需要进行动态地址转换