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,963 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Surfing Is Meant To Be Done Outdoors

Featuring its rugged IP67 compliant exterior and delivering broad, fast, and reliable Wi-Fi coverage, the AP322 is the ideal solution for the outdoors. Manage this AP with either a Firebox as a gateway controller, or with the Wi-Fi Cloud for an expanded set of management features

 

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
 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

726 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