• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3971
  • Last Modified:

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

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
mgladkowski
Asked:
mgladkowski
  • 3
  • 3
  • 2
  • +1
1 Solution
 
arrkerr1024Commented:
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
 
arrkerr1024Commented:
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
 
sbtecCommented:
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
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
mgladkowskiAuthor Commented:
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
 
sbtecCommented:
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
 
mgladkowskiAuthor Commented:
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
 
arrkerr1024Commented:
I guess he solved your problem, but I think I answered the question asked.
0
 
mgladkowskiAuthor Commented:
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
 
gias_ctgCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now