Using a /32 network on Debian 8u3


Recommended Posts

I have a Debian 8u3 virtual machine (web server running plesk not that that is relevant) hosted on a dedicate server at a DC

 

the DC give you single IP addresses rather than IPv4 sub nets, and they ask you to assign them to a mac address in your control panel and then assign that mac address on the VM Host to the guest, which I have done.

 

You then configure the IP address on the guest, for example (not actual IP btw) 176.48.3.78

 

They then tell you to configure a sub net mask of 255.255.255.255 (/32) and use your servers IP address but with .1 on the end as the gateway.  

Lets say my servers address is 176.48.15.78 (again not the actual IP, just an example) then the default gateway to be used on the VM should be 176.48.15.1

 

Debian isn't happy with this at all during setup ,how can it route via a default gateway not even on the same sub net as itself.

If I configure it with the net mask 255.255.0.0 it works, however all IP's inside of 176.48.15 will not be able to route to it, not ideal at all but it worked.

 

The problem is I have upgraded my dedicated server int he DC (and have 8 days to migrate everything) and its IP address is now (another example) completely different 189.65.48.30 so the default gateway on the Debian VM needs to be 89.65.48.1

There is no way to shorten the sub net mask to allow Debian to route now.

 

If I configure in windows an IP address a net mask of 255.255.255.255 and a gateway nowhere even close to the IP address it gives a warning, but if I dismiss this warning it works and routes as online.net suggest it will.

 

In Debian if I edit /etc/network/interfaces in a similar way and save it, then reboot the server, it cannot ping out or accept any traffic in at all.

 

How can I make it route like window sis able to ??

 

Thanks.

Mark

Link to comment
Share on other sites

Still struggling on this, I thought I had cracked it because my web server now works fine pages load, email clients can connect, everything works as expected.

 

until the server tries to connect outwards itself, any time plesk tries to update, or osticket tries to connect to an external email service, or anything like that it cannot

 

I cant even ping from the console

 

here's my interfaces config ....

 

Capture.png

 

Ive blanked out bits for security reasons.

 

Here is how the DC tell you to configure it ...

 

https://documentation.online.net/en/dedicated-server/network/ip-failover/debian-ubuntu

 

I tried adding various routes and couldn't cure the problem.  can anyone point me the right way ?

 

Thanks!

Link to comment
Share on other sites

Some more screens ...

 

Pings out go unanswered

 

capture_2.png

 

Web pages on that /32 IP load fine ...

 

plesk_screen.png

 

 

Link to comment
Share on other sites

So I made progress

 

progress.png

 

 

However I can only communicate with traffic on 8.0.0.1 to 8.254.254.254

 

Do i have to manually add routes for every subnet outside of the one asigned to eth0 ? 

 

Also is the re a way to have these routes saved so they remain after a reboot ?

 

Thanks

Link to comment
Share on other sites

I figured it out

 

ip route del default (remove the deult rule)

 

ip route add default via 62.xxx.xxx.1 src 163.xxx.xxx.xxx (add it back but with the failover IP as source)

 

I added those 2 lines to /etc/rc.local

 

fixed.png

 

wow i jumped through hoops to figure that out, quite a learning curve.  I now know more about Linux routing than i ever did

Edited by Inertia
Link to comment
Share on other sites

This topic is now closed to further replies.