Virtualizor Error No Gateway Found, Please assign a Gateway

On a Virtualizor server, when starting virtnetwork, i get the following error

[root@virtual2 ~]# service virtnetwork start
Error: No Gateway Found, Please assign a Gateway.
[root@virtual2 ~]# 

This is because the network interface configuration doesn’t have GATEWAY defined. Find your network interface name with the command

ip link

Now check the configuration file for your network interface.

On this server, I had following configuration

[root@virtual2 ~]# cat  /etc/sysconfig/network-scripts/ifcfg-enp4s0 
### Hetzner Online GmbH installimage

DEVICE=enp4s0
ONBOOT=yes
BOOTPROTO=none
IPADDR=94.130.65.163
PREFIX=32
SCOPE="peer 94.130.65.129"
DEFROUTE=yes

IPV6INIT=yes
IPV6ADDR=2a01:4f8:10b:2f1c::2/64
IPV6_DEFAULTGW=fe80::1
IPV6_DEFROUTE=yes
IPV6_DEFAULTDEV=enp4s0
[root@virtual2 ~]# 

You need to find the gateway used by your server, this can be done with the command

ip route

On this server, I have

[root@virtual2 ~]# ip route
default via 94.130.65.129 dev enp4s0 
94.130.65.129 dev enp4s0 proto kernel scope link src 94.130.65.163 
169.254.0.0/16 dev enp4s0 scope link metric 1002 
188.40.210.0/24 dev natbr3 proto kernel scope link src 188.40.210.32 
[root@virtual2 ~]# 

From above, the gateway used by the server is 94.130.65.129.

Now edit the network interface configuration file

vi /etc/sysconfig/network-scripts/ifcfg-enp4s0

Find the line starting with

IPADDR=

Add below

GATEWAY=YOUR_GATEWAY_IP_HERE

In this case

GATEWAY=94.130.65.129

After this change restarting virtnetwork worked.

[root@virtual2 ~]# service virtnetwork start
Bringing up viifbr0 - OK
Waiting for 10 seconds...1...2...3...4...5...6...7...8...9...10
Internet connectivity check successful viifbr0 - OK
[root@virtual2 ~]# 

See Virtualizor

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *