Permanent arp entry not permanent?

i'm using prebuilt images on RB760iGS & newifi3-D2.
i use ip command to make static arp entry, so i can wake my pc from internet.

ip neigh replace 192.168.10.10 dev br-lan lladdr XXXXXXX nud permanent

since openwrt 21, this fails.
permanent arp entry will become "REACHABLE" state after device back online, eg wake up and do a DHCP.

i temporary fixed this by using crontab reset permanent arp entries every 5 minutes.
but i'm looking for a better way.
anybody figure out why permanent arp entry no more permanent?

1 Like

I use the sections network.neighbor[] and network.neighbor6[] in uci but I don't know where they are documented. They have three options interface, ipaddr and mac.

network.@neighbor[0]=neighbor
network.@neighbor[0].interface='lan'
network.@neighbor[0].ipaddr=192.168.10.10'
network.@neighbor[0].mac='XXXXXX'
3 Likes

thanks, this works ostensibly for me (openwrt 21.02.3)
the entry still became "REACHABLE" after a DHCP.
btw, uci set not working, but by editing the config file /etc/config/network produces the entry...
here is the log.

root@OpenWrt:~# uci set network.@neighbor[0]=neighbor

root@OpenWrt:~# uci set network.@neighbor[0].interface='lan'
uci: Invalid argument

root@OpenWrt:~# uci set network.@neighbor[0].ipaddr='192.168.10.10'
uci: Invalid argument

root@OpenWrt:~# uci set network.@neighbor[0].mac='11:11:11:11:11:11'
uci: Invalid argument

i wonder if this is a bug? any help?

The lines I posted are what you'll see with uci show. To add anonymous sections you need to use "add".

# uci add network neighbor
# uci set network.@neighbor[-1].interface='lan'
# uci set network.@neighbor[-1].ipaddr='192.168.10.10'
# uci set network.@neighbor[-1].mac='11:11:11:11:11:11'
1 Like

Thans you for uci tutorial.
but as i mentioned above, perhaps i have to keep using crontab to fix the arp problem.

I had this same issue where after adding the ip neigh replace command to my rc.local I found the NUD state changed after I sent wake on lan packet.

I found this issue was caused by the device I was waking having it's IP set via DHCP. There seems to be some interaction with openwrt dhcp and permanent ARP entries. Changing this machine to have a static IP resolve issue.