I recently upgraded my lab vCenter to the vCenter Server Appliance (VCSA) v6.5.
As I need a static route on my network, I went to add that in the same way that I’ve done for other VCSAs, only to find that the networking has changed.
VCSA 6.5 now uses systemd-networkd to control networking. Any attempt to use “service network restart” will generate a bunch of error messages about “exiting with error 6”. Editing files in /etc/sysconfig/network will have no discernable effect.
So how do you add a static route under the new networking regime?
Log on to your VCSA using ssh (or the console) and start a shell.
There you will find all the network config files.
Typically you will have just one, named “10-eth0.network”.
The contents of this file are relatively self explanatory:
[Match] Name=eth0 [Network] Gateway=192.168.1.254 Address=192.168.1.40/24 DHCP=no [DHCP] UseDNS=false
Add a new section at the bottom of the file using your favourite text editor:
[Route] Gateway=192.168.1.20 Destination=192.168.2.0/24
Again, the format for this is pretty obvious.
Once that’s saved, run:
systemctl restart systemd-networkd
Check that your route has taken using
root@vc01 [ ~ ]# ip route show default via 192.168.1.254 dev eth0 proto static 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.40 192.168.2.0/24 via 192.168.1.20 dev eth0 proto static