Configuring Persistent Static Routes on VCSA
search cancel

Configuring Persistent Static Routes on VCSA

book

Article ID: 369720

calendar_today

Updated On: 01-09-2025

Products

VMware vCenter Server 8.0 VMware vCenter Server 7.0 VMware vCenter Server

Issue/Introduction

Enabling the appliance to internet access using a static route.

Environment

VMware vCenter Server 7.x

VMware vCenter Server 8.x

Resolution

NOTE: Ensure to take a no memory snapshot of the vCenter server if it is standalone or powered off snapshot of the vCenter server if they are in linked mode.

  • 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)

NOTE: Take a backup of the file 10-eth0.network 

  • cp /etc/systemd/network/10-eth0.network /etc/systemd/network/10-eth0.network.backup
  1. Edit the file using vi editor : /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

   

Additional Information

Route will be flushed after major version upgrade.