My Ubuntu Server has one physical interface eth0
. I want to assign 3 ip's (different subnets) to the server. I cannot use the default virtual interface creation tools like ifconfig
or ip addr add
(e.g. eth0:0
) because for each of those 3 ip's I need to specify a default gateway. So, whether it is possible to have a bridge to which I can attach eth0
( and multiple tap or tun interfaces with ips that I want), but each of the virtual devices can connect to subnets accessbile over eth0
.
EDIT1:
Imagine I want 5 ethernet interfaces to connect to 5 different networks. But I can't afford to have 5 interfaces. So I buy an unmanaged switch, and connect cat5 cables from all the 5 networks to that switch and one port of that switch in connected to eth0
of Ubuntu server. In order to deal with all 5 networks on Ubuntu server, I create 5 virtual interfaces that behave like physical interfaces (eth1, eth2, so on ..), that traverse through eth0
and end up at the switch. I don't mind if all those seperate networks traverse through one unmanaged switch. But I want my Ubuntu server to treat those networks as if they are attached to 5 physical interfaces.
/29
network. I want Ubuntu server to be a NAT router and a webserver. If I use a single public ip for NAT and webserver, then if any of my users on NAT network visit dodgy sites, then law enforcers just have to put my public ip in the browser to see my website. So, my plan is to use two public ips from/29
subnet, one for NAT and another for webserver. Presently I use this setup with multiple LAN cards, and it is working fine. My cards are 1 gbps but I have 5 mbps WAN connection, which is a sheer waste of resources.