3

I've set up an Ubuntu 14.04 virtual machine with two network adapters.

  • eth0 (bridged adapter) - 192.168.0.105
  • eth1 (NAT) - 10.0.3.15

I have performed ping commands to ensure everything is fine:

ping -I eth0 www.cnn.com
PING turner.map.fastly.net (185.31.17.73) from 192.168.0.105 eth0: 56(84) bytes of data.
64 bytes from 185.31.17.73: icmp_seq=1 ttl=55 time=29.6 ms

ping -I eth1 www.cnn.com
PING turner.map.fastly.net (185.31.17.73) from 10.0.3.15 eth1: 56(84) bytes of data.
From 10.0.3.15 icmp_seq=1 Destination Host Unreachable

Since I would like eth1 to be able to access Internet through the eth0 adapter, I have bridged them based on this Debian tutorial.

Now the command ifconfig shows me the following:

  • br0 - 10.0.3.16
  • eth0 (bridged adapter) - No IP
  • eth1 (NAT) - No IP

I can ping CNN like this:

ping www.cnn.com
PING turner.map.fastly.net (23.235.43.73) from 10.0.3.16 br0: 56(84) bytes of data.
64 bytes from 23.235.43.73: icmp_seq=1 ttl=63 time=26.6 ms

but can't ping with the individual interfaces anymore.

Why does it happen? How can I be sure that I can now indeed access the Internet via eth1?

closed as off-topic by Ron Maupin Oct 9 '16 at 18:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Bridging is layer-2, and all devices on a bridged network assume they are on the same layer-3 (IP) network, but you are using NAT to change the IP addresses of one side of the bridge. You don't NAT on a layer-2 switch; you can NAT on a layer-3 switch, but all addresses on the same VLAN get translated. Layer-2 switch ports don't have IP addresses, only layer-3 interfaces have IP addresses. – Ron Maupin Mar 27 '16 at 10:37
  • Why do you want to do this? As long as the VM can reach the internet (via eth0, as you've shown) then any application on the VM can reach the internet because the kernel routing table will always properly choose eth0 when forwarding internet packets (assuming DHCP or some other mechanism has set up your gateways properly). – Nick Bastin Mar 28 '16 at 15:30
0

bridged adpter in VMWare works as an adapter directly connected to the network. That means it will get IP Address in the range of your NIC IP. If a virtual adapter is configured for NAT then it will get IP Address from internal DHCP of VMWare and the range will be different than the bridged network. You are saying that you have bridged eth0 and eth1. Bridged adapter and NAT adapter can't be bridged(Bridge, Switch are L2 terms). You will have to configure some routing table to connect them.

Bridged Networking

Bridged networking connects a virtual machine to a network by using the network adapter on the host system. If the host system is on a network, bridged networking is often the easiest way to give the virtual machine access to that network. When you install Workstation on a Windows or Linux host system, a bridged network (VMnet0) is set up for you.

NAT Networking

With NAT, a virtual machine does not have its own IP address on the external network. Instead, a separate private network is set up on the host system. In the default configuration, a virtual machine gets an address on this private network from the virtual DHCP server. The virtual machine and the host system share a single network identity that is not visible on the external network. When you install Workstation on a Windows or Linux host system, a NAT network (VMnet8) is set up for you. When you use the New Virtual Machine wizard to create a new virtual machine and select the typical configuration type, the wizard configures the virtual machine to use the default NAT network. You can have only one NAT network.

Host-Only Networking

Host-only networking creates a network that is completely contained within the host computer. Host-only networking provides a network connection between the virtual machine and the host system by using a virtual network adapter that is visible on the host operating system. When you install Workstation on a Windows or Linux host system, a host-only network (VMnet1) is set up for you.

Please check VMWare documentation(chapter 5)

http://pubs.vmware.com/workstation-11/topic/com.vmware.ICbase/PDF/ws11-using.pdf

Not the answer you're looking for? Browse other questions tagged or ask your own question.