How to configure IPv6 Automatic 6to4 Tunneling

Dynamic multipoint IPv6 tunnels are another migration technique we can use. It’s called dynamic because we don’t have to specify the end-point IPv4 address ourselves but its being automatically determined. The downside of multipoint IPv6 tunnels is that they don’t support IPv6 IGPs. You have to use static routes or BGP.

There are two different flavors:

Let’s dive in the automatic 6to4 tunnel to see how it works. We don’t configure the IPv4 end-point address ourselves but instead the IPv4 end-point address will be wrapped in the IPv6 destination address. Our IPv4 address is only 32-bit so it’s easy to fit it in a 128-bit IPv6 address right?

The 2002::/16 range has been reserved to use for tunneling. This IPv6 address space is only for tunneling and will never be used for IPv6 global unicast addresses. If we start with the 2002::/16 prefix we create a /48 prefix for each tunnel end-point. What we have to do is take the IPv4 address of the end-point and convert it into hexadecimal as bits 17 to 48.

The second step is that we can create subnets from /48 up to /64 prefixes for all the subnets behind the end-point.

IPv6 Tunneling Prefix

Here’s a graphical overview. 2002::/16 is the range we can use for the tunnels. The second part is the IPv4 end-point address converted to hexadecimal. Up to /64 we can use to create subnets. C0A8:1703 converts to IPv4 address 192.168.23.3. Do you have trouble calculating from hex to binary/decimal and vice versa?

R3(config)#ipv6 general-prefix MYPREFIX 6to4 fastEthernet 0/0

R3#show ipv6 general-prefix  
IPv6 Prefix MYPREFIX, acquired via 6to4
  2002:C0A8:1703::/48

There is a neat trick on Cisco routers that can do the work for you. First you have to configure an IPv4 address on an interface and then use the ipv6 general-prefix command. It will convert the IPv4 address in hexadecimal and give you the correct IPv6 tunnel prefix with the show ipv6 general-prefix command. I’m not sure if this is available on the CCNP ROUTE exam but it’s nice to know anyway! Let’s take a look at an actual configuration of automatic 6to4 tunneling, this is the topology:

ipv6 static tunneling

Let’s look at another example and configure automatic tunneling. The idea is that I don’t want to configure a tunnel destination on R1 nor R3…it should be created dynamically!

We’ll start with the configuration of the interfaces and IPv4 / IPv6 addresses:

R1(config)#interface loopback 0
R1(config-if)#ipv6 address 2001::1/128
R1(config-if)#exit
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#exit  
R2(config)#interface fastEthernet 1/0
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 0
R3(config-if)#ipv6 address 2001::3/128

Next step is to configure routing so that we have reachability in IPv4:

R1(config)#router eigrp 123
R1(config-router)#no auto-summary 
R1(config-router)#network 192.168.12.0
R2(config)#router eigrp 123
R2(config-router)#no auto-summary 
R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.23.0
R3(config)#router eigrp 123
R3(config-router)#no auto-summary 
R3(config-router)#network 192.168.23.0

We will use the FastEthernet0/0 interfaces to build the tunnel. Since the tunnel is created automatically we need to know the IPv6 equivalent of the IPv4 addresses:

R1(config)#ipv6 general-prefix MYPREFIX 6to4 fastEthernet 0/0
R3(config)#ipv6 general-prefix MYPREFIX 6to4 fastEthernet 0/0
R1#show ipv6 general-prefix 
IPv6 Prefix MYPREFIX, acquired via 6to4
  2002:C0A8:C01::/48
R3#show ipv6 general-prefix 
IPv6 Prefix MYPREFIX, acquired via 6to4
  2002:C0A8:1703::/48

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 655 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

546 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Hello,

    I have a question regarding the 6to4 implementation:
    Should it work if i use another prefix than 2002:?

    I read couple of articles and in every place it’s written that 2002 is reserved for 6to4 implementation (like router knows how to extract 32 bit IPv4 address encoded in Hex format that goes after that prefix).

    But in my lab i just used another prefix (just for testing): 1002: and the 6to4 stuff worked properly as well.

    Can you please explain this behavior? Is it a correct and expected behavior or not?

    Thanks,
    Vladimir

  2. Hi @hussien.samer

    Remove the following two static routes:

    R1(config)#ipv6 route 2001::3/128 2002:C0A8:1703::3  
    R3(config)#ipv6 route 2001::1/128 2002:C0A8:C01::1  
    

    And then add a BGP configuration like this. R1:

    R1(config)#router bgp 13
    R1(config-router)#bgp log-neighbor-changes
    R1(config-router)#neighbor 2002:C0A8:1703::3 remote-as 13
    
    R1(config-router)#address-family ipv6
    R1(config-router-af)# neighbor 2002:C0A8:1703::3 activate
    R1(config-router-af)#exit-address-family
    

    R3:

    R3(config)#router bgp 13
    R3(config-router)#bgp log-neighbor-changes
    R3(config-router
    ... Continue reading in our forum

  3. Hey, can you please explain this sentence more thoroughly:
    “The second step is that we can create subnets from /48 up to /64 prefixes for all the subnets behind the end-point.”

    Why shouldn’t we always use a host mask (/128) for the tunnel 6to4 address?
    (2002:C0A8:1703::/128 for your configuration)

  4. Hello Inon

    If we have an IPv4 address of 192.168.23.3 as in the lesson, then the automatic 6to4 tunnelling will use 2002:C0A8:1703 as the beginning of the IPv6 address. Now from this, we can use any subnet prefix of /48 to /64 to represent the IPv6 addresses behind each end of the tunnel. So in a sense, 2002:C0A8:1703::/48 represents the tunnel interface on R1. All IPv6 addresses behind R1 will be mapped to the appropriate address. For example:

    We ping from 2001::3/128 to 2001::1/128. When the ping reaches R3, it will be converted to 2002:C0A8:1703::1, sen

    ... Continue reading in our forum

29 more replies! Ask a question or join the discussion by visiting our Community Forum