0

Create two TAP devices, each of which will be read and written by the userland protocol stack. In addition, the two TAP devices are bridged by the Linux Bridge. The script to prepare the environment is as follows.

sudo ip tuntap add dev tap0 mode tap
sudo ip tuntap add dev tap1 mode tap

sudo ip addr add 10.0.0.1/24 dev tap0
sudo ip addr add 10.0.0.2/24 dev tap1

sudo ip link set up tap0
sudo ip link set up tap1

sudo brctl addbr br0
sudo brctl addif br0 tap1
sudo brctl addif br0 tap0
sudo ip link set br0 up

The userland protocol stack has the ability to send and receive ARP. The procedure to generate this problem was as follows.

  1. throw an ARP Request from tap0.
  2. It reaches tap1 via br0 and throws an ARP Reply.
  3. br0 receives the ARP Reply, but it does not reach tap0.

I captured the packets as follows.

vagrant@impish64:~$ sudo tcpdump -i br0 -nv
tcpdump: listening on br0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
13:14:23.103549 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.0.2 tell 10.0.0.1, length 28
13:14:23.104203 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.0.0.2 is-at 3a:2c:25:5b:e1:40, length 28
vagrant@impish64:~$ sudo tcpdump -i tap0 -nv
tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
13:13:40.868761 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.0.2 tell 10.0.0.1, length 28
vagrant@impish64:~$ sudo tcpdump -i tap1 -nv
tcpdump: listening on tap1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
13:12:50.368294 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.0.2 tell 10.0.0.1, length 28
13:12:50.368699 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.0.0.2 is-at 3a:2c:25:5b:e1:40, length 28

The diagram of this problem is as follows.

diagram

Why doesn't the ARP Reply fly to tap0 with this setting?

2
  • check xyproblem.info
    – A.B
    Feb 25, 2022 at 18:13
  • An interface set as bridge port should never receive an IP address. Once set as bridge port, only the bridge self interface (br0) should be allowed to participate in routing. Even without IP address on it it will participate in routing, but addresses on ports cause routing issues. The addresses shouldn't be owned by the system, but only by the "userland protocol stack"s that you forgot to describe.
    – A.B
    Feb 26, 2022 at 8:40

0

You must log in to answer this question.

Browse other questions tagged .