0

I have a dedicated server and I ordered a /29 subnet for this server which contains 6 IPs.

I can add those IP addresses one by one to the server (/etc/network/interfaces) like this and I become able to connect to the server from them;

iface eth0 inet static
  address 192.168.1.1
iface eth0 inet static
  address 192.168.1.2
...
iface eth0 inet static
  address 192.168.1.6

So I basically need to add each IP like this but I wonder if there's a way to attach those IP addresses to my server without having to add each IP to the /etc/network/interfaces file?

I tried this but it didn't work;

iface eth0 inet static
  192.168.1.1/29

This only allowed me to connect through 192.168.1.1 and not through 1.2, 1.3 and so on.

2
  • I doubt it would work (and would not recommend it even if it does), but what happens if you use 192.168.1.7/29 - ie the broadcast address?
    – davidgo
    Commented Aug 31, 2019 at 10:19
  • It only enables access from that address.
    – Marry Jane
    Commented Aug 31, 2019 at 15:24

1 Answer 1

2

Unfortunately, this is impossible

4
  • Not sure why this was down voted?
    – davidgo
    Commented Aug 31, 2019 at 10:16
  • Don't know either :/ Commented Aug 31, 2019 at 10:17
  • Maybe because of the implication that it would be possible with dynamic IPs? (It's not possible in any case.) Commented Aug 31, 2019 at 12:06
  • 1
    This answer is (unfortunately) correct. Only scripting could make this possible. It’s not worth it, though.
    – Daniel B
    Commented Aug 31, 2019 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .