0

I want to able to ssh from VM1 to VM2, both VM are connected to a Linux bridge(br0). Below is my topology

VM1(m1)<====SSH====>[br0]<======SSH=====>VM2(m2)

1 Created bridge br0

$ sudo ip link add dev br0 type bridge
$ sudo ip addr add 10.200.1.1/24 dev br0
$ sudo ip link set br0 up
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

2 Specified bridge name while launching VM

enter image description here

veeru@ghost:~$ brctl show
bridge name bridge id       STP enabled interfaces
br0     8000.fe540005c7df   no      vnet0
                            vnet1
docker0     8000.024205ca1927   no      
virbr0      8000.5254003bf832   yes     virbr0-nic

I can see the network is UP in guest VMs and ABLE to ssh from host to guest without any problem.

But when I try to do ssh from VM1(m1) to VM2(m2), VM2 is not reachable. I have checked with tcpdump in VM2(m2) that ssh packet are not reaching from VM1(m1). But I can ping from VM1 to VM2.

Seems like I'm missing some points about linux briding concepts

PS:

I also try to add my wifi interface(wlp0s20f3) to linux bridge, but

sudo ip link set wlp0s20f3 down
sudo ip link set br0 down
sudo brctl addif br0 wlp0s20f3
can't add wlp0s20f3 to bridge br0: Operation not supported

I have not touched iptables in guest as well as host

1 Answer 1

1
 net.bridge.bridge-nf-call-arptables
 net.bridge.bridge-nf-call-ip6tables
 net.bridge.bridge-nf-call-iptables

These control whether or not packets traversing the bridge are sent to iptables for processing. In the case of using bridges to connect virtual machines to the network, generally such processing is not desired, as it results in guest traffic being blocked due to host iptables rules that only account for the host itself, and not for the guests.

So, disable bridge-nf parameters like below. This should work.

sudo sysctl -w net.bridge.bridge-nf-call-arptables=0
sudo sysctl -w net.bridge.bridge-nf-call-ip6tables=0
sudo sysctl -w net.bridge.bridge-nf-call-iptables=0

Can find more info @ libvirt blog and linux foundation blog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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