Translate into:   Dutch | French | German | Spanish 

( Alpharacks )

How to configure IPv6 on a OpenVZ VPS ( Virtual Private Server )

You can get IPv6 connectivity using a tunnel, if you don’t have native IPv6 support. Doing this is pretty straightforward if you have a dedicated server or a KVM VPS. However, with an OpenVZ VPS, things are a little different.

Here’s how you can get IPv6 working on a OpenVZ VPS with a tunnel.


1.Create a tunnel for your VPS at tunnelbroker.net (Hurricane Electric) allows creation of up to 5 free IPv6 tunnels @ tunnelbroker.net.
2.Enable TUN/TAP on your VPS. Via the controlpanel your provider offers you or request TUN/TAP via a support ticket.
3.Is a userspace program that utilizes TUN/TAP to build a tunnelbroker tunnel on linux. Since we can’t do it any other way on a OpenVZ VPS.
for Debian/Ubuntu and other Debian-based Linux distributions
apt-get -y install iproute gcc
for CentOS/Fedora and other RPM-based Linux distributions
yum -y install iproute gcc

Then:
cd /root
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/tb-tun/tb-tun_r18.tar.gz
tar -xf tb-tun_r18.tar.gz
gcc tb_userspace.c -l pthread -o tb_userspace
chmod 0777 /root/tb_userspace
4.Create a new init script.
nano /etc/init.d/ipv6tb

and put in the following contents (after replacing the correct IP addresses, of course) remember, for the tunnel, your VPS IP is the client and the Hurricane Electric IP is the server.

#! /bin/sh
 
### BEGIN INIT INFO
# Provides:          ipv6
# Required-Start:    $local_fs $all
# Required-Stop:     $local_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the ipv6 tunnel 
# Description:       ipv6 tunnel start-stop-daemon
### END INIT INFO
 
# /etc/init.d/ipv6tb
 
touch /var/lock/ipv6tb
 
case "$1" in
  start)
    echo "Starting ipv6tb "
      setsid /root/tb_userspace tb [Server IPv4 Address] [Client IPv4 Address] sit > /dev/null 2>&1 &
      sleep 3s #ugly, but doesn't seem to work at startup otherwise
      ifconfig tb up
      ifconfig tb inet6 add [Client IPv6 Address from your Routed /64]
      ifconfig tb inet6 add [IPv6 Address within your routed /64]| #Add as many of these as you need from your routed /64 allocation
      ifconfig tb mtu 1480
      route -A inet6 add ::/0 dev tb
      route -A inet6 del ::/0 dev venet0
    ;;
  stop)
    echo "Stopping ipv6tb"
      ifconfig tb down
      route -A inet6 del ::/0 dev tb
      killall tb_userspace
    ;;
  *)
    echo "Usage: /etc/init.d/ipv6tb {start|stop}"
    exit 1
    ;;
esac

exit 0

Make it executable, and add it to startup
chmod 0755 /etc/init.d/ipv6tb
update-rc.d ipv6tb defaults
5.Execute it right away
/etc/init.d/ipv6tb start
OR reboot the VPS.
6.Test to confirm that IPv6 connectivity is working
ping6 -c 5 google.com

In case you would like to run a mailserver or nameserver, don't forget to enable these functions in the Advanced tab at Hurricane Electric's controlpanel.

You are also able to set-up your own Reverse Records, under the rDNS Delegations part, your able to set the default nameservers of Hurricane Electric or pick your own nameservers.



alpharacks.ml, alpharacks.cf, alpharacks.ga, alpharacks.gq, hiformance.cf, serveur-prive-virtuel.ga, serveur-prive-virtuel.ml, virtual-private-server.cf, virtual-private-server.ga, virtual-private-server.ml, vpsdiscount.ga, vpsdiscount.ml, vpsdiscounter.ga, vpsdiscounter.ml