Skip to content

December 12, 2012


VMplayer: How to bridge to a specific network port

by Joe Kuan

Suppose you need to bridge another network interface under your VM to a specific physical network port. First, you need to create a vmnet port and bind with that specific port. Here are the commands:

vmnet-bridge -n 2 -i eth1  -d /var/run/ -1vmnet2
mknod /dev/vmnet2 c 119 4
vmnet-netifup -d /var/run/ /dev/vmnet2 vmnet2
ifconfig vmnet2 up

Then you can check with ‘ifconfig vmnet2’ or do ‘tcpdump -ni vmnet2’ to make sure vmnet2 has the traffics that you expected

ifconfig vmnet2

Alternatively, you can try using /usr/lib/vmware/bin/vmware-netcfg to configure.

Then edit the .vmx file of your VM host by adding the following line:

ethernet1.connectionType = "custom"
ethernet1.vnet = "/dev/vmnet2"

Note that VMplayer doesn’t provide any interface to change from bridged network port to custom network port, you have to do it manually by modifying the .vmx file.
If your VM is currently running, don’t just restart the OS. You need to quit and start the VMplayer to read the new changes.

After starting the VMplayer, you should see something like this in the settings:
Vmplayer bridge custom vmnet

Click here for more detail description.

If you need to perform promiscuous mode under the VM, then make sure to change the permission in the vmnet port being bridged.

chmod a+rw /dev/vmnet2

(Somehow I have to fiddle the custom port setting between vmnet0 and vmnet2 during the VM is running in order to get the promiscuous mode working)

1 Comment Post a comment
  1. Bilal Al Sabbagh
    Aug 20 2014

    Thank you very much for this post. This was very valuable and useful information.


Leave a Reply

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

You are commenting using your 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

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

%d bloggers like this: