|
From: | Erik Slagter |
Subject: | [lwip-devel] Netmask and GW when setting IPv6 static address? |
Date: | Tue, 2 Jul 2024 09:16:21 +0200 |
User-agent: | Mozilla Thunderbird |
Hi there,I am posting this here instead of on lwip-users, as it appears nobody's there.
I am using LWIP from the ESP-IDF (Espressif) but it doesn't seem to be an ESP-IDF thing, so I am asking here. They're using LWIP from git commit f79221431fa9042b3572d271d687de66da7560c4.
This is my situation. I have a client (running LWIP) configured with IPv6 enabled and also autoconfigure (SLAAC) enabled.
The client is connected over wifi to a switch acting as IPv6 router, connecting to other clients in other subnets and VRF's. The switch sends router advertisements with the proper prefix configured, with a netmask of /64 (which seems to be a requirement).
I have it working using SLAAC, no problem there. But I'd rather use a static address and so I did. I was looking for a way to set the netmask and the default gateway for this address but I found no way to do so, there is just the address and that's it.
So I guessed the netmask and the default gw are taken from the router advertisement packets. Ok, I get that, but I'd rather not have SLAAC at all, so I configured only a static address and disabled router advertisements from the switch. And indeed, no SLAAC address was created, fine.
Now what puzzles me, is that I can still reach this client running LWIP from a different subnet/vlan/broadcast domain. How can LWIP know what's the netmask (i.e. what's local/non-local) for a global address and how can LWIP know what address to use for the default gw, if no router advertisements are used?
I need to know this, because probably some assumptions are made about the network which may not be valid in my network.
Why can't I just configure a default gw and a netmask for a global static interface address? Or even better, use the "token" concept as found in the linux "ip" command, where a statically configured number is used for lower 64 bits of SLAAC instead of the mac address. Shouldn't be that hard to implement I think?
Thanks for your information! Erik.
[Prev in Thread] | Current Thread | [Next in Thread] |