1

I have managed to configure two IPs from different subnets on the same card. I changed /etc/network/interfaces to have:

auto eth0
iface eth0 inet static
    address 172.16.4.254
    netmask 255.255.255.0
    network 172.16.4.0
    broadcast 172.16.4.255
    gateway 172.16.4.1
    dns-nameservers 172.16.4.1

iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0

The problem is that the connections over the first IP started being laggy (the response time increased greatly). For instance it takes a lot of time to start loading a webpage, but it does eventually succeed. I need a console/configuration solution. No gui.

goozez
  • 123
  • 1
  • 1
  • 6

1 Answers1

1

You can not configure eth on that way. Create aliases

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
gateway 192.168.1.1

auto eth0:1
iface eth0:1 inet static
address 192.168.10.11
netmask 255.255.255.0
broadcast 192.168.10.255
2707974
  • 10,553
  • 6
  • 33
  • 45
  • Creating aliases is considered legacy ... the OP way is correct: https://askubuntu.com/questions/547289/how-can-i-from-cli-assign-multiple-ip-addresses-to-one-interface but some network cards struggle with it. – Emanuele Feb 03 '18 at 06:44
  • Is this for physical adapters or virtual adapter IP's ? How should be configured the file in both cases ? –  Jan 20 '22 at 16:26