setting up an ipv6 router

ipv6 | ipv6-router | nat4466 | nat4400

install

debian binary package

apt install radvd

and eventually (when enabling DUID persistent ip6)

apt install isc-dhcp-server

from source

build and install the latest RA daemon

wget http://www.litech.org/radvd/dist/radvd-2.19.tar.gz
tar xzf radvd-2.19.tar.gz
cd radvd-2.19/
./configure
make
make install

setup

enable forwarding on ALL INTERFACES

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

and check

ls -lF /proc/sys/net/ipv6/conf/*/forwarding
cat /proc/sys/net/ipv6/conf/*/forwarding

slaac

setup the daemon to spit regularly on the internal network

vi /etc/radvd.conf

interface br0
{
    AdvSendAdvert on;
    # AdvLinkMTU 1280;
    MaxRtrAdvInterval 300;
    prefix 2001:bc8:204a:101::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
    };
};

no slaac, just advertise gateway

no need for slaac when hosts use dhcp6

        AdvAutonomous off; # no slaac

ready to go

enable at startup

debian

# enabled already
systemctl status radvd

slackware

ops

status

ls -lF /proc/sys/net/ipv6/conf/*/forwarding
cat /proc/sys/net/ipv6/conf/*/forwarding
ifconfig
ps auxww | grep dhclient
ps auxfww | grep radvd

stop

ip addr del x::x/64 dev br0
dhclient -x -pf /var/run/dhclient6.pid
pkill dhclient

additional notes

combined example with host and router setup altogether

vi /etc/rc.d/rc.inet1

#
# host & bridge
#

echo slaac and obtain ip6 gateway
echo 2 > /proc/sys/net/ipv6/conf/xenbr0/accept_ra

echo -n obtain persistant ip with dhcp6 duid ...
dhclient -cf /etc/dhclient6.conf -6 -P xenbr0 -v && echo done || echo FAIL

echo define internal bridge ip6 address
ifconfig br0 inet6 add x::1/64 up

#
# router
#

echo enable ip6 routing
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

echo -n start ra daemon ...
radvd && echo done || echo FAIL

resources

Linux IPv6 Router Advertisement Daemon (radvd) http://www.litech.org/radvd/

IPv6 router guide https://wiki.gentoo.org/wiki/IPv6_router_guide

IPv6PrefixDelegation https://wiki.debian.org/IPv6PrefixDelegation

Linux box as an IPv6 router with SLAAC and DHCPv6-PD https://taczanowski.net/linux-box-as-an-ipv6-router-with-slaac-and-dhcpv6-pd/

Building an IPv6 router with GNU/Linux https://www.tomicki.net/ipv6.router.php

HOME | GUIDES | PLAYBOOKS | LECTURES | LAB | CONTACT | HTML | CSS
Licensed as MIT