VMware Communities
djsuson
Contributor
Contributor

Using second ethernet card exclusively by the virtual machine

I have a linux host with a windows based virtual machine on it. In order to do my research, the linux host sits on a partially secured network. I use the virtual machine to do administrative work, which has to be secured, and so needs to be on another network. I've got two NICs in the computer, and two different ethernet drops. What I would like to do is have the primary NIC be eth0 and assigned to the research network. Linux assigns an IP, gateway, etc to it on boot up. The secondary NIC is seen by linux, but does not have any assignments. Is there any way to set up the virtual machine so that it sees the secondary unitialized NIC (which shows up under ifconfig -a as eth1), and configures it to run on the secure network so that only the virtual machine uses the second network?

Thanks,

Dan Suson

0 Kudos
14 Replies
Aldebaran
Hot Shot
Hot Shot

Yes, you can easily do this with Linux.

You correctly identified what needs to be done for the secondary nic, namely do not assign it an address. The next part is to associate eth1 with a particular vmnet (for example, vmnet2). See the last post in the following thread for specifics on how to create the device special files for that:

http://communities.vmware.com/message/697631

Next, rerun vmware-config.pl to set up another bridged network (vmnet2). When vmware is started, you should have two vmnet-bridge processes running, one for each of eth0 and eth1.

Then, when you create your VM, add networking, select custom and select vmnet2.

Jeff

0 Kudos
djsuson
Contributor
Contributor

Thank you for the help. It got me most of the way there. The biggest problem left is how to tie vmnet2 to eth1. The referenced post did not give any instructions on how to do that. Can you provide instructions on that part?

Thanks,

Dan

0 Kudos
oreeh
Immortal
Immortal

You do this by running vmware-config.pl again (as stated above from Jeff)

0 Kudos
djsuson
Contributor
Contributor

Thank you oreeh, I missed that part in Jim's response. One last (hopefully) question. What I really want is for the virtual machine is only bind to eth1. Is there a way to either bind vmnet0 to eth1 and delete vmnet2 or vice versa? This should eliminate any security issues of someone breaking into my linux box and then bridging over to the virtual machine to get at sensitive data.

Thanks,

Dan

0 Kudos
oreeh
Immortal
Immortal

What I really want is for the virtual machine is only bind to

eth1. Is there a way to either bind vmnet0 to eth1 and delete

vmnet2 or vice versa?

Yes.

You only have to specify that you want to bridge eth1 to vmnet0

during the configuratin dialog.

0 Kudos
djsuson
Contributor
Contributor

Okay, this seems to be close, but not quite there. I ran vmware-config.pl, used the editor for the networking, deleted vmnet2 and bound vmnet0 to eth1. I started up vmware and edited the virtual machine so that it used a custom network connection, /dev/vmnet0. When I started the virtual machine, it showed no network connectivity. I then exited the virtual machine and edited the network connection again, changing it back to bridged. When I started up the virtual machine, I got a message that said "The network bridge on device /dev/vmnet0 is temporarily down because the bridged Ethernet interface is down. The virtual machine may not be able to communicate with the host or with other machines on your network." When the virtual machine finished coming up, Windows again showed no network connectivity. What am I missing? Since I'm using a 2.6 kernel with udev, there aren't any eth* devices in /dev/. Could it be related to that? Does this indicate that I need both vmnet0 bound to eth0 and vmnet2 bound to eth1?

Thanks,

Dan

0 Kudos
oreeh
Immortal
Immortal

I'm not 100% sure but if I remember correctly udev and missing eth devices IS a problem.

0 Kudos
djsuson
Contributor
Contributor

Lots of dirty words. Any ideas on how to work around this?

0 Kudos
oreeh
Immortal
Immortal

Lots of dirty words.

No comment Smiley Wink

Any ideas on how to work around this?

Not really - I never use udev.

Try searching for udev using the search page (available at http://commuities.vmware.com/search.jspa)

Good luck!

0 Kudos
djsuson
Contributor
Contributor

I think the issue about udev is misleading. If the problem had to do with udev, then I wouldn't have been able to bind vmnet0 to eth0 originally. udev controls all eth* devices, so I shouldn't have been able to use eth0. Any other ideas?

0 Kudos
oreeh
Immortal
Immortal

As I said - I'm not 100% sure about this

0 Kudos
KevinG
Immortal
Immortal

Hi djsuson,

Post the output from " ps auxwww | grep -i bridge " from your host

Post the .vmx file from the virtual machine

Post the output from " ifoconfig -a " from your Linux host

0 Kudos
djsuson
Contributor
Contributor

I did some testing this morning to see what was and wasn't working. Here are the results:

Confirmed that both NICs were operational under linux by connecting them individually to the network.

Confirmed that both NICs could be run simultaneously under linux by obtaining DHCP assigned IP numbers for both cards.

Bound vmnet0 to eth0 and vmnet2 to eth1 while both NICs had linux IP addresses - virtual machine bridged to both cards without problems.

Bound vmnet0 to eth0 and vmnet2 to eth1 while only eth0 had linux assigned IP address - virtual machine saw network on vmnet0, but not on vmnet2.

Based on this, it looks like the problem is related to not assigning an IP number to the second card under linux. This is a problem, as I was hoping to let the virtual machine handle that on the second network. Any insights would be appreciated. The requested files are attached.

Dan

0 Kudos
BlueSKYCY
Contributor
Contributor

today,I meet the some problem,as i was searching from internet,i found a command:vmware-netcfg

it's great,i have solved this problem!

OK!

0 Kudos