6to4 IPv6 – Configuring Tunnel Address

ciscoipip addressipv4ipv6

http://packetlife.net/blog/2010/mar/15/6to4-ipv6-tunneling/

In order to configure a 6to4 tunnel on R2 router, you execute the following commands:

R2(config)# interface tunnel0
R2(config-if)# tunnel mode ipv6ip 6to4
R2(config-if)# tunnel source 10.0.2.1
R2(config-if)# ipv6 address 2002:a00:201::/128

Does anyone know why on earth should I specify the Ipv6 address of the tunnel (last command)? The fact that I've written:

R2(config-if)# ipv6 address 2002:a00:201::/128

is not used by R2 at any point, I believe – R2 doesn't need that information.

When an IPv6 host behind R1 sends a packet to an IPv6 host 2001:db8:0:2::/64 behind R2, the first thing that happens is R1 checks its routing table. We configured R1 in the following way:

ipv6 route 2002::/16 tunnel0
ipv6 route 2001:db8:0:2::/64 2002:a00:201::

It then puts the IPv6 packet inside an IPv4 packet and sets the IPv4 destination address to 10.0.2.1 – it extracts the destination address from the second address in this line, which created an entry in the routing table: ipv6 route 2001:db8:0:2::/64 2002:a00:201::.

So if we didn't set the IPv6 tunnel address on R2 (R2(config-if)# ipv6 address 2002:a00:201::/128), I guess it wouldn't change anything, because the packet would arrive to R2 anyway. Then why should we do it?

By the way, 10.0.2.1 is a private IP address, so it shouldn't be used in a 6to4 address (only public IPs are allowed) – I think the article is wrong in this aspect.

Best Answer

The IPv6 address is the network address assigned to the interface of the tunnel. I don't know where you came up with the /128 because that is used for something like a loopback.

Specifies the IPv6 network assigned to the interface and enables IPv6 processing on the interface.

Something like this from the Cisco documentation:

Example: Configuring 6to4 Tunnels

The following example configures a 6to4 tunnel on a border router in an isolated IPv6 network. The IPv4 address is 192.168.99.1, which translates to the IPv6 prefix of 2002:c0a8:6301::/48. The IPv6 prefix is subnetted into 2002:c0a8:6301::/64 for the tunnel interface: 2002:c0a8:6301:1::/64 for the first IPv6 network, and 2002:c0a8:6301:2::/64 for the second IPv6 network. The static route ensures that any other traffic for the IPv6 prefix 2002::/16 is directed to tunnel interface 0 for automatic tunneling.

interface GigabitEthernet0/0/0
 description IPv4 uplink
 ip address 192.168.99.1 255.255.255.0
!
interface GigabitEthernet1/0/0
 description IPv6 local network 1
 ipv6 address 2002:c0a8:6301:1::1/64 
!
interface GigabitEthernet2/0/0
 description IPv6 local network 2
 ipv6 address 2002:c0a8:6301:2::1/64 
!
interface Tunnel0
 description IPv6 uplink
 no ip address
 ipv6 address 2002:c0a8:6301::1/64 
 tunnel source GigabitEthernet0/0/0
 tunnel mode ipv6ip 6to4
!
ipv6 route 2002::/16 tunnel 0
Related Topic