Skip to main content

Recently I was installing things on my home lab and  I was forced to apply to my vCenter appliance some static routes. This kind of configuration is required due to the fact that my network infrastructure “home-router” doesn’t support static routes. (I know it’s a shame and I’m planning to replace it with another one in the future) So the goal of this article is to show how to put in communication my vCenter that reside on my home-lan (the one with the shitty router) with other devices that are on network segments behind a pfsense router.

Luckily, the research didn’t take so much, because another guy ran into the same issue and he found a pretty simple solution, using the API commands to set static routes on the vCenter. You can find the original article here.

This kind of configuration is quite fast to be done, it’s just a matter to connect to the VCSA via SSH and using some commands.

You can see the full api commands list avaiable by typing: help api list

You can verify how to use every command previously listed by adding “–help” at the end. In my case I want to know how to use the routes command so:

“com.vmware.appliance.version1.networking.routes.add –help”

Before implementing the Routes,  I wanted to know the name of the network interface where apply them (commonly is named  “nic0”),  let’s use some api command for get a piece of clear information:

com.vmware.appliance.version1.networking.interfaces.list

Now let’s use the command for adding static routes to my vCenter appliance:

“com.vmware.appliance.version1.networking.routes.add –interface nic0 –gateway 192.168.0.199 –destination 172.16.10.0 –prefix 24”

“com.vmware.appliance.version1.networking.routes.add –interface nic0 –gateway 192.168.0.199 –destination 172.16.11.0 –prefix 24”

“com.vmware.appliance.version1.networking.routes.add –interface nic0 –gateway 192.168.0.199 –destination 172.16.12.0 –prefix 24”

After doing that I was able to reach the other network segments.
Let’s check with a last command the configuration of the static routes:

com.vmware.appliance.version1.networking.routes.list

I Hope this will be helpful to someone that maybe have to deal with not enterprise network devices, especially on the homelab.

(Many thanks to my ISP that provided a super basic router without this feature)

2 Comments

  • shaun ha detto:

    very helpfull

    I had to use the double —

    com.vmware.appliance.version1.networking.routes.add –interface nic0 –gateway 192.168.100.3 –destination 192.168.99.0 –prefix 24

    vcsa.7.0.1

    • Giovanni Dominoni ha detto:

      I’m glad that it helped! You are right at the moment that I wrote the article I didn’t check the automatic correction engine that basically deleted the double dashes.
      Fixed now!
      Thanks for taking the time for drop a comment!

Leave a Reply