ipv6 routing through Linux

Advanced feature discussion, beta programs and unsupported "Labs" features.
3 posts Page 1 of 1
by mtcccom » Thu Jul 12, 2012 1:32 pm
Hi all --

I didn't see this in the forums, so I thought I'd share how to set up a linux box that terminates
your 6 to 4 tunnel into a router so that other boxen on your home net can use v6 too.

First, you need to get the package radvd from yum/apt-get, etc. This package is for router
advertisements once you get everything set up.

Here's the assignments I got from Sonic once I got my tunnel:

Transport:: 2001:05a8:0000:0001:0000:0000:0000:13fc/127
Network:: 2001:05a8:0004:9fe0:0000:0000:0000:0000/60

in rc.local, I followed their instructions with those addresses:

# setup the 6in4 tunnel to the sonic transport addresses
ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::208.201.234.221
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:05a8:0000:0001:0000:0000:0000:13fd/127
route -A inet6 add ::/0 sit1

using the Network subnet, I created a subnet on eth0, turned on forwarding in the kernel, and started the radvd service and put it into rc.local as well:

# now setup v6 on eth0 for the first subnet
ifconfig eth0 inet6 add 2001:05a8:0004:9fe0::0
route -A inet6 add 2001:5a8:4:9fe0::/64 eth0
# turn on kernel forwarding
sysctl -w net.ipv6.conf.all.forwarding=1
# and the v6 router advertisement daemon
service radvd start

before you actually do this, you need to create the file /etc/radvd.conf:

interface eth0 {
AdvSendAdvert on;
MinRtrAdvInterval 5;
MaxRtrAdvInterval 15;
prefix 2001:05a8:0004:9fe0:0000:0000:0000:0000/64 {
AdvOnLink on;
AdvAutonomous on;
};
};

once all of this executes, your other machines should automatically autoconf their ipv6
addresses, and you should be able to ping6 phresheez.com (<-- my site :-)

you'll be able to see the ipv6 address on your other machines by using ifconfig (or the equivalent
on whatever os you're on) -- there should be a Scope:Global address on eth0.

hope this helps!

cheers, Mike
by dane » Fri Jul 13, 2012 12:29 pm
Cool, thanks for sharing!
Dane Jasper
Sonic
by dohring » Mon Jul 30, 2012 3:29 pm
Be sure to have iproute2 installed; and have ipv6 support compiled into the kernel.
If you don't have iproute2 run the following command:

Code: Select all

# emerge iproute2
Change the relevant lines in /etc/conf.d/net

Code: Select all

modules=( "iproute2" )
RC_NEED_sonic6="net.eth0"

config_eth0="x.x.x.x netmask 255.255.255.0 #the ipv4 address.
         2001:05a8::1/60" #use your prefix here.
routes_eth0="default via x.x.x.1" #replace x.x.x.1 with the gateway address.

iptunnel_sonic6="mode sit remote 208.201.234.221 local y.y.y.y ttl 255 dev eth0" #replace y.y.y.y with your external IPv4 address
config_sonic6="2001:05a8:0:1::0de2/127
               2001:05a8::1/60" #use your prefix here.

routes_sonic6="::/0 dev sonic6"
Add the init script:

Code: Select all

# ln -s /etc/init.d/net.lo /etc/init.d/net.sonic6
# rc-update add net.sonic6 default
And start the inteface:

Code: Select all

# /etc/init.d/net.sonic6 start
check to see if it is working...

Code: Select all

# ping6 www.google.com
Follow mtcccom's post on how to setup radvd.
Be sure to emerge it if you haven't already:

Code: Select all

# emerge radvd
3 posts Page 1 of 1

Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 33 guests