Set up Ubuntu box as router with multiple intranet ports

There are a million guides on how to make a gateway with one downstream port, but I don’t want to connect an external switch when my box has six GbE ports already. Ubuntu Server 20.04. Any help appreciated.

What you’re looking for is to create a network bridge, I would probably recommend Open vSwitch over a regular Linux bridge but either way works. It really just comes down to testing and which method performs better and is more stable for you.

1 Like

Well that is because the guides are focusing on the routing. :slight_smile:

Once you have a router, making multiple DMZs ro LANs is pretty easy.
If you want to to behave like a switch it is trivial.

@2FA I intend to also use the box for a few other things, so I’d rather not use a dedicated router distro.

@BansheeHero I don’t doubt that it’s trivial if you can find instructions, but I can’t.

Open vSwitch is a software package, not a distro. You can run it on anything.

@2FA Oh, my bad. It does still seem to be overkill, but I’ll keep it in mind if I can’t find a way to do the job with just netplan.

Here is a guide I found after a very short google search https://www.techrepublic.com/article/how-to-create-a-bridge-network-on-linux-with-netplan/

That will create a Linux bridge. Add additional ports as needed to the interfaces line.

It depends on what you want and where you are at (in the process of making a router).
Tell us more about your current idea and we can pinpoint you further.

In general the guide for linux bridging is:

  1. Create a virtual network interfaces (br0 for bridge0)
  2. Set the properties (IP and others)
  3. Add interfaces to your bridge

For example:

So in your case you have 6 ports and you would want the following:

  1. WAN
  2. DMZ for your special devices
  3. LAN ports
  4. LAN ports
  5. LAN ports
  6. LAN ports

Well then you follow your favorite guide on setting up a router and later configure devices 3-6.

1 Like

But tehre are a lot of moving pieces so it is possible that your Router guide might want something extra. Hence why I would not recommend any guide on bridging without being confident that it will work with your setup.

OK, I think I found the missing piece. I just needed to move the config from the single downstream port to the bridge. Thanks!

1 Like

I’d love to see a level1linux writeup/video on open vSwitch tho, would you agree? :slight_smile: