Layer3

Adventures in Networking, Routing, Switching, Virtualization, Storage, etc.

Posts Tagged ‘VMware’

Reassign a vswif to a new vmnic

Posted by Chris on November 3, 2009

The VMware host in my lab is a Dell GX620 running ESX3.51 U2.  It has three NIC’s:
The embedded Broadcom BCM5751 Gigabit Adapter  (vmnic0)
3Com 3C905C-TX 10/100 Adapter  (vmnic1)
Intel 8254N Dual Port Gigabit Adapter  (vmnic2 and vmnic3)

The 3C905 isn’t entirely VMware compatible.  It can be used as a service console connection but will not function as a virtual machine uplink on a vSwitch.  It will always show disconnected.

I want to reassign the service console vswif to the 3Com adapter, keep the same IP address and move the service console port group to a new vSwitch.
before

VMware doesn’t like having two service console connections with different IP addresses in the same subnet, so I have two options.

1.  Create a service console connection in a different subnet and access the host from that subnet using the VIclient.
2.  Enter the commands directly on the host console.

I recommend option two.  Keep in mind that this process temporarily disrupts network communications to the host via the service console IP.

After obtaining physical access to the host’s console (or network access via a DRAC or ILO), log in and su - to establish root.

Remove vswif0 from vSwitch0
esxcfg-vswif -d vswif0  –ip=192.168.68.35  –netmask=255.255.255.0  –portgroup=SCX

Remove the SCX port group from vSwitch0
esxcfg-vswitch –del-pg=SCX vSwitch0

Create a new vSwitch for the service console;
esxcfg-vswitch -a vSwitch3

Assign the 3Com adapter to the newly created vSwitch
esxcfg-vswitch -L vmnic1 vSwitch3

Add the SCX port group to vSwitch3
esxcfg-vswitch -A SCX vSwitch3

Add vswif0 to the SCX port group and assign the IP address and subnet mask
esxcfg-vswif –add –ip=192.168.68.35 –netmask=255.255.255.0 –Portgroup=SC2 vswif0

Restart the VMware management service
service mgmt-vmware restart

Here’s vSwitch0, still connected to vmnic0 but minus the service console
after1

And here’s the new vSwitch3 with the service console reassigned to vmnic1
after2

Posted in VMware, Virtualization | Tagged: , | Leave a Comment »

Enable CDP on a VMware vSwitch

Posted by Chris on October 21, 2009

vSwitches are capable of advertising and listening for CDP information from an attached Cisco device.
CDP on a vSwitch is set to “Listen” by default.

To enable CDP you’ll need to access the Service Console.
After logging in type su- to establish root.

First let’s take a look at the command options by using esxcfg-vswitch -h

esxcfg-vswitch-h

Use esxcfg-vswitch -l to show a list of configured vSwitches on the host.

esxcfg-vswitch-l

Now that we know the vSwitch names, let’s check the CDP status on vSwitch1 using esxcfg-vswitch -b vSwitch1
esxcfg-vswitch-b
Set CDP to listen and advertise using the “both” option.  esxcfg-vswitch -B both vSwitch1
Verify the settings using esxcfg-vswitch -b vSwitch1
esxcfg-vswitch-B both
Executing show CDP neighbors from the Catalyst switch shows the ports that the ESX host resides on and the vmnic of the uplink.

showcdpneighbors

Posted in Networking, Switching, VMware, Virtualization | Tagged: , , | Leave a Comment »

vSphere Service Console Firewall Commands

Posted by Chris on October 19, 2009

In the VCP4 exam blueprint, Objective 1.3 states that you “Understand Service Console firewall operation”.

The command syntax is esxcfg-firewall -<options>

The service console has a small number of services predefined in the firewall.  Use the -e and -d options to enable/disable these services.
To open/close a custom port that is not predefined, use the -o or -c options.

Start by opening an SSH session to the ESX server and entering su- to establish root.

esxcfg-firewall -s
Lists the predefined services known to the VMware host.
Remember “s” for services.

Here’s an example of the command output on an ESX3.51 U2 host showing the predefined services.
esxcfg-firewall

esxcfg-firewall -q
Queries the current firewall configuration.
Shows Enabled services and Opened ports.
Remember “q” for query.

esxcfg-firewall -e  <service name>
Enables a predefined service.
Remember “e” for enable service.

esxcfg-firewall -d <service name>
Disables a predefined service.
Remember “d” for disable service.

esxcfg-firewall -o <port, tcp|udp, in|out, name>

Opens a port that is not already defined as a service.
Remember “o” for open port.

esxcfg-firewall -c <port, tcp|udp, in|out, name>
Closes a port that is not already defined as a service.
Remember “c” for close port.

esxcfg-firewall -r
Resets all firewall options to default settings.
Remember “r” for reset.

Posted in VCP, VMware, Virtualization | Tagged: , , , | Leave a Comment »