«

»

Apr 12 2017

Manage ESXi Routing Via Command Line Interface

“VMTurbo"
There are certain key combinations and commands I find more difficult to remember than others. I wrote about Send F Key to VMware Fusion via MacBook Keyboard and the next in line is routing for ESXi. This is not something i do very often but It happens from time to time. I will not go into the details (requirements) behind the configuration needed in this case but let’s just say it was not something I see a lot.

So In this case I had two vmkernel adapters, vmk0 (used for normal management and vMotion) and vmk1 (used for backup purposes) and their information including name, MAC address, MTU, switch & port group placement among other things) can be listed using the following command:

The vmkernel adapter IP configuration can be listed using:

This is the output from the above command:

Let’s move on to topic of this blog post, the ESXi routing configuration via cli. And yes, there is an option to mange this via the a UI e.g vSphere Web Client as well.

List current routing configuration using the following command:

In my case I received the following:

All traffic not target for the 10.10.100.0 network will go via vmk0 meaning the 192.168.10.110 interface to the 192.168.10.1 default gateway. Based on network requirements the customer wanted network 172.16.20.0/24 to be accesses via the 10.10.100.110.

The command syntax for adding and removing an additional route is:

So to achieve the requirements I ran the following command:

Verified the configuration using the list option and it looks ok:

The following command will remove my newly added configuration:

These commands were tested on ESXi 6.0.0 build-3568940

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">