BT Broadband with native IPv6
BT are now providing native IPv6 over their network, so I have updated my Linux router to extend this to my local network. My Debian router has two network interfaces: one connected to the switch on my local network and the other connected to BT’s VDSL modem. I don’t use a BT Home Hub.
This is how I have configured my network interfaces. I have renamed eth0 and eth1 to lan and wan respectively, to make it clearer which is for my internal network and which is for the internet.
# Interface to internal network: connected to switch auto lan iface lan inet static address 172.16.0.1 netmask 255.255.255.0 network 172.16.0.0 broadcast 172.16.0.255 # Interface to external network: connected to VDSL modem auto wan iface wan inet manual # Using 1508 byte baby jumbo frames (RFC 4638) over wan so that # I can still use full 1500 byte ethernet frames over bt despite # the 8 byte overhead for PPPoE. pre-up ip link set dev $IFACE mtu 1508 pre-up ip link set dev $IFACE up post-down ip link set dev $IFACE down # PPPoE link to BT Broadband auto bt iface bt inet ppp provider btbroadband
Making a connection
This is the PPPoE configuration I’m using for BT Infinity Fibre Broadband.
# Exclude password from the log; include detailed debugging information. hide-password debug # Use the pppoe kernel module (installed by default in Debian). plugin rp-pppoe.so wan # Name this connection as: bt ifname bt # Enable IPv6 # Need to also ensure: net.ipv6.conf.ppp0.accept_ra = 2 # to still get router advertisements when IPV6 forwarding = 1 +ipv6 # Do not require peer (i.e. ISP) to authenticate itself. noauth user firstname.lastname@example.org # IP address is allocated dynamically by my ISP. noipdefault # I use Google's DNS servers and so don't need to know my ISP's. #usepeerdns # Add a default route throught this connection. defaultroute replacedefaultroute # There is an 8 byte overhead for PPPoE; however, I am using baby jumbo # frames with an MTU of 1508 on eth0, which is the connection between # this router/firewall and my ISP's VDSL modem. This accounts for the # extra 8 byte PPPoE overhead and allows me to still use the full 1500 # byte MTU on this PPP connection. mtu 1500 mru 1500 # Try to reopen the connection if terminated. persist
The result of this was that I had a PPP connection to BT Broadband with an IPv4 address but only a link-local IPv6 address.
# ifconfig bt Link encap:Point-to-Point Protocol inet addr:220.127.116.11 P-t-P:172.16.19.19 Mask:255.255.255.255 inet6 addr: fe80::d4a4:b9a6:9c6a:d5ce/10 Scope:Link UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:36 errors:0 dropped:0 overruns:0 frame:0 TX packets:45 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:7674 (7.4 KiB) TX bytes:4208 (4.1 KiB)
Getting a gobal IPv6 address
Debian uses dhclient for IPv4 DHCP so I'd hoped I could just use this for IPv6 too; however, it doesn't work over PPP.
I tried running dhclient for IPv6:
$ dhclient -6 -P bt
I see this as part of the error message in the log:
Unsupported device type 512 for "bt"
I installed Dibbler next and while I was able to request and receive IPv6 prefixes, I couldn't work out how to actually apply these (and addresses) to my network interfaces. I think you have to make use of another program or script to do anything with the prefixes. The older version (0.8.2) in Squeeze doesn't provide very helpful variables for external scripts either. I removed it after hours of frustration.
Third time lucky with dhcpcd
My third attempt was with dhcpcd.
# apt-get install dhcpcd5
I then made a few changes to the default configuration.Update: this configuration is incorrect. Please see BT IPv6 September 2017 instead.
hostname duid option rapid_commit option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes option ntp_servers require dhcp_server_identifier nohook lookup-hostname # Globally disabling router solicitation as requesting prefix delegation noipv6rs # Ignore wan interface to modem: it doesn't need an IP address denyinterfaces wan # Only configure IPv6 on lan interface: internal IPv4 is static interface lan ipv6only # Configure IPv6 on bt and accept router solicitations interface bt ipv6only ipv6rs # Delegate prefixes to bt and lan interfaces ia_pd 1 bt/0 lan/1
I then removed dhclient so that dhcpcd will be used automatically instead.
# apt-get remove isc-dhcp-client isc-dhcp-common
Assigning IPv6 addresses
Now that I have global IPv6 prefixes delegated by BT, I’m using Dnsmasq to assign global IPv6 addresses to devices on my local network.
domain-needed bogus-priv # Use instead of /etc/resolv.conf. See also /etc/default/dnsmasq resolv-file=/etc/resolv.dnsmasq # Listen for DHCP and DNS requests only on the local network interface=lan # DHCP addressing on the local network dhcp-range=172.16.0.128,172.16.0.254,168h dhcp-range=::8000,::ffff,constructor:lan,ra-advrouter,168h # Do router advertisements for all subnets where we're doing DHCPv6. enable-ra # Suppress logging of routine operations quiet-dhcp quiet-dhcp6 quiet-ra # This is the only DHCP server on the network. dhcp-authoritative