Forum Stats

  • 3,817,432 Users
  • 2,259,333 Discussions


Add Default Gateway in OVMM

User_TCQ1L Member Posts: 2 Green Ribbon
edited Jul 10, 2020 11:35AM in Oracle VM

I am setting up a new environment with dedicated networks assigned for management, storage, and VM data. The network is stretched between two sites and in order to reach everything on the network I need to specify a gateway or route for each network but I cannot find where to add that setting into OVMM. If I need to add this info into /etc/sysconfig/ifcfg-* then what entries can I add to set a gateway for each network that will not interfere with OVMM settings.


  • commenter-Oracle
    commenter-Oracle Member Posts: 15 Employee
    edited Jul 10, 2020 11:35AM


    For an example, assume public networks for two machines:

    1. Network A with a subnet <subnet-ip> and a default route <def-ip> on bond0
    2. Network B with a subnet <subnet-ip> and a default route <def-ip> on bond1

    The default route for the server should be the route from network A but after restarting the server it uses route from network B.

    If you manually define defroute=no in ifcfg-bond1 and restart the network all works fine. But after next restart defroute=no has been deleted from ifcfg-bond1 and again you will have an issue with the default rout

    Define Gateway in the ifcfg files and create a route file for the interfaces.

    Edit /etc/sysconfig/network-scripts/ifcfg-bond*

    Add the below line.

    GATEWAY= <Gateway-IP>

    And also,

    Create route file for the bond0 and bond1 under "/etc/sysconfig/network-scripts/" directory.

    # vi /etc/sysconfig/network-scripts/route-bond0

    Contents could be as below.

    default via <gateway-ip> dev <Interface>

    Replace the contents of <> with the actual values.

    This is persistent to boot.