Back in 2014, I wrote about DHCPv6 on Teksavvy. Recently we moved to Ebox, which resells the gigabit FTTH service from its now-parent company, Bell. They do provide a router (Nokia Beacon 6), but IPv6 support is very limited. And I prefer OpenWRT.

PPPoE setup

You can use the Nokia Wifi mobile app or the router’s web interface to login and find your Ebox PPPoE login/password. Note that in the settings, it should also display, under “advanced settings”, the VLAN ID, which should be 40 (different VLAN IDs are used for the phone and TV service).

In OpenWRT, you can use the web interface (LUCI), but the switch settings are a bit confusing, for tagging the ports. I had never used VLAN tagging in OpenWRT before, so I was really confused. Random advice on the Internet was not very clear.

Here is what worked for me:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[...]
config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.42.1'
	option netmask '255.255.255.0'
	option ip6assign '64'

config interface 'wan'
	option ipv6 'auto'
	option proto 'pppoe'
	option username 'aa1234@pppoe.ebox.net'
	option password 'abcdefghij'
	option device 'eth1.40'
	option reqprefix '56'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 0'

config switch_vlan
	option device 'switch0'
	option vlan '40'
	option ports '5t 0t'

So the less obvious bits, for me, was that the wan device is eth1.40, where 40 is the VLAN ID, but also, in the switch settings at the bottom, we have to specify which ports are tagged by appending t. The switch settings will depend on your router. I left the default config from my router, and just added ’t’. I had to safe-boot/reset my router more than a few times, from incorrect trial and error.

In the above setup, eth0 is my LAN port, and eth1 is my WAN port. Again, I basically kept the default OpenWRT configuration.

About the network.wan.ipv6 setting, the documentation says:

  • 0: disable IPv6 on the interface
  • 1: enable IPCP6 negotiation on the interface, but nothing else. If successful, the parent interface will be assigned a link-local address (prefix fe80::/10). The interface must then be configured manually, as described below.
  • auto (default): enable IPv6 on the interface. Spawn a virtual interface wan_6 (note the underscore) and start DHCPv6 client odhcp6c to manage prefix assignment. Ensure the lan interface has option ip6assign 64 (or a larger prefix size) set to redistribute the received prefix downstream.

This wasn’t really clear to me at first. So if using ipv6 = 1, then you also need to declare a wan6 interface config manually. If using ipv6 = auto, then a wan_6 interface config will be created automatically. Since I don’t need special IPv6 configurations, the default works fine, my configuration above uses auto and no need for an explicit wan6 configuration. If ipv6 = auto is used, and a wan6 interface is created manually, it’s not a big deal, but the odhcp6c daemon will run twice (because we end up with two ipv6 interfaces: wan6 and wan_6).

I’m still trying to understand how to assign the entire /56. Currently this assigns a random subnet to br-lan, which is really annoying because I have other subnets at home with VMs and servers (with Teksavvy, ip6assign 56 worked, but it does not seem to work with Ebox).

Debugging DHCPv6

When things don’t work it’s really difficult to get clear logs. OpenWRT has the logread -f command, which can be useful to run in another terminal, to have live error logs, but the odhcp6c command is not particularly verbose.

1
2
odhcp6c -s /lib/netifd/dhcpv6.script -Nforce -P64 -t120 pppoe-wan
odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 pppoe-wan

So there were two odhcp6c daemons running because I had declared a wan6 interface initially, but it’s not necessary because of ipv6 = auto.

Running it manually with verbose/errors:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# odhcp6c -v -e -s /lib/netifd/dhcpv6.script -t120 pppoe-wan
odhcp6c[21016]: (re)starting transaction on pppoe-wan
Sat Jan  7 18:01:49 2023 daemon.notice odhcp6c[21016]: (re)starting transaction on pppoe-wan
Command failed: Not found
odhcp6c[21016]: Starting SOLICIT transaction (timeout 4294967295s, max rc 0)
Sat Jan  7 18:01:50 2023 daemon.notice odhcp6c[21016]: Starting SOLICIT transaction (timeout 4294967295s, max rc 0)
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Sat Jan  7 18:01:50 2023 daemon.warn dnsmasq[1]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available
Command failed: Not found

Gigabit

(todo)