Persistent Static Routes on VCSA
search cancel

Persistent Static Routes on VCSA

book

Article ID: 369720

calendar_today

Updated On:

Products

VMware vCenter Server 8.0

Issue/Introduction

Enabling the appliance to internet access using a static route.

Resolution

Static route(Not persistent)

  1. Login to the vCenter Server using SSH and use below commands to add routing:

    route add -net <TargetNetwork> netmask <NetmaskAddress> gw <GatewayAddress> dev <interface>
    Example: route add -net 192.168.x.x netmask 255.255.0.0 gw 10.20.x.x dev eth0

    Note: After adding the route using the above command, it will be not persistent and can be deleted from the routing table post the VCSA reboot. To make it persistent, please follow Static route(Persistent) steps below.

Static route(Persistent)

  1. Edit the file : /etc/systemd/network/10-eth0.network and add a section [Route] to the file:

    Original file:
    [Match]
    Name=eth0
    
    [Network]
    Gateway=10.20.x.x
    Address=10.10.x.x/26
    DHCP=no
    
    [DHCP]
    UseDNS=false
    After making changes to the file:
    [Match]
    Name=eth0
    
    [Network]
    Gateway=10.20.x.x
    Address=10.10.x.x/26
    DHCP=no
    
    [DHCP]
    UseDNS=false
    
    [Route]
    Gateway=10.20.x.x
    Destination=192.168.x.x/16


  2. Save the file and run the below command to restart the network daemon:

    systemctl restart systemd-networkd.service

  3. Check if the route is still persistent using command :

    route -n