Solved

How do I properly bridge a host NIC with a static IP to a guest virtual machine?

Posted on 2007-11-14
9
3,954 Views
Last Modified: 2008-02-01
May I have some assistance to verify that I know how to setup a bridged network correctly:

The host machine is Windows XP running VM Workstation 6 with two NIC installed.
Nic 1 is DHCP dynamic IP for example 72.1.1.100 for regular internet surfing.
Nic 2 is static IP also a different subnet for example 24.1.1.100 to host webserver.

I want a VM guest to use Nic 2 for internet access and webserver will run here.

Seemed straightforward:  Via Start Menu -> Manage Virtual Networks i selected the desired adapter for VMnet0.  Set the guest machine to use VMnet0 in bridge mode.  My understanding is that this makes the NIC available direct to the guest OS, as though it was an installed device.

Thus it would make sense that in the guest OS I enter the same IP, subnet, and gateway that the host NIC is setup with?

The guest OS, CentOS 5, cannot access the internet in this way and cannot initialize its eth0 reporting that the IP configured is already in use.

If that is the correct way to use bridged networking then maybe it is a CentOS configuration issue but as a first step I want to make sure I'm not embarassing myself by having no idea how to setup the bridge to begin with.  Thanks!!

0
Comment
Question by:mgladkowski
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:arrkerr1024
ID: 20284285
You're correct except that vmware does not make the hardware directly available to the guest machine, it just bridges it and you still have a virtual adapter in the guest machine.  Bridging just means that they'll be on the same network, as compared to setting up a private network on which only the guest and host talk and there is no direct communication to the guest from the outside world.

With bridging the guest machine needs it own IP, separate from the one that host machine has.
0
 
LVL 14

Expert Comment

by:arrkerr1024
ID: 20284294
Just to make sure I'm being clear, in bridging the guest gets an IP on the same network as the machine (but NOT THE SAME IP).  With NAT, the guest gets an IP on a private network that the guest and host share.
0
 
LVL 4

Expert Comment

by:sbtec
ID: 20284298
Hi. It is not possible to use the same ip on a VM and on the Host. The bridge-Mode only connects the VM transparently to the Network, lit it where a standalone machine, physically connected. And so, like a physical machine, it needs to have a own IP. The other Method is to NAT the Networt to the VM. In this constellation, the Host is likae a Router for the VM and the VM can hav a own IP, that is different to the subnet used by the host. The host now translates the Network-traffic for the VM.
I think. normally the best way is to bridge the VM-Network an to give either a fixed IP to the VM or just leave it on DHCP, so the VM can request a dynamic IP.

Greetz from switzerland.
0
 

Author Comment

by:mgladkowski
ID: 20284515
Thanks guys !!  That makes perfect sense.  Helps if I properly understand what a bridge is :)  Since my ISP provided the static IP I do not believe I can simply choose another IP on that subnet for my VM.  So it looks like NAT is the answer.

I checked NAT settings and VM can do port forwarding for me but how can I ensure the VMnet8 (NAT) is using the specific physical NIC / gateway I want it to use?  Can I set this from in VMWare / Windows or will I have to install a virtual router or some kind?

Getting there piece by piece ... thank you!!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Accepted Solution

by:
sbtec earned 500 total points
ID: 20284594
NAT will froward all request to your Host and it will route the packets in both directions. So it is not necessary to define a specific adapter because the connections are independent of any hardware. The IP Packets are being routed like the routing on yours Host is defined. For Exemple: If you connect to Internet using NIC 1 and connect to a private network using NIC 2, your physical Host automatically will route the traffic to the interner or to the LAN. The VM uses the same routing as the Host, so you can use the full possibilities from your host. Greetz, Stibe.
0
 

Author Comment

by:mgladkowski
ID: 20285059
Yay got it running ... from the external internet the apache server in the VM is visible.  NAT is mapping port 80 but from both my host IPs, meaning locally I can few the website via the dynamic IP and the static IP, but the firewall allows http to the static IP address which is where a-records will point so it looks like I'm all set.  You are right utilization of the correct NIC takes place automatically.  Simple but my first time doing this so I really appreciate the help! Cheers!
0
 
LVL 14

Expert Comment

by:arrkerr1024
ID: 20289052
I guess he solved your problem, but I think I answered the question asked.
0
 

Author Comment

by:mgladkowski
ID: 20289277
Hi arrkerr ... I know you both replied really fast and that actually left me uncertain for a bit which comment to mark accepted.  (Yes I'm saying experts exchange worked too well)  You replied first but he gave me a little more detail that ultimately got me running and very quickly.  In hindsight I should have at least split the points because you did respond correctly and first, but it is a result of the later discussion that got full resolution, so that's where my mind was when I marked a comment accepted.  It was not deliberate rudeness, so I apologize very sincerely for any that was percieved. I will make sure I avail of Multiple answers next time this happens.  I feel bad now but in the future will be more careful.  This assumes I cannot edit the selection once submitted.  Cheers ...
0
 

Expert Comment

by:gias_ctg
ID: 23261733
My Host is windows XP and the guest machine (On VMWARE) is windows 2003 std edition. I am able to ping the guest IP from the host. and from the guest machine i am able to ping/acess everywhere in my network. But the issue is from any other machine in my network i am not able to access/ping the guest machine. i am using bridged network for the VM.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now