0

I have a vps server hosted with an internationally, very well-known hosting provider, and oddly enough they seem disturbingly incapable of troubleshooting their own system.

There are two specific issues, that may or may not be related.

Currently, I have a debian 10.5 vps instance, which has dhcp ip, (public / private ips that never change despite the dhcp status

problem:

I need to switch from dhcp to a static ip in order to run certain packages on my host. Using instructions provided by the hosting provider, I configured the /etc/network/interfaces file as follows:

#The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
auto eth0
iface eth0 inet static
   address XXX.XX.XX.XXX
   netmask 255.255.255.0
   gateway XXX.XX.XX.XXX 

However, after reboot ip a still shows my primary network interface, eth0, as configured as "dynamic" rather than static:

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:xx:xx:01:XX:9d brd ff:ff:ff:ff:ff:ff
    inet xxx.xx.xx.xxx/18 brd xxx.xx.xx.xx scope global dynamic eth0   <---shows dynamic
       valid_lft xxxxxxxsec preferred_lft xxxxx4sec

Additionally the contents of my /etc/resolv.conf is missing:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
options timeout:2 attempts:3 rotate single-request-reopen

Does anyone have any clues as to what has gone wrong? Thx

NOTE: other than these issues, everything else seems to working perfectly fine.

Maestro223
  • 163
  • 1
  • 9

1 Answers1

0

After 13 days of my hosting provider scratching their heads s solution seems to have been found:

The /etc/systemd/network/10-eth0.network file must be edited as follows:

# nano /etc/systemd/network/10-eth0.network
[Match]
Name=eth0
[Network]
Address=xxx.XX.XX.XXX/18
Gateway=xxx.XX.XX.XX
DNS=xxx.xxx.x.xxx
DNS=xxx.xxx.x.xxx

The /etc/network/interfaces file should be edited as follows:

# nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static 
   address xxx.XX.XX.XX
   netmask 255.255.255.0
   gateway xxx.XX.XX.XXX
   dns-nameservers xxx.xxx.x.xx xxx.xxx.x.xxx

#ip a , now correctly reflects a static ip:

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:01:78:9d brd ff:ff:ff:ff:ff:ff
    inet 172.17.51.140/18 brd 172.17.63.255 scope global eth0   <--- Static IP
       valid_lft forever preferred_lft forever

And /etc/resolv.conf contains:

# cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver xxx.xxx.x.xxx `<--dynamically added`
nameserver xxx.xxx.x.xxx `<--dynamically added`
options timeout:2 attempts:3 rotate single-request-reopen

And all is now well in "vps land"

Maestro223
  • 163
  • 1
  • 9