How to receive GUA from DHCPv6 with LAN interface instead of WAN

Good Evening.
Normally when using a DHCPv6 client the intent is to connect to a DHCPv6 server through the WAN interface, acquire a prefix and then use a DHCPv6 server in the LAN interface to distribute that prefix to clients. Well, in my case I already have a DHCPv6 server in another device on my LAN (the gateway) and just wanted to acquire one of the IPs from it through DHCPv6 or SLAAC on my LAN interface, with nothing connected on my WAN.

An attempt at a diagram of my network topology is attached.

I have an IPoE Modem/Router/AP combo from my ISP where I receive dynamic IPv4 and a (native) IPv6 /56. The modem does not allow for bridge mode.

The OpenWRT router is connected to the modem LAN<-->LAN, and is able to acquire its Local IPv4 through DHCP. Moreover, hosts connected to the LAN interface of the OpenWRT router are able to acquire IPv6 GUA addresses and /64 prefixes normally, so the DHCPv6 server in the Modem seems to be working properly.

I've tried creating a "lan6" interface, which is an alias of the "lan" interface and uses the "dhcpv6" as proto, but no IPv6 is ever acquired.

Additional Information:
Model: TP-Link Archer C6 v3
Firmware: OpenWrt 23.05.0 r23497-6637af95aa / LuCI openwrt-23.05 branch git-23.306.39416-c86c256
Firmware Version: 5.15.134

cat /etc/config/network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd00:cafe::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'
	option broadcast '1'
	option ipv6 '1'
	option ip6assign '64'

config interface 'wg1'
	option proto 'wireguard'
	option private_key '[REDACTED]'
	option listen_port '51820'
	option delegate '0'
	list addresses '10.170.16.1/24'

--// OMITTED WIREGUARD PEERS //--

config interface 'lan6'
	option proto 'dhcpv6'
	option device '@lan'
	option reqaddress 'try'
	option reqprefix 'auto'

thank you for any help, and also thanks for contributing to this amazing project.

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'

config interface 'lan6'
	option device 'br-lan'
	option proto 'dhcpv6'

should work.

@slh No DHCP. No IPv4. The user wants to have IPv6 only on the interface.

@Kenajcrap if you don't want IPv4, don't configure it.

Iirc you can use proto none.

Sorry, maybe you misunderstood me. I want IPv4 and IPv6. But I don't the openwrt router to acquire a GUA IPv6 through an upstream WAN device like it's usually done, but instead through the main router/gateway connected via LAN.

Other devices like Host 1, Host 2 and Host 3 are able to acquire GUA IPv6 from the main router/gateway combo normally, but not this openwrt router

Thank you for the help! But this doesn't work. Please note my answer to @_bernd to make sure you understood how what I intend to do.

# in /etc/config/network

config interface 'lan_b'
	option device 'br-lan'
	option proto 'dhcpv6'

#........

config interface 'lan'                         
       #........
        list ip6class 'lan_b'

Make the upstream a different interface.

thank you for the help! However, I applied the changes and rebooted the device and there is still no IPv6. To be clear, it would've been fine to have the IPv4 and IPv6 on the LAN interface too, no need to have an alias interface if it's not required. I created 'lan6' in an attempt to make it work.

Here is ifstatus from lan:

{
	"up": true,
	"pending": false,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"uptime": 362,
	"l3_device": "br-lan",
	"proto": "dhcp",
	"device": "br-lan",
	"updated": [
		"addresses",
		"routes",
		"data"
	],
	"metric": 0,
	"dns_metric": 0,
	"delegation": false,
	"ipv4-address": [
		{
			"address": "10.170.15.2",
			"mask": 24
		}
	],
	"ipv6-address": [
		
	],
	"ipv6-prefix": [
		
	],
	"ipv6-prefix-assignment": [
		
	],
	"route": [
		{
			"target": "0.0.0.0",
			"mask": 0,
			"nexthop": "10.170.15.1",
			"source": "10.170.15.2/32"
		}
	],
	"dns-server": [
		"10.170.15.1"
	],
	"dns-search": [
		
	],
	"neighbors": [
		
	],
	"inactive": {
		"ipv4-address": [
			
		],
		"ipv6-address": [
			
		],
		"route": [
			
		],
		"dns-server": [
			
		],
		"dns-search": [
			
		],
		"neighbors": [
			
		]
	},
	"data": {
		"dhcpserver": "10.170.15.1",
		"leasetime": 3600
	}
}

and ifstatus from lan6:

{
	"up": false,
	"pending": true,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"proto": "dhcpv6",
	"device": "br-lan",
	"data": {
		
	}
}

EDIT: I've also tried naming the lan6 interface as lan_b just like in your example, in case that was some kind of special interface name, but the results are the same.

Turns out the DHCPV6 server in the network (ISP Modem in the diagram) is not used to send IPv6 addresses, and relies solely on RA for that. Therefore my issue now consists of enabling RA-only on LAN for the OpenWRT router.

To be clear: What I'm after is for the OpenWRT router, which is currently only serving as an additional AP and switch, to receive an address of its own from the modem, just like the downstream hosts do.

This thread suggests that the solution is to set sysctl net.ipv6.conf.br-lan.accept_ra=2, although it is deprecated and goes against OpenWRTs concious decision to handle RAs completely in userspace.

Is this still my best option if I want my router to auto-configure a GUA based on my modem's RA on LAN?

config interface 'lan6'
        option proto 'dhcpv6'
        option device '@lan'
        option reqaddress 'try'
        option reqprefix '64'

should be sufficient. That's what I use on OpenWRT 'dumb' APs and they configure GUA ipv6 addresses just fine (based on RAs).

Worth checking that the lan6 interface been added to the Lan firewall zone.

1 Like

Setting proto dhcpv6 with no options will attempt to obtain an IP both through RA and DHCPv6. If both types of servers are on the network. the interface will be configured with two IPs.

A bridged ("dumb") AP does not require a v6 prefix. It should get an IP within a /64 network from the upstream network.