Vmware host on lxdbr0 bridge

Hello all

I have created a custom vmware network interface bridged to lxdbr0.
However, when I boot up my vmware vm connected to lxdbr0 bridge, it cannot connect to my samba server located in lxdbr0.

Any suggestions? Thanks in advance.

Hi,

Does your vmware vm get an IP address on the same subnet as lxdbr0?

Thanks
Tom

Yes, the vmware guest machines gets the IP address from lxdbr0 dnsmasq process.

@abcdef does ping work between vm and containers?

Ping works if it is done by IP address by host name, no.
Same thing with tracecert/tracepath.

@abcdef OK so it might be a DNS problem.

Please can you show the ping command you are running plus the output.

Please can you also show the DNS settings for your VM?

Is your samba server a container or running on the host?

Do you have any other containers running on the same host, and can they ping the samba server by name?

Thanks
Tom

The nslookup query, ping (domain name & IP) to the samba server output are as shown below. The samba server is running on the container and the dns servers are provided by the bridge’s dnsmasq service.

C:\Users\vmusr>nslookup hostsvr
Server:  UnKnown
Address:  10.0.12.1

Name:    hostsvr
Addresses:  fd42:3456:7890:b34c:216:3eff:fee0:61f9
          10.0.12.2


C:\Users\vmusr>ping hostsvr
Ping request could not find host hostsvr. Please check the name and try again.

C:\Users\vmusr>ping 10.0.12.2

Pinging 10.0.12.2 with 32 bytes of data:
Reply from 10.0.12.2: bytes=32 time<1ms TTL=64
Reply from 10.0.12.2: bytes=32 time<1ms TTL=64
Reply from 10.0.12.2: bytes=32 time<1ms TTL=64
Reply from 10.0.12.2: bytes=32 time<1ms TTL=64

Ping statistics for 10.0.12.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\vmusr>

I have another container running on the same bridge (subnet) and they can ping each other using hostname and the other container also has no problem connecting to hostsvr (samba server) using smbclient.

Regardless of OS (be it Linux or Windows), as long as it is on vmware and these VMs connect to lxdbr0 via vmnet11, there isn’t an option to connect them directly to lxdbr0 bridge.

screenshot-a

Try doing ping hostsrv.lxd ?

Looks to me like some issue with using short names.

Also, can you paste output of ipconfig /all

Same result as with ping hostsvr

Result of ethernet iface from ipconfig /all
Windows IP Configuration

   Host Name . . . . . . . . . . . . : DESKTOP-FA1917
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
   Physical Address. . . . . . . . . : 10-65-30-28-2B-52
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 10.0.12.43(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Friday, July 19, 2019 1:40:04 AM
   Lease Expires . . . . . . . . . . : Friday, July 19, 2019 3:15:35 AM
   Default Gateway . . . . . . . . . : 10.0.12.1
   DHCP Server . . . . . . . . . . . : 10.0.12.1
   DNS Servers . . . . . . . . . . . : 10.0.12.1
   Primary WINS Server . . . . . . . : 10.0.12.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Hi @abcdef I took a look at your PCAP, it shows some weird TCP issues, suggesting a network problem between vmware and the LXD bridge. This would explain why DNS doesn’t work either, but strangely ICMP does work.

Are you able to try another virtualisation system, such as VirtualBox connected to the LXD bridge and see if that resolves it, as it may be a VMware specific issue.

Thanks
Tom

Also take a look at https://linux-blog.anracom.com/2016/02/02/fun-with-veth-devices-linux-virtual-bridges-kvm-vmware-attach-the-host-and-connect-bridges-via-veth/ as it seems relevant, you may need to setup a veth pair between lxdbr0 and your VM, which you then connect your VM to.

I have managed to make it work by following the link you have sent and https://blogs.igalia.com/dpino/2016/04/10/network-namespaces/ with some modifications.

For the benefit of other users I will post my config/commands below:

BRIDGE_NAME=lxdbr0
sudo ip netns del ns-$BRIDGE_NAME &>/dev/null
sudo ip netns add ns-$BRIDGE_NAME
sudo ip link add ve-$BRIDGE_NAME type veth peer name ve-vhost
sudo ip link set ve-vhost netns ns-$BRIDGE_NAME
sudo brctl addif $BRIDGE_NAME ve-$BRIDGE_NAME
sudo ip link set ve-$BRIDGE_NAME up
sudo ip netns exec ns-$BRIDGE_NAME ip link set ve-vhost up

On vmware-netcfg, just change the bridged interface (for my case i.e. vmnet11) “Bridged to:” dropdown menu from lxdbr0 to ve-lxdbr0. Notice the ve-vhost is up but not connected to any device.

Output from ip link:

42: ve-lxdbr0@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netns ns-lxdbr0

@abcdef Nice! I’m intrigued why you couldn’t connect your VM to the ve-vhost interface and why that needed to be in a separate namespace though.

Beats me too. I tried the method at anracom.com blog post above which doesn’t need to create namespace and bridge vmnet11 to peer veth iface i.e. ve-vhost, it works but the vmware couldn’t connect to any instance outside the bridge’s subnet, and dns doesn’t work too.

I did a search and found out about network namespace on Scott’s Webblog https://blog.scottlowe.org/2013/09/04/introducing-linux-network-namespaces/. So more searches and I managed to come out the method as above. It’s try and error method and till now I still have no idea why this method works, logically. Possibly due to the weird implementation of vmnet module.