Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Two wifi client interfaces and routing
Date: Thu, 31 Mar 2022 16:16:56
Message-Id: f8d821e8-d845-f40e-06eb-da0b8df5f38d@spamtrap.tnetconsulting.net
In Reply to: [gentoo-user] Two wifi client interfaces and routing by William Kenworthy
1 On 3/31/22 7:21 AM, William Kenworthy wrote:
2 > Hi,
3
4 Hi,
5
6 > I am trying to use a raspberry pi ... to create a routed link
7 > between two access points ... so I can access the monitoring port ...
8 > from homeassistant.
9
10 I'm distilling this down to a Gentoo system participating in two two
11 LANs, both of which are connected as DHCP clients. -- Correct me if
12 I've distilled too much. -- And you want other systems on either LAN
13 to use this system as a communications path to systems on the opposing LAN.
14
15 > Both AP's connect ok from the rpi but the routing is wrong - I can
16 > ping in both directions from the rpi, but only sometimes from devices
17 > further hops away - can openrc even do this?
18
19 This seems like a classic routing issue. To me, it's not even an OpenRC
20 issue in any way other than how to add static routes /after/ the network
21 is brought up via DHCP.
22
23 > My experimenting so far is hit and miss. Trying to static route
24 > or override the default routes doesn't survive a network glitch,
25 > and half the time doesn't seem to "take" at all.
26
27 Ya. At a higher level, this can be non-obvious how to do this as it's
28 niche routing configuration.
29
30 > A working example I could adapt would be great!
31
32 I don't have an example off hand. -- Seeing as I use static IPs on
33 almost all of my machines, I don't even know if OpenRC supports adding a
34 static route /after/ bringing an interface up with DHCP.
35
36 I do know that the DHCP protocol supports adding additional options /
37 definitions / parameters (?term?) to specify -- what I've been
38 describing as -- static routes. That way DHCP clients will learn about
39 these additional routes and install them in their local routing table.
40 Though I don't know if you will have the necessary control over /both/
41 DHCP servers that's needed to do this.
42
43 Presuming that you don't have control over /both/ DHCP servers (as
44 control over /both/ will be needed), I'm going to fall back and suggest
45 what I call the "Customer Interface Router".
46
47 Specifically, set up port forwarding on the Pi such that when clients on
48 LAN1 connect to $PORT on the Pi, the traffic is DNATed to the
49 HomeAssistant on LAN2 /and/ the traffic is SNATed to the LAN2 interface
50 on the Pi. Thus every system on each LAN thinks that it's talking to a
51 directly attached system in the same LAN. There is no need for routing
52 in this case.
53
54 I typically only use the C.I.R. when there are reasons that more proper
55 routing can't be configured. The C.I.R. is an abstraction layer that
56 allows either side to operate almost completely independently of each
57 other, save for IP conflicts between each directly attached LAN.
58
59
60
61 --
62 Grant. . . .
63 unix || die

Replies

Subject Author
Re: [gentoo-user] Two wifi client interfaces and routing Grant Taylor <gtaylor@×××××××××××××××××××××.net>
Re: [gentoo-user] Two wifi client interfaces and routing William Kenworthy <billk@×××××××××.au>