Page 1 of 1

Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 08:23:52
by jentos
I installed CentOS 7 using the minimal ISO on my Proxmox VPS (Hosted on SoYouStart / OVH - noted since they have weird networking policies), configured my ifcfg-eth0 file. After that I was able to use yum update, ping 8.8.8.8, connect via SSH, etc.

After following this guide to disable network manager - I'm no longer able to do anything network related, including pinging 8.8.8.8 (I get 'connect: Network is unreachable')

My ifcfg-eth0:

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO="none"
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=My UUID
DEVICE=eth0
ONBOOT="yes"
HWADDR=My VPS's virtual mac
IPADDR=XXX.XXX.192.145
PREFIX=24
GATEWAY=Main IP on my proxmox box gateway IP (XXX.XXX.XXX.254)
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6_PRIVACY=no
ARPCHECK="no"
NETMASK=255.255.255.255

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 11:43:21
by tunk
Are you sure it's called eth0? - the default in CentOS 7 is something else like em1 or enp3s0.

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 13:16:18
by jentos
tunk wrote:
2018/09/28 11:43:21
Are you sure it's called eth0? - the defult in CentOS 7 is something else like em1 or enp3s0.
eth0 is what was autoassigned on installation, and what worked with NetworkManager. How do I change it to test to see if it's something different for network.service?

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 15:01:54
by tunk
Your NETMASK may be a bit restrictive.

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 15:31:36
by TrevorH
OVH have a very weird networking setup where the default gateway is not within the same subnet as the ip assigned to the server. You have to add an explicit route to that gateway via the ethernet device itself, not via another ip.

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/09/28 21:03:38
by jentos
How do I do these things? I'm completely new to CentOS and don't have much experience with networking

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/10/01 11:48:02
by stevemowbray
In that case maybe you should just stick with the default NetworkManager setup. Why are you trying to change it?

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/10/01 12:29:45
by tunk
I don't know if it will work, but you could try NETMASK=255.255.0.0

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/10/01 13:55:52
by jentos
stevemowbray wrote:
2018/10/01 11:48:02
In that case maybe you should just stick with the default NetworkManager setup. Why are you trying to change it?
Because cPanel doesn't work with NetworkManager

Re: Disabling Network Manager and enabling network.service causes 'Network is unreachable' error

Posted: 2018/10/01 17:11:07
by TrevorH
OVH have instructions on how to configure their own weird brand of networking. You need to ask them about it as they are the only people that do things in this weird way. You have to add an explicit route for the gateway ip address via the correct network device and then set up your default route to go via that gateway after that. Expressed in `ip` commands it's something like

ip route add 1.2.3.4 via dev eth0
ip route add default via 1.2.3.4

How you set up the system to do this is OVH's problem. Sorry.