0

I have a group of computers that I wish to connect to two LANs, which I want to otherwise keep separate. Each computer only has one ethernet port; currently I am connecting to LAN1 via wifi with DHCP and to LAN2 via ethernet with static IPs, but I want to improve the stability of the connection to LAN1 (current setup is pictured below). LAN2 is a bit particular in that there is curiously no gateway configured, so I'm guessing it is something like a statically addressed link-local network (LAN2 is a shared media server so I don't want any unnecessary traffic flowing through it).

current setup

I'm wondering if I can set up a linux router, ostensibly with three separate interfaces, and slap together some iptable rules to connect my computers to both LANs so I can use a single ethernet port on each computer instead of having to set up two interfaces on every single client.

If possible I'd like to continue assigning dynamic IP addresses to the computers from LAN1 but configure the router to translate the computer address to static IPs for LAN2, though I wouldn't necessarily mind a different configuration as long as there's still a way to access them all transparently from both LANs.

I've drawn up a diagram that I believe illustrates what I want:

proposed setup

I think I'm looking at some sort of hybrid bridge/NATted monster, but is it even possible/advisable to do this?

  • Is the router not using wireless anymore? Are all eth0 eth1 eth2 real ethernet interfaces (it does make a difference for bridging)? – A.B Jun 7 '18 at 19:16
  • eth0,eth1 and eth2 would be physical interfaces. The router wouldn't be broadcasting an SSID, it would be all wired. – erp Jun 12 '18 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.