实验环境
要求: IPv6终端有访问互联网LoopBack18-20.20.20.20地址需求,为此在R2路由器部署NAT-PT实现IPv6地址的动态转换,具体规划内网IPv6地址转换地址池为10.1.0.3-10.1.0.5,20.20.20.20转换为2005:20:20:20::20
R1配置
interface GigabitEthernet 0/0
ip address 10.0.1.1 255.255.255.248
!
interface Loopback 0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback 18
ip address 20.20.20.20 255.255.255.255
R2配置!!!
interface GigabitEthernet 0/0
ip address 10.0.1.2 255.255.255.248
ipv6 nat
!
interface GigabitEthernet 0/1
ip ospf network point-to-point
ip address 10.0.0.1 255.255.255.252
ipv6 address 2006:10:1::1/64
ipv6 enable
ipv6 ospf network point-to-point
ipv6 ospf 21 area 0
ipv6 nat
!
interface Loopback 0
ip address 2.2.2.2 255.255.255.255
!
ipv6 access-list ipv6acl
10 permit ipv6 2006:10:1::/64 any
!
ipv6 route ::/0 GigabitEthernet 0/0 ---默认路由指向出接口,若没有此默认无法通信
!
!
ipv6 router ospf 21
default-information originate metric-type 1 ---要想内网客户可以访问IPv6互联网,就要下发默认路由
!
ipv6 nat prefix 2005:20:20:20::/96 ---匹配目的地址前缀
ipv6 nat v6v4 pool v6pool 10.0.1.3 10.0.1.5 prefix-length 29
ipv6 nat v6v4 source list ipv6acl pool v6pool overload
ipv6 nat v4v6 source 20.20.20.20 2005:20:20:20::20
!
router ospf 20
network 2.2.2.2 0.0.0.0 area 0
network 10.0.0.1 0.0.0.0 area 0
default-information originate metric-type 1 ---
!
ip route 0.0.0.0 0.0.0.0 10.0.1.1 ---IPv6可以通的前提是出口路由器IPv4可以通信
R3配置
interface GigabitEthernet 0/0
ip ospf network point-to-point
ip address 10.0.0.2 255.255.255.252
ipv6 address 2006:10:1::2/64
ipv6 enable
ipv6 ospf network point-to-point
ipv6 ospf 21 area 0
!
interface Loopback 0
ip address 3.3.3.3 255.255.255.255
!
router ospf 20
network 3.3.3.3 0.0.0.0 area 0
network 10.0.0.2 0.0.0.0 area 0
路由表
R2
R3
成果验证