Scripts for native V6 gateways.
BSD-3-CLAUSE License
These are scripts to helpe people setup a v6 gateway on ISPs who hand out a v6 block. They have only been tested with Comcast. See https://www.phildev.net/phil/blog/?p=308 for all the gory details.
net.ipv6.conf.$YOUR_EXTERNAL_INTERFACE.accept_ra=2
net.ipv6.conf.$YOUR_EXTERNAL_INTERFACE.forwarding=0
Replacing $YOUR_EXTERNAL_INTERFACE
with your external interface.
These scripts can now support dnsmasq
or radvd
For radvd:
/etc/radvd.conf.tmpl
(which these scripst will use to create radvd.conf) that looks like this:interface __IFACE__
{
AdvSendAdvert on;
RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {};
prefix __PREFIX__
{
AdvOnLink on;
AdvAutonomous on;
};
};
The scripts will update __PREFIX__
and __IFACE__
for you.
For dnsmasq:
/etc/dnsmasq.conf.tmpl
(sample is included in the template - You need to set some params yourself)
__INTERFACES__
and __PREFIXES__
for you.Script Locations:
dhclient-ipv6
into /etc/dhcp/dhclient-exit-hooks.d/
99-ipv6
into /etc/network/if-up.d/
(or your distribution's equivalent)ipv6_prefix_dhclient.conf
in /etc
and update it to accurately represent your setup.We now support multiple prefixes. We assume you want one /64 per interface. If you add additional interfaces to the OTHER_IFACES
variable in ipv6_prefix_dhclient.conf
then additional prefixes will be requested, and one will be put on each interface. Radvd's configuration will be updated accordingly.
There are a few things to note about multiple prefix support:
dhclient-ipv6
will keep a mapping of interface we associate-to-IAID so we can always put the right prefix on the right interface. This mapping is kept in /var/lib/dhcp/dhclient-ipv6-mapping
. I highly recommend not messing with the files in there.nf_conntrack_dhcpv6
module available and use conntrack.