Wednesday, May 18, 2011

Configuring vSwitch or vNetwork Distributed Switch from the command line in ESX/ESXi 4.x

To restore the Service Console connection to the proper VMNIC connecting to the correct network subnet:

Note: In ESX 4.0 Update 2, a new command-line tool, console-setup, was included to simplify the process of creating or restoring networking in the ESX service console. For more information, see Configuring or restoring networking from the ESX service console using console-setup (1022078).
  • Apply these commands to regular vSwitches:

    esxcfg-vswitch -U #unlink an uplink
    esxcfg-vswitch -L # add an uplink

    Note: Unlink and relinking from or to a distributed switch depending on the scenario.

  • Apply these commands to vNetwork Distributed Switches:

    esxcfg-vswitch -Q -V #unlink a DVS uplink
    esxcfg-vswitch -P -V #add a DVS uplink


  • To create the vswif and uplink it to the DVS port:

    esxcfg-vswif -a -i -n -V -P vswif0

    For example:

    esxcfg-vswif -a -i 192.168.76.1 -n 255.255.255.0 -V dvSwitch -P 8 vswif0
Note: The command-line tool provides limited functionality when running the esxcfg-vswitch command with vNetwork Distributed Switch. For example, you cannot create a dvportgroup or assign VLAN IDs to dvportgroups using this command.

No comments:

Post a Comment