ARP add manually

I am trying to add a static entry in the arp table of the router using openwrt.

root@OpenWrt:~# opkg install net-tools-arp
Unknown package 'net-tools-arp'.
Collected errors:
 * opkg_install_cmd: Cannot install package net-tools-arp.

Are there any other ways to do it?

So the main aim of the arp entry is to have a fake ip and mac in the arp table of the router.
Static routes will not help me in this case I guess.

https://openwrt.org/docs/guide-developer/networking/network.interfaces#old_and_deprecated_utilities_for_networking_and_traffic_control

2 Likes

According to this link arp-s command should work like this.

arp -s address hw_addr is used to set up a new table entry. The format of the hw_addr parameter is dependent on the hardware class, but for most classes one can assume that the usual presentation can be used. For the Ethernet class, this is 6 bytes in hexadecimal, separated by colons. When adding proxy arp entries (that is those with the pub lish flag set) a netmask may be specified to proxy arp for entire subnets. This is not good practice, but is supported by older kernels because it can be useful. If the temp flag is not supplied entries will be permanent stored into the ARP cache. To simplify setting up entries for one of your own network interfaces, you can use the arp −Ds address ifname form. In that case the hardware address is taken from the interface with the specified name.

root@OpenWrt:~# arp -s 192.168.0.65 aa:bb:cc:dd:ee:ff
IP address       HW type     Flags       HW address            Mask     Device
192.168.0.29     0x1         0x2         5c:ea:1d:37:9d:23     *        eth0.2
192.168.0.1      0x1         0x2         60:19:71:e3:bb:17     *        eth0.2
 192.168.1.132    0x1         0x2         10:e7:c6:ea:73:18     *        br-lan
 root@OpenWrt:~# arp -n
 IP address       HW type     Flags       HW address            Mask     Device
192.168.0.29     0x1         0x2         5c:ea:1d:37:9d:23     *        eth0.2
192.168.0.1      0x1         0x2         60:19:71:e3:bb:17     *        eth0.2
 192.168.1.132    0x1         0x2         10:e7:c6:ea:73:18     *        br-lan

root@OpenWrt:~#

However using this it doesnt add up the new arp entry.

arp is deprecated, use ip neigh instead:

opkg update; opkg install ip-tiny

https://man.cx/ip-neighbour

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.