Virtualizor Error No Gateway Found, Please assign a Gateway
On Virtualizor server, when start virtnetwork, i get following error
1 2 3 |
[root@virtual2 ~]# service virtnetwork start Error: No Gateway Found, Please assign a Gateway. [root@virtual2 ~]# |
This is because the network inferace configuration don’t have GATEWAY defined. Find your network interface name with command
1 |
ip link |
Now check configuration file for your network interface.
On this server, i had following configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[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 command
1 |
ip route |
In this server, i have
1 2 3 4 5 6 |
[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
1 |
vi /etc/sysconfig/network-scripts/ifcfg-enp4s0 |
Find line starting with
1 |
IPADDR= |
Add below
1 |
GATEWAY=YOUR_GATEWAY_IP_HERE |
In this case
1 |
GATEWAY=94.130.65.129 |
After this change restarting virtnetwork worked.
1 2 3 4 5 |
[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