VMware Cloud Community
fabbasi
Contributor
Contributor

VM network interface Mapping/matching problem - VM conf vs VM

Hi All,

Im setting up a Virtual demo network for a student project that involves creating a VM transparent gateway connecting 2 or 3 VM's to the internet. The transparent gateway is simply acting as a bridge. such that:

eth0 is bridged (WAN) pointing towards our physical router

eth1 is host-only (DMZ) pointing towards the client machines

eth2 is LAN interface pointing towards our LAN & is to be used for management only.

This VM is running Centos. Problem is when i boot the machine and run an ifconfig it seems to swap up interfaces hapharzardly. The VMX conf is consistent with my configuraiton but the VM itself cannot seem to identify the correct interface. I observed this by simply looking at the HW MAC addresses and comparig them with the original conf.

Regarding my problem, I tested several times and it seems that

though the configuration and the VM conf file is consistent, however

when I boot up the machine it seems to swap interfaces. Any suggestions?

From ESX SSH console:

XXXXX # cat XXXXX.vmx | grep ethernet

ethernet0.present = "TRUE"

ethernet0.networkName = "WAN"

ethernet0.addressType = "generated"

ethernet0.startConnected = "TRUE"

ethernet0.generatedAddress = "00:0c:29:0c:c1:7a"

ethernet0.pciSlotNumber = "32"

ethernet0.generatedAddressOffset = "0"

ethernet1.present = "TRUE"

ethernet2.present = "TRUE"

ethernet1.networkName = "DMZ"

ethernet1.addressType = "generated"

ethernet2.networkName = "LAN"

ethernet2.addressType = "generated"

ethernet1.generatedAddress = "00:0c:29:0c:c1:84"

ethernet2.generatedAddress = "00:0c:29:0c:c1:8e"

ethernet1.pciSlotNumber = "33"

ethernet2.pciSlotNumber = "34"

ethernet1.generatedAddressOffset = "10"

ethernet2.generatedAddressOffset = "20"

From Gateway VM Console:

view attached screenshot. I did install vmware tools but still having trouble copy/pasting between VM and vsphere/console

Thanks, Fahim

0 Kudos
5 Replies
AndreTheGiant
Immortal
Immortal

I see that 2 vNIC are swapped.

But you can fix the order with udev.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
fabbasi
Contributor
Contributor

Hi Andre,

What you suggested is correct but an OS based hack. I was looking at something more of a ESX based conf. Heres what Ive found out:

Setting up all VM interfaces manually by explicitly defining MAC's seems to solve this problem. No need to touch OS confs at all.

-Fahim

0 Kudos
AndreTheGiant
Immortal
Immortal

NIC order is always difficult.

In this case I suggest you to add one vNIC configure it, add the second and configure it, add the 3th and configure it.

Only in this way you are sure of the order.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
fabbasi
Contributor
Contributor

Hi,

Yes, Ive already tried that. Seems to work fine for single interface but as soon as you add the second one and boot the VM it again comes up with the same problem. As you say its very tricky indeed. So far manually assigning MAC addresses to all interfaces within the ESX VM configuration seems to work fine. Funny thing is that even after manually assigning MAC to a 1 interface out of the 3 fails as well. The only thing that seems to work perfect is manually assinging MAC to all interfaces simultaneously and then booting the VM. Im settling with this for now, but yes it does seem like an ESX bug of some kind.

Thanks again for helping.

-Fahim

0 Kudos
AndreTheGiant
Immortal
Immortal

You're welcome.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos