Transition Mechanisms · Topic 2 of 2

IPv6 Tunneling Mechanisms

Learn how IPv6 tunnels carry IPv6 across IPv4 networks, including 6in4, 6to4, Teredo, ISATAP and tunnel brokers, and how they differ from translation.

  • 6 min
In a nutshell
  • A tunnel wraps IPv6 packets inside IPv4 packets across an IPv4 network.
  • 6in4 is a manual point to point tunnel that uses IPv4 protocol 41.
  • 6to4 uses the prefix 2002::/16 plus the IPv4 address, and needs a public address.

What it is

A tunnel carries IPv6 packets across a network that does not support IPv6, by wrapping them in IPv4 packets.

Suppose two IPv6 sites are connected only by an IPv4 network. A router at each site puts the IPv6 packet inside an IPv4 packet and sends it across. The router at the far end removes the wrapper and forwards the IPv6 packet.

This is called encapsulation. The IPv4 network never looks inside, so it does not need any IPv6 support.

IPv6 site A2001:db8:1::/64Router Awraps in IPv4IPv4 networkRouter BunwrapsIPv6 site B2001:db8:2::/64

How it works

Tunnel mechanisms differ in how the endpoints are found and how addresses are built.

6in4, the manual tunnel

6in4 is a fixed tunnel between two configured endpoints. The IPv6 packet is placed directly inside an IPv4 packet, and the IPv4 header uses protocol number 41.

You must know the IPv4 address of both endpoints in advance, so this is a point to point tunnel. It is predictable and easy to troubleshoot. It is the type most tunnel providers use.

The IPv4 header adds 20 bytes. The tunnel MTU is lower than the MTU of the link under it, which links back to the Path MTU Discovery topic.

6to4, the automatic tunnel

6to4 builds the IPv6 prefix from a public IPv4 address, so no per tunnel setup is needed. The prefix is 2002::/16 followed by the 32 bit IPv4 address. That gives a /48 prefix to the site.

For example, the IPv4 address 192.0.2.1 is c000:0201 in hex. The site prefix is 2002:c000:201::/48.

IPv4 address192.0.2.1convert to hexc000:0201add 2002 in frontSite prefix2002:c000:201::/48

Traffic to a destination outside 2002::/16 goes to a relay router, which connects 6to4 sites to the native IPv6 network. 6to4 needs a public IPv4 address, so it fails behind NAT. It also depends on relays outside your control, so it is no longer recommended.

Tunnel brokers

A tunnel broker is a service that gives you a 6in4 tunnel and a routed IPv6 prefix. You sign up, and the broker provides the endpoint addresses and the prefix.

This suits a site whose ISP does not offer IPv6. The broker's server forwards your IPv6 traffic to the Internet. The tunnel carries all your traffic, so its location affects delay.

Teredo and ISATAP

These two are mainly host level tunnels:

  • Teredo: wraps IPv6 in UDP, so it passes through NAT. It uses the 2001::/32 prefix.
  • ISATAP: treats an IPv4 network as an IPv6 link, and builds the interface ID from the IPv4 address. It suits a site that runs IPv4 internally.

Both are transition tools, and neither is a good choice for new designs. For the exam, know what each one does and that Teredo works through NAT.

6rd, the provider version of 6to4

6rd (IPv6 rapid deployment) works like 6to4, but the prefix belongs to the ISP and not to the fixed 2002::/16 block. The customer router (CE) builds its prefix from the ISP's own IPv6 prefix plus all or part of its IPv4 address. Traffic leaves through a border relay run by the ISP, and the packets still travel in IPv4 protocol 41.

For example, the ISP prefix 2001:db8::/32 and the address 192.0.2.1 (c000:0201) give the customer prefix 2001:db8:c000:201::/64.

6to46rd
Prefix2002::/16 plus IPv4 addressThe ISP's own prefix plus IPv4 address
RelayPublic relays you do not controlBorder relay run by the ISP
ReliabilityDepends on third partiesThe ISP controls the whole path

DS-Lite, IPv4 over an IPv6 only network

DS-Lite (Dual-Stack Lite) goes the other way: the ISP access network carries only IPv6, and IPv4 packets travel inside IPv6. The customer router, called the B4, builds an IPv4 in IPv6 tunnel to the ISP's AFTR (address family transition router). The AFTR removes the wrapper and applies carrier grade NAT44, which translates the private IPv4 addresses of many customers to shared public ones.

IPv4 LANprivate addressesB4 routerCPEIPv4 in IPv6 tunnelAFTRISPcarrier grade NAT44IPv4 Internet

On RouterOS the CPE side is an /interface ipipv6 tunnel whose remote address is the AFTR, with an IPv4 default route into it.

/interface ipipv6 add name=dslite1 local-address=2001:db8:a::2 remote-address=2001:db8:b::1
/ip route add dst-address=0.0.0.0/0 gateway=dslite1
Exam tip

6rd and 6to4 carry IPv6 over IPv4. DS-Lite carries IPv4 over IPv6, so the customer keeps IPv4 service without a public IPv4 address.

Comparing the mechanisms

MechanismSetupWorks through NATNotes
6in4Manual, point to pointOnly with a public endpointProtocol 41, used by brokers
6to4AutomaticNoPrefix 2002::/16 plus IPv4 address
TeredoAutomatic, host levelYesUses UDP, prefix 2001::/32
ISATAPAutomatic, site levelNoInterface ID holds the IPv4 address

Tunnelling versus translation

A tunnel carries IPv6 packets unchanged. A translation mechanism changes IPv6 packets into IPv4 packets, and back. Translation lets an IPv6 only host talk to an IPv4 only server.

NAT64 and DNS64 are translation tools, and they are different from tunnels. Do not confuse them with the mechanisms above.

Tunnels on RouterOS

RouterOS has a 6to4 interface type, found in the /interface 6to4 menu. Despite its name, it carries a point to point IPv6 over IPv4 tunnel, which is how a broker tunnel is built. The interoperability chapter shows the configuration.

/interface 6to4 print

IPv4 tunnels such as GRE and IPIP can also carry IPv6 traffic as the payload, because a tunnel interface is a link that holds an IPv6 address like any other.

Exam tip

Count the extra header when you work out MTU. A 6in4 tunnel on a 1500 byte Ethernet link leaves 1480 bytes for the inner packet.

What to remember for the exam

Eight facts cover most questions on this topic.

  • A tunnel wraps IPv6 packets inside IPv4 packets across an IPv4 network.
  • 6in4 is a manual point to point tunnel that uses IPv4 protocol 41.
  • 6to4 uses the prefix 2002::/16 plus the IPv4 address, and needs a public address.
  • A tunnel broker gives you a 6in4 tunnel and a routed prefix.
  • Teredo carries IPv6 in UDP, so it works through NAT.
  • ISATAP builds the interface ID from an IPv4 address.
  • The tunnel header reduces the MTU of the inner packet.
  • Tunnelling carries IPv6 unchanged, and translation changes it into IPv4.
Watch out

6to4 does not work behind NAT, because the prefix is built from a public IPv4 address.

Common mistakes

These four mistakes appear often.

Using 6to4 behind NAT. The IPv4 address is private, so the prefix and return traffic are wrong.

Ignoring the tunnel MTU. Large packets fail because the wrapper makes them too big.

Mixing tunnels with translation. A tunnel keeps IPv6 as IPv6. Translation turns it into IPv4.

Mixing up 6to4 and 6in4. 6to4 is automatic and uses 2002::/16. 6in4 is a manual tunnel with a prefix from a provider.

Check yourself

Work through these three questions.

  • Which IPv4 protocol number carries 6in4 packets?

    Protocol number 41.

  • Which prefix does 6to4 use, and what is added to it?

    It uses 2002::/16, followed by the 32 bit IPv4 address of the site.

  • What is the difference between a tunnel and a translation mechanism?

    A tunnel carries IPv6 packets unchanged inside IPv4, and translation changes IPv6 packets into IPv4 packets.

Topic 2 of 2 in Transition Mechanisms

Test yourself on Transition Mechanisms

The full MikroTik MTCIPv6E question bank has 486 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.