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?

1 Answers1

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.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
  • Let me try right now. I thought there is more elegant way to do this. – user3599280 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". – Esa Jokinen May 18 '17 at 17:12
  • On RH it was possible to define range START/STOP IPs like [this](http://www.ducea.com/2006/07/15/linux-tips-how-to-quickly-bind-a-range-of-ips-on-redhat-based-systems/). – user3599280 May 18 '17 at 17:23