Page 1 of 1

Drop a Pi router in *any* network. Best solution?

Posted: Sat Jun 04, 2016 5:30 pm
by epoch1970
I have a Pi configured as a gateway. It has its built-in br0 interface set to DHCP (eth0 being one of the members), and a br1 interface with a static IP, say 192.168.1.10/24, to serve a "private" network.
I have a bit of an issue with the case the Pi lands on a network configured the same way as the "private" network (e.g. eth0 gets a lease to 192.168.1.28/24)

Of course the "private" network I am using is not 192.168.1.0 but nonetheless a routing clash or an IP clash may happen.
I could prepare for the case the Pi is multi-homed on the same network but that would not solve the IP clash case.
I can't opportunistically change the IP of br1.
I can't think of a way an internal VLAN could help me there.
Looking around on the web I've found a guy who said he solved the issue with an LXC container, but this sounds a bit "brute force" to me.

How would you go about this?

Re: Drop a Pi router in *any* network. Best solution?

Posted: Sat Jun 04, 2016 7:16 pm
by stderr
epoch1970 wrote:How would you go about this?
I would go back in time and I would advocate for subnets that were to be used only as second, third or fourth from the "public" internet. This is what a "private" address space is but the levels of private are not defined. Failing that, I'd advocate for this change using some of the current private addresses.

Of course the above doesn't really help if you are just jumping randomly into a network of unknown distance from the supposed "public" internet. So, while I'm sure there are many solutions, what you might do is set up a nat that sat between your internal network and anything else you were connecting to. It would test to see what the open IP address subnet was so that it would not have a conflict. Then it would tell your internal network how to connect to the nat. There is no problem in computer science which cannot be solved by one more level of indirection!