Friday, March 13, 2015

IPv6 Internet access from IPv4 (BSNL) DSL Connection

As of now AFAIK BSNL, the largest ISP in India, is not providing IPv6 Internet to DSL home users. So here is a cool way to connect to IPv6 Internet using a IPv4 DSL connection.

Scenario:
I have a BSNL DSL Broadband connection with dynamic IPv4 address with NAT.
Here I will demonstrate a way to access IPv6 Internet using a IPv6-over-IPv4 tunnel from tunnel broker Hurrican Electric. I am running Ubuntu Linux 14.04.

TL DR:

Signup with any IPv6 tunnel brokers in internet like Hurrican Electric or SixxS. Create a regular IPv6 tunnel. Add v4tunnel interface configuration in our computer.



Detailed Steps
  1. Create an account with Hurricane Electric at https://tunnelbroker.net/ .
  2. Login to https://tunnelbroker.net/ . 
  3. On the home page, Go to "Create Regular Tunnel" under "USER FUNCTIONS". Fill the form to create the tunnel. IPv4 Endpoint (Your side):  Add your public ip ( shown below as IP you are viewing from. )
    Select a server preferably from Asia. 

  4. After the tunnel gets created, you will be redirected to "Tunnel Detail" page where you can see the complete tunnel configuration. You can get your OS specific network interface configuration from "Example Configuration" tab.
  5. Change the default MTU value in "Advanced" tab to 1280


For Debian/Ubuntu, Tunnel configuration will be like this:

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        address 2001:470:35:d62::2
        netmask 64
        endpoint 216.218.221.42
        local 61.246.252.1
        ttl 255
        gateway 2001:470:35:d62::1



Do some changes in this configuration as follows. NOTE 1: If you are behind NAT router: then change the local IP to your static private IP, Say 192.168.1.6.

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        address 2001:470:35:d62::2
        netmask 64
        endpoint 216.218.221.42
        local 192.168.1.6
        ttl 255
        mtu 1280
        up ip -6 route add default dev he-ipv6
        down ip -6 route del default dev he-ipv6


Add this configuration to /etc/network/interfaces file. Now bring the tunnel interface up.


sudo ifup he-ipv6

Now you are ready to go. Verify IPv6 connectivity by pinging some global IPv6 address .


IPv6 Tunnel configuration for Windows

Configuration for Windows 10 is as follows:
netsh interface teredo set state disabled
netsh interface ipv6 add v6v4tunnel interface=IP6Tunnel localaddress=61.246.252.1 remoteaddress=216.218.221.42
netsh interface ipv6 add address interface=IP6Tunnel address=2001:470:35:d62::2
netsh interface ipv6 add route prefix=::/0 interface=IP6Tunnel nexthop=2001:470:35:d62::1
If you are behind NAT, use your private IP as localaddress.
netsh interface teredo set state disabled
netsh interface ipv6 add v6v4tunnel interface=IP6Tunnel localaddress=192.168.1.6 remoteaddress=216.218.221.42
netsh interface ipv6 add address interface=IP6Tunnel address=2001:470:35:d62::2
netsh interface ipv6 add route prefix=::/0 interface=IP6Tunnel nexthop=2001:470:35:d62::1

Firewall settings

Please note that if there is any firewall in between, It should allow the flow of traffic - Protocol 41 (IPv6-in-IPv4) and ICMPv6.