Configuring Vmware ESX Networking via CLI (Part I)


2 useful sites for configuring Vmware ESX Networking via CLI. The material of this blog is taken from the 2 website.

  1. Configuring networking from the ESX service console command line (kb.vmware.com)
  2. New User’s Guide to Configuring VMware ESX Networking via CLI (blog.scottlowe.org)

In summary, there are 2 important commands you will need to know

  1. esxcfg-vswitch: (Manipulate vswitch and port)
  2. esxcfg-nics: (View network card)

1. Ensure that your Network Cards is connected

# esxcfg-nics –l
Name PCI Driver Link Speed Duplex Description
vmnic0 06:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet
vmnic1 07:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet

* In the Link Column “Up” means that the Network Adapter is up and connected.

2. List the current virtual switches

# esxcfg-vswitch –l
Switch Name Num Ports Used Ports Configured Ports Uplinks
vSwitch0 32 3 32 vmnic0

PortGroup Name Internal ID VLAN ID Used Ports Uplinks
VM Network portgroup2 0 0 vmnic0

3. Creating a new switch

# esxcfg-vswitch –a <vSwitch Name>

4.  Create the Service Console portgroup on this new virtual switch

# esxcfg-vswitch -A <Port Group Name> <vSwitch Name>

For example,

# esxcfg-vswitch –A “Service Console” vSwitch1

5. To Link the Physcial Switch to a vSwitch

# esxcfg-vswitch -L <Physical NIC> <vSwitch Name>

For example,

# esxcfg-vswitch –L vmnic0 vSwitch1

6. To unlink the the Physcial Switch to a vSwitch

# esxcfg-vswitch -U <Physical NIC> <vSwitch Name>

7. Verify the new virtual switch configuration

# esxcfg-vswitch –l

8. Delete a vSwitch

# esxcfg-vswitch -d <vSwitch Name>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s