Bobcares

“No Gateway Found, Please Assign a Gateway” Error in Virtualizor

by | Feb 24, 2025

Learn how to correct the “No Gateway Found, Please Assign a Gateway” error in Virtualizor. Our Virtualizor Support team is here to help you with your questions and concerns.

“No Gateway Found, Please Assign a Gateway” Error in Virtualizor

When setting up a virtual machine (VM) or configuring a network in Virtualizor, we are likely to run into the following error:

"No Gateway Found, Please Assign a Gateway" Error in VirtualizorNo Gateway Found, Please assign a Gateway

This error indicates that Virtualizor cannot locate or assign a gateway IP address, often due to misconfigured network settings.

The most common causes of this error include:

  • Missing GATEWAY definition in the network interface configuration.
  • Incorrect network interface settings.
  • Undefined network parameters.

Solution

  1. First, find the name of the network interface by running:

    ip link

  2. Then, locate the configuration file for the network interface.

    For example:

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

    The configuration might look something like this:


    DEVICE=enp4s0
    ONBOOT=yes
    BOOTPROTO=none
    IPADDR=xx.yyy.uu.eee
    PREFIX=32
    SCOPE="peer xx.yyy.uu.eee"
    DEFROUTE=yes
    IPV6INIT=yes
    IPV6ADDR=tttt:rrr:uuu:bbbb::x/nn
    IPV6_DEFAULTGW=jjjj::1
    IPV6_DEFROUTE=yes
    IPV6_DEFAULTDEV=enp4s0

  3. Next, retrieve the gateway IP address used by the server:

    ip route

    Example output:

    default via xx.yyy.uu.eee dev enp4s0
    xx.yyy.uu.eee dev enp4s0 proto kernel scope link src xx.yyy.uu.eee

    From this output, the gateway IP is xx.yyy.uu.eee.

  4. Then, edit the network interface configuration file:

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

    Find the line starting with `IPADDR=`, and add the following line beneath it:

    GATEWAY=xx.yyy.uu.eee

  5. After saving the changes, restart the Virtualizor network services:

    service virtnetwork start

    We will see an output indicating a successful restart:


    Bringing up viifbr0 - OK
    Waiting for 10 seconds...1...2...3...4...5...6...7...8...9...10
    Internet connectivity check successful viifbr0 - OK

Alternate Solution 1: Updating Network Files

Ensure the correct network details are present in these files:

  • CentOS: `/etc/sysconfig/network-scripts/ifcfg-servers-interface-name`
  • Ubuntu: `/etc/network/interfaces`

CentOS configuration example:


IPADDR=xx.y.n.jj
PREFIX=24 or NETMASK=hhh.ggg.kkk.u
GATEWAY=xx.y.n.jj

Here is an Ubuntu configuration example:


address xx.y.n.jj
netmask xx.y.n.jj
gateway xx.y.n.jj

Alternate Solution 2: Using Virtualizor’s universal.php File

If we prefer not to modify network files directly, we can update the gateway in Virtualizor’s universal configuration file:

vi /usr/local/virtualizor/universal.php

Then, add or update the following lines:


$globals['ipadd'] = 'xx.y.n.jj';
$globals['netmask'] = 'hhh.ggg.kkk.u';
$globals['gateway'] = 'xx.y.n.jj';
$globals['ip6add'] = '';
$globals['gateway6'] = '';

After that, restart the network services:

service virtnetwork start

How to Configure Bridge Settings

If we have an existing bridge (like `xenbr1`), ensure it is correctly mentioned in Virtualizor:

  1. Go to Configuration > Slave settings > Paravirtualization Bridge and HVM Bridge.
  2. Set the correct bridge name (e.g., `viifbr0`).

After making these changes, confirm the network is working by testing VM connectivity and checking Virtualizor’s network status.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

With the above steps, we can resolve the “No Gateway Found” error in Virtualizor and restore proper network functionality for our VMs.

In brief, our Support Experts demonstrated how to correct the “No Gateway Found, Please Assign a Gateway” error in Virtualizor.

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.