Gentoo configuration

From SixXS Wiki
Jump to: navigation, search

SixXS configuration for Gentoo

There is a detailed description on the IPv6 topic on the Gentoo IPv6 documentation page. This article is just a glimpse of that and only covers the basic tunnel setup.

Create tunnel

This was tested with a fixed IP address. So it's possible that the steps are not working in all cases.

Manual setup

On the gateway system we can create the ipv6 tunnel with the following commands:

First we have to setup a Simple Internet Transition (SIT) tunnel to the used Sixxs gateway. The Maximum Transmission Unit (MTU) must be set to 1280 and the Time To Live to 64.

ip tunnel add sixxs mode sit local <local ip address> remote <sixxs remote ip address>
ip link set sixxs up
ip link set mtu 1280 dev sixxs
ip tunnel change sixxs ttl 64

After this is finished we can bring up our IPv6 tunnel end by using the assigned addresses. With that we can use a default route for IPv6 addresses through the tunnel.

ip -6 addr add <your ipv6 address>/64 dev sixxs
ip -6 ro add default via <the sixxs ipv6 address> dev sixxs

A simple ping6 should already work now.


Automatic setup

The easiest way to create a tunnel with Gentoo is over the network configuration. All steps mentioned in the manual setup section are done automatically over the Gentoo start scripts.

The configuration is listed inside the file /etc/conf.d/net.

iptunnel_sixxs="mode sit remote <sixxs remote ip address> local <local ip address> ttl 64"
config_sixxs="<your ipv6 address>/64"
routes_sixxs="default via <the sixxs ipv6 address>"

The configuration of the sixxs tunnel is only used with a network start script in /etc/init.d/. We have to create a symbolic link for this.

$> cd /etc/init.d
$> ln -s net.lo net.sixxs

To execute the start script we can simply use the following command.

$> /etc/init.d/net.sixxs start

To add the IPv6 tunnel permanently to your system start, you need to add it to the default runlevel.

$> rc-update add net.sixxs default

After a reboot the net.sixxs start script will be executed automatically.

Use a subnet

A subnet that is routed by Sixxs through the tunnel can directly be used on the local network. If you just want to test the subnet than just assign the IPv6 addresses manually. Otherwise use radvd to distribute the subnet to your network.

You do not have to segment your subnet for a test.

$> ip addr add <your IPv6 subnet address::1/48> dev eth0

If you are testing this not on the gateway system you need to add the default gateway as well.

$> ip -6 ro add default via <ipv6 address of your gateway> dev eth0