1

I recently purchased a dedicated server and I have been assigned a /30 subnet by my server provider. Let's say it's:

89.1.1.0/30 Gateway is 89.1.1.1 and my server's ESXi IP is 89.1.1.2

I then requested three more IPs and what they gave was this: (As an example) 202.1.1.1.1/32 202.1.1.2.2/32 200.1.1.1.1/32

The default gateway of these three IPs is the gateway of my server's main IP block - 89.1.1.1

They're on different IP blocks I presume. I'm confused as to what configuration or concept is being used here for me to be able to assign these addresses to my VMs.

  • That's a pain with ESXi using the public IPs, I'd setup pfsense as a VM, and put ESXi on a private subnet behind it. It'll be tricky but easier in the long run imho. Those addresses are routed so you'll probably want to just NAT them on pfsense – Jacob Evans Jan 05 '19 at 18:42

1 Answers1

1

There's at least online.net which is using this kind of setting. Instructions there are to add an additional IP to an existing server, not to have a server (VM) with its own dedicated IP, but it can be done and it's working.

What is important: the netmask of those IPs is /32 because the tweaked configuration is as if they're not sitting in any network: they only need their gateway. The gateway's IP route has to be explicitly added directly on the interface. Being ethernet, under the hood there will still be ARP requests between these two IPs as usual.

The VM has to be configured properly on the hypervisor: bridged, not NATed, and the VM's interface MAC address set properly in the hypervisor to the ISP's settings (if your ISP is checking the MAC address, which online.net can be configured to).

For Linux, in the VM, supposing its WAN ethernet interface is called wan0, the given failover IP is 192.0.2.10/32 and the gateway is 89.1.1.1 (as in OP's example):

ip address add dev wan0 192.0.2.10/32
ip route add 89.1.1.1 dev wan0 
ip route add default via 89.1.1.1

The two first commands can also be abbreviated so this can be done in two lines:

ip address add dev wan0 192.0.2.10 peer 89.1.1.1
ip route add default via 89.1.1.1

Of course it's to be understood that the host provider's gateway has already a similar route setting (eg ip route add 192.0.2.10/32 dev customer1234, probably dynamically configured somehow) for this to be working.

Now you have to adapt this for boot settings. RHEL-like would probably need a route-wan0 file using the ip route commands from the 1st non abbreviated example in addition to ifcfg-wan0 file to cope with the special route settings. Debian-like can use any additional custom ip command in up options in an interfaces file to complete the standard options.

A.B
  • 12,715