TO as lan dhcp client with ipv4 & ipv6?

howto

#1

Trying to configure the TO as lan dhcp client to an upstream router (another TO) but fail to comprehend how to have both, ipv4 and ipv6, on the lan client.

Starting there is no iface option to have dhcp ipv4 and ipv6 on the same lan iface. The protocol that can be chosen is either DHCP client, which covers ipv4 only, or DHCPv6 client which then only covers ipv6.

Is there something I am missing that would enable dhcp ivp4 and ipv6 on the same lan face as opposed to the cumbersome 2 iface way?

If not then there would be indeed 2 lan ifaces, one for each protocol type. Say ipv4 would enslave eth0 and eth2 in a bridge what is left for ipv6 to connect with?

Surely it cannot be rocket science for a simple TO as lan client setup?


Assigning both IPv4 and IPv6 via DHCP client
#2

While I can not help you with your main request, please keep in mind that for the secondary TO to be able to hand out IPv6 addresses to connected clients, you will need either delegate prefixes from the primary TO.
https://openwrt.org/docs/guide-user/network/ipv6/start should be a decent starting point, if PD does not work you might need to use dhcp6/ra/ndp relaying see the section titled " Router Advertisement & DHCPv6" in the linked page.


#3

That is no issue in general. And for this use case not applicable.

DHCP can be worked around with static ip but that requires setting the respective gateways manually and the the upstream dns server address

But working around (static does not require 2 ifaces) was not the point of this thread nor delegation but rather how to get ipv4/ipv6 dhcp on the lan client.


#4

So you fail to automatically get an IPv6 address on the secondary TO?
Why are you using br-lan as the interface to uplink to the primary TO?

I believe that OpenWrt uses wan and wan6 automatically by default, so it seems the dual interface method is the “official” way.

But I guess, I really do not undersatand your exact problem and lack the knowledge to actually help you even if I undestood the issue, so I apologize for wasting electrons…


#5

exchange is always good.


wan is likely a bit different than lan since the ISP commonly do not provide both ipv4 and ipv6 via DHCP but rather deploy some mechanism of packet encapsulation (ipv4 in ipv6 or vv) or stateless transition/mapping.
I do not see that the upstream TO can provide such mechanism to the downstream TO.


That might be an oddity particular to their netifd network manager. Haven’t looked into their recent developments and probably will see when TOS4.x based on then the next upstream branch (19.x) gets released and whether it might change then.

In common Linux distros it does not require 2 ifaces to facilitate ipv4/ipv6 connectivity simultaneously. And the curious thing is that static ip is happy just with a single iface.


#6

Yeah, so I would use the secondary TO’s wan port to connect to one of the primary TO’s LAN ports, that way things should work out of the box in so far that the secondary TO should get both an IPv4 and an IPv6 address (at least that works with openwrt since a few years, nit sure though whether current turris os shows the same behavior). Well some years earlier I needed to proxy NDP IIRC to get IPv6 working on clients connected to a secondary router (but the primary was a rather in-configurable speedport-branded router from my ISP, not something as open as you are aiming at here).

I believe “design choice” is a better description :wink:

I guess this is not so much that OpenWrt can not deal with multiple IP addresses on a single interface but more of a logical way to reduce complexity of configuration or so. Or just a way to keep us users on our toes :wink:


#7

Having to configure 2 ifaces instead of one adds complexity from my perspective.

Anyway it does not matter after having just now discovered

Firewall3 currently does not supportconfig redirectfor IPv6.


#8

It does not look like it does judging by


#9

Hi,

My Omnia is DHCP client both for IPv4 and IPv6 (Orange France ISP)
I have two interfaces ‘wan’ and ‘wan6’ on physical ‘eth1.832’ i.e. WAN connector on VLAN 832

config interface 'wan'
    option ifname 'eth1.832'
    option proto 'dhcp'
    ...

config interface 'wan6'
    option ifname 'eth1.832'
    option proto 'dhcpv6'
    ...

Assigning both IPv4 and IPv6 via DHCP client
#11

So I tried:

the Omnia is connected as a secondary router to a relative recent OpenWrt aster build. In the Foris GUI under wan I set “IPv4 protocol” to DHCP and “IPv6 protocol” to DHCPv6, and the Omnia passes all tests:

Test type Status
IPv4 connectivity OK
IPv4 gateway connectivity OK
IPv6 connectivity OK
IPv6 gateway connectivity OK

On a client connected to the Omnia via WLAN I also get both working IPv4 and IPv6. What I have not tested is whether using the omnia as primary and the OpenWrt as secondary router…

So I am beginning to thin that the problem might not be the secondary Omnia being


#12

Connecting the TO via WAN port to upstream or LAN?


#13

I connect the Omnia’s WAN port to one of the wndr3700v2’s LAN ports. I did not disable the Omnia’s firewall, but the IPv6 addresses where from a /62 delegaton out of the /56 my ISP gave to my primary router. So in the limited testing the omnia was masquerading IPv4. Maybe not exactly the situation you want tested.


#14

I do not want to bother your time. If you may however connect to one of the Omnia LAN ports instead and see whether it gets both ipv4 and ipv6?


#15

Instead of WLAN I connected my laptop to one of the LAN ports of the omnia and still get both IPv4 and IPv6 addresses and connectivity.

Connecting the Omnia via one of its LAN ports to the wndr does not see like a good idea in my setup (unless I make sure that the omnia’s dhcp server is either completely disabled of does avoid the one switch port used for the uplink).