O'Reilly logo

Cisco IOS Cookbook, 2nd Edition by Ian Brown, Kevin Dooley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Translating Between IPv6 and IPv4

Problem

You want to configure a router to act as a gateway between IPv4 and IPv6 networks.

Solution

Cisco includes a protocol translation feature that allows you to interconnect IPv6 and IPv4 networks:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ipv6 access-list ALLOWED-NAT-DEVS
Router1(config-ipv6-acl)# permit ipv6 any any
Router1(config-ipv6-acl)#exit
Router1(config)#ipv6 nat prefix ::FFFF:0.0.0.0/96 v4-mapped ALLOWED-NAT-DEVS
Router1(config)#ipv6 nat v6v4 source AAAA:5::AA9 192.168.56.100
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no ip address
Router1(config-if)#ipv6 address AAAA:5::2012/64
Router1(config-if)#ipv6 nat
Router1(config-if)#exit
Router1(config)#interface Serial0/0
Router1(config-if)#ip address 192.168.55.12 255.255.255.0
Router1(config-if)#ipv6 nat
Router1(config-if)#exit
Router1(config)#end
Router1#

Discussion

Starting in IOS Version 12.2(13)T, Cisco introduced the ability to use a router as a protocol gateway, translating between IPv6 and IPv4 worlds by means of Network Address Translation with Protocol Translation (NAT-PT). For more information on NAT in general, please refer to Chapter 21.

RFCs 4038 and 4291 include discussions of how to address IPv4 packets that originate in an IPv6 network. The current standard method is called the “IPv4-Mapped IPv6 Address,” which works very simply. If an IPv6 device wants to send a packet to an IPv4 device whose address ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required