Forrest logo
back to the ip tool

ip-neighbour:tldr:ac441

ip-neighbour: Add or delete an ARP entry for the neighbour IP address to `eth0`.
$ sudo ip neighbour ${select} ${ip_address} lladdr ${mac_address} dev ${eth0} nud reachable
try on your machine

This command is used in a Linux terminal with sudo (Super User Do) privileges to add or modify an entry in the ARP (Address Resolution Protocol) cache on a network interface.

Here's a breakdown of the command:

  • sudo: This command gives the user temporary administrative/root privileges to execute the following command.

  • ip neighbour: This is the main command that interacts with the ARP cache. It allows you to manage entries related to IP addresses and link-layer (MAC) addresses.

  • ${select}: This is a placeholder for a specific action you want to perform on the ARP cache. It can be one of the following options:

    • add: Add a new entry to the ARP cache.
    • change: Modify an existing entry in the ARP cache.
    • del: Delete an entry from the ARP cache.
  • ${ip_address}: This is a placeholder for the IP address for which you want to add or modify an entry in the ARP cache.

  • lladdr ${mac_address}: This sets the MAC address associated with the IP address specified in ${ip_address}. The ${mac_address} placeholder should be replaced with the actual MAC address.

  • dev ${eth0}: This specifies the network interface (device) on which you want to add or modify the ARP cache entry. The ${eth0} placeholder should be replaced with the appropriate network interface, such as eth0 or wlan0.

  • nud reachable: This sets the Neighbour Unreachability Detection (NUD) state of the ARP cache entry to reachable. NUD is a mechanism that periodically checks the reachability of an IP address by sending ARP requests. Setting it to reachable ensures that the cache entry remains valid and up-to-date.

By executing this command with the appropriate values filled in for the placeholders, you can manage the ARP cache for a specific IP address and register its associated MAC address with a particular network interface.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ip tool