Translating Between IPv6 and IPv4


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


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 nat prefix ::FFFF: v4-mapped ALLOWED-NAT-DEVS
Router1(config)#ipv6 nat v6v4 source AAAA:5::AA9
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)#interface Serial0/0
Router1(config-if)#ip address
Router1(config-if)#ipv6 nat


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 ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.