I am trying to understand the linux bridging and local ip rules,
I have following topology on my linux laptop.
Code:
br0
___________|__________
| |
|tap0 tap1|
|________Application_______|
The application above is creating 2 tap interfaces tap0 and tap1
I create the bridge and plug the tap interfaces to the bridge:
Code:
brctl addif br0 tap0
brctl addif br0 tap1
For ping to work, i need to add ip address to the interfaces,
So I add `192.168.13.1 to tap0` and `192.168.13.2 to tap1`
The application reads from one interface and writes to another interface, for both the interfaces.
Now if I run "ping 192.168.13.2 -I tap0"
Code:
PING 192.168.13.2 (192.168.13.2) from 192.168.13.1 tap0: 56(84) bytes of data.
From 192.168.13.1 icmp_seq=1 Destination Host Unreachable
tcpdump was showing arp could not be resolved, so I added static ARP entries:
Code:
arp -i tap0 -s 192.168.13.1 62:34:58:e7:8a:3a
arp -i tap1 -s 192.168.13.2 4a:6d:fa:51:7d:2d
brctl showmacs br0
port no mac addr is local? ageing timer
2 4a:6d:fa:51:7d:2d yes 0.00
2 4a:6d:fa:51:7d:2d yes 0.00
1 62:34:58:e7:8a:3a yes 0.00
1 62:34:58:e7:8a:3a yes 0.00
The bridge also seems to have learnt the MAC addresses.
However, the application and the tcpdump still receive 42 bytes packets
showing ARP packets not resolved yet, and ping give Host unreachable mesg.
My current routing table is:
Code:
ip route ls table main
169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown
192.168.13.0/24 dev tap1 proto kernel scope link src 192.168.13.2
192.168.13.0/24 dev tap0 proto kernel scope link src 192.168.13.1
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
My current local routing table:
Code:
broadcast 192.168.13.0 dev tap1 proto kernel scope link src 192.168.13.2
broadcast 192.168.13.0 dev tap0 proto kernel scope link src 192.168.13.1
local 192.168.13.1 dev tap0 proto kernel scope host src 192.168.13.1
local 192.168.13.2 dev tap1 proto kernel scope host src 192.168.13.2
broadcast 192.168.13.255 dev tap1 proto kernel scope link src 192.168.13.2
broadcast 192.168.13.255 dev tap0 proto kernel scope link src 192.168.13.1
I am having a feel that routing might not come into picture here: since this is a layer 2 broadcast domain. But since I am not well versed with linux bridging, I need some advice to proceed.
How can we make the ping work between tap0 and tap1.
Thanks
Nayan