Gentoo Archives: gentoo-user

From: "Florian Gamböck" <ml@×××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] netifrc, configure by SSID and MAC simultaneously?
Date: Tue, 18 Apr 2017 18:42:05
Message-Id: 20170418184154.GA30876@furore
In Reply to: Re: [gentoo-user] netifrc, configure by SSID and MAC simultaneously? by Mick
1 Hi Mick,
2
3 thank you for your response!
4
5 On 2017-04-18 16:41, Mick wrote:
6 > I had to read this message twice and I am not yet sure I understand
7 > correctly what it is you are trying to achieve.
8 >
9 > Do you want whichever NIC of your PC connects first to a specific SSID
10 > to always obtain IP 192.168.0.10/24 and any NIC which connects second
11 > to use DHCP?
12
13 Not necessarily the first NIC, but the NIC with a specific MAC address,
14 say 001122334455.
15
16 But now that you mention it, as long as one NIC gets the static IP (but
17 only for the specified SSID) and all the others will be handled by DHCP,
18 I don't care which one of the NICs is statically addressed.
19
20 Sorry for not being able to describe it well.
21
22 What I am trying to achieve: I have a Raspberry Pi as a server, without
23 monitor, without keyboard. Just a Raspi and a Wifi stick. I want the
24 Raspi to use DHCP when I take it with me and power it on at my
25 workplace. Thanks to Avahi I don't need to know the IP address it gets
26 at my workplace.
27
28 When I am at home, there are reasons why I can't rely on Avahi (Android
29 Phones for example that do not have the possibility to resolve
30 raspi.local). So I want it to have a static IP at home. Now, if for
31 whatever reason I lose the connection to Raspi -- for example once my
32 router at home freaked out and wouldn't let Raspi connect with a static
33 IP -- I want to have the possibility to plug another Wifi stick into
34 Raspi which then gets connected via DHCP, so I can at least connect to
35 it.
36
37 As I see it, I can't use config_001122334455, because I would not be
38 able to connect at my workplace anymore (different network properties).
39 I now use config_MySSID to get a static address at home, but what about
40 a second Wifi stick being connected? It would use the same config and
41 end up getting the same IP address that didn't work with the first
42 stick.
43
44 In general, it would be intersting to logically combine the
45 configuration via SSID with the configuration via MAC. I can also think
46 of a scenario where I have two wifi networks and two wifi sticks, each
47 one getting a static IP on their connected network. But if I take the
48 Raspi into another network, I would want NIC_1 to be DHCPed and NIC_2 to
49 be nulled.
50
51 I hope I could help you to better understand what I am trying to achieve
52 and what my current problem is. If possible I want to solve it via pure
53 netifrc, but I would also be happy if someone said that it isn't
54 possible at all via netifrc, so I can stop researching in this direction
55 and think of something different.
56
57 --
58 Kind regards
59
60 Flo

Replies

Subject Author
Re: [gentoo-user] netifrc, configure by SSID and MAC simultaneously? Mick <michaelkintzios@×××××.com>