Set up 4 ip addresses with Subnet mask 255.255.255.252 (30)

Patrick asked:

i bought 4 ip addresses on OVH.
Then they gave me this details:

84.84.184.176/30
Network IP: 84.84.184.176
Broadcast IP: 84.84.184.179
Gateway IP: 84.84.184.178
Netmask: 255.255.255.252

And they assigned me mac addresses.

IP and Mask Details: 
IP 1: 84.84.184.176
MAC: 00:50:56:56:56:aa

IP 2: 84.84.184.177
MAC: 00:50:56:56:56:bb

IP 3: 84.84.184.178
MAC: 00:50:56:56:56:cc

IP 4: 84.84.184.179
Mac: 00:50:56:56:56:dd

But the problem is if i add the gateway on each ip address then nothing works anymore if i assigned the gateway ip 84.84.184.178.

I’m using CentOS.

Thanks for each idea in Advance 🙂

My answer:


Don’t set them up this way unless you have routed the block of IP addresses to a vRack. And, with such a small block, you should not attempt to route it to a vRack or you’ll only have one usable IP address.

If you route the block directly to your dedicated server, you may use each address individually with a /32 prefix and your existing default gateway.

For instance:

IPADDR=198.51.100.107
PREFIX=24
GATEWAY=198.51.100.254

is your server’s main IP address, while

IPADDR2=203.0.113.176
PREFIX2=32
IPADDR3=203.0.113.177
PREFIX3=32
IPADDR4=203.0.113.178
PREFIX4=32
IPADDR5=203.0.113.179
PREFIX5=32

are the secondaries.

If you want to assign them to bridged virtual machines, then you don’t set up the secondary IP addresses in the host. You’ll need to set virtual MAC addresses in the OVH control panel, then create VMs with those MAC addresses and the host’s gateway, like:

IPADDR=203.0.113.176
PREFIX=32
GATEWAY=198.51.100.254

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.