route2 anyip fails when not in local table

0

1

I want to respond to ping and TFTP requests on any IP address on an openwrt router. The intention is that it can respond to uboot firmware download requests on various addresses (for different devices).

I have proved that this works using the anyip trick if I add it as shown to table local

However I want to make this only work on a wired interface, and not wlan0. The kernel anyip commit for IPv6 suggests this is possible.

I have implemented the ip rule accordingly using:

ip -4 rule add from all iif br-lan lookup 100

By adding in dummy routing rules here I have convinced myself this part works.

I then add the following as a test:

ip route add local 192.168.1.1 dev lo table 100

At this point ping requests that were being forwarded to the real 192.168.1.1 stop responding so something changes.

Using tcpdump ip proto \\icmp on my router I see the ping requests still arriving, but no longer being responded to.

If I run:

ip route add local 192.168.1.1 dev lo table local

Then ping starts working again. Is there a reason that anyip doesn't work on tables other than local or am I doing something wrong?

Leo

Posted 2019-11-25T10:15:54.997

Reputation: 1

No answers