Hi Mick,

thank you for your response!

On 2017-04-18 16:41, Mick wrote:
I had to read this message twice and I am not yet sure I understand correctly what it is you are trying to achieve.

Do you want whichever NIC of your PC connects first to a specific SSID to always obtain IP 192.168.0.10/24 and any NIC which connects second to use DHCP?

Not necessarily the first NIC, but the NIC with a specific MAC address, say 001122334455.

But now that you mention it, as long as one NIC gets the static IP (but only for the specified SSID) and all the others will be handled by DHCP, I don't care which one of the NICs is statically addressed.

Sorry for not being able to describe it well.

What I am trying to achieve: I have a Raspberry Pi as a server, without monitor, without keyboard. Just a Raspi and a Wifi stick. I want the Raspi to use DHCP when I take it with me and power it on at my workplace. Thanks to Avahi I don't need to know the IP address it gets at my workplace.

When I am at home, there are reasons why I can't rely on Avahi (Android Phones for example that do not have the possibility to resolve raspi.local). So I want it to have a static IP at home. Now, if for whatever reason I lose the connection to Raspi -- for example once my router at home freaked out and wouldn't let Raspi connect with a static IP -- I want to have the possibility to plug another Wifi stick into Raspi which then gets connected via DHCP, so I can at least connect to it.

As I see it, I can't use config_001122334455, because I would not be able to connect at my workplace anymore (different network properties). I now use config_MySSID to get a static address at home, but what about a second Wifi stick being connected? It would use the same config and end up getting the same IP address that didn't work with the first stick.

In general, it would be intersting to logically combine the configuration via SSID with the configuration via MAC. I can also think of a scenario where I have two wifi networks and two wifi sticks, each one getting a static IP on their connected network. But if I take the Raspi into another network, I would want NIC_1 to be DHCPed and NIC_2 to be nulled.

I hope I could help you to better understand what I am trying to achieve and what my current problem is. If possible I want to solve it via pure netifrc, but I would also be happy if someone said that it isn't possible at all via netifrc, so I can stop researching in this direction and think of something different.

--
Kind regards

Flo

Reply via email to