0

I'm trying to add IP range to eth0 interface on Ubuntu 16.04 server. Following this solution I've changed the configuration to this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
auto eth0

iface eth0 inet static
        address 118.69.119.107
        netmask 255.255.255.0
        network 118.69.119.0
        broadcast 118.69.119.255
        gateway 118.69.119.254
        up /sbin/ip address add 65.70.173.128/25 dev eth0
        down /sbin/ip address delete 65.70.173.128 dev eth0

And I've got only 65.70.173.128 IP available. Is this issue somehow related with netmask?

0

You need one up (& down) line per every IP. The /25 corresponds to the netmask 255.255.255.128; it's not specifying an IP address range.

3
  • Let me try right now. I thought there is more elegant way to do this. May 18 '17 at 17:07
  • Typically a single server interface won't need more than a couple of IP addresses. This was more usual before SNI when you needed one IP per every TLS certificate, and I've also seen it commonly in "IRC shell" servers, where large amounts of IPv6 addresses are used for creating "vanity hosts". May 18 '17 at 17:12
  • On RH it was possible to define range START/STOP IPs like this. May 18 '17 at 17:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.