where to add additional ipv4 addresses?

3 posts / 0 new
Last post
#1 Sun, 11/12/2017 - 23:53
Joncas

where to add additional ipv4 addresses?

Since several years I have a system running Webmin GPL 1.860 / Virtualmin 6.01-3 / Ubuntu 14.04.1 with a total of four IPv4 addresses on one physical ethernet card.

When I first set it up, all four were defined in /etc/network/interfaces.

The first one was declared as :

iface eth0 inet static
address XX.XX.XX.209

The additional 3 were activated by adding these lines:

  up ip addr add XX.XX.XX.216/32 dev eth0
  down ip addr del XX.XX.XX.216/32 dev eth0
  up ip addr add XX.XX.XX.218/32 dev eth0
  down ip addr del XX.XX.XX.218/32 dev eth0
  up ip addr add XX.XX.XX.219/32 dev eth0
  down ip addr del XX.XX.XX.219/32 dev eth0

But somewhere in the courseof the updates of Virtualmin or Webmin this must have changed, because if I look at that file now, it has only the first IP. The system is still running and all four IPs are still functioning, but is hasn't been rebooted in nearly two years, and since I can't find where the additional IPs get activated, I'm a bit worried that after a reboot they would no longer work.

If I open the Virtualmin network configuration and look at "Network interfaces", it shows only the first IP as ETH0, with zero virtual interfaces. So were are the other three added in?

Many thanks for your help!

Mon, 11/13/2017 - 13:30
scotwnw

Other IPs can be added as virtual devices. Like eth0:1, eth0:2.

Can be done in webmin.

Open webmin, network interfaces, open current interface, down at bottom should see 'add a virtual interface'. Thats where you would add additional IPs to be attached to main eth0 device.

Can also be done in /etc/network/interfaces. Each new IP would be referred to by their virtual device names, like eth0:1, eth0:2 as separate devices.

Mon, 11/13/2017 - 22:33
Joncas

The server is hosted at hetzner.de and their instructions are to use the "up ip addr add xxx" instead of eth0:n and my question also is why Webmin "swallowed" my "up ip addr add xxx" lines from /etc/network/interfaces and finally, how come the additional IPs are still functioning even though they seem not to be activated in any of the config files ?

Topic locked