Recently I had to configure a virtual machine with two virtual network cards for testing purposes. One of them connects to a private virtual LAN. Another is bridged to the physical NIC card on the host and is connected to the physical LAN which is connected to the INTERNET. first I couldn get to http://www.google.com/ for example. It turned out that IE is not using the NIC that is connected to the INTERNET. How can this happen? Let me explain what I found and how I fixed it.
virtual machine runs windows 2003 server. You can try command print to show the routing table on the machine.
routing table shows two default routes with network destination of 0.0.0.0 and network mask of 0.0.0.0. Both of them have Metric of 10. I am not sure what algorithm my win2k server is using. But it seems to always pick the default route which uses the private LAN to get to http://www.google.com/ or any other external IP addresses on the INTERNET.
did the following to fix it:
the default routes using delete 0.0.0.0
the new default route using the bridged network.
-p add 0.0.0.0 mask 0.0.0.0 your default gateway here Metric 5 IF your network interface card ID here -p option to make the route persistent across reboot. I chose Metric 5 to make sure that if the default route using the virtual LAN was added back, this route has higher priority.
find out which interface uses the bridged network, check the ip address associated with the virtual network. Match the MAC address with the ones displayed in print would be easier to delete just the default route that uses the virtual LAN. But I can figure out a way to do that using this command. Do you know a better way?
guess the problem and solution is not limited to virtual machine. And there may be other solutions. Your suggestions and comments are welcome.