lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | .TH IP\-NEIGHBOUR 8 "20 Dec 2011" "iproute2" "Linux" |
| 2 | .SH "NAME" |
| 3 | ip-neighbour \- neighbour/arp tables management. |
| 4 | .SH "SYNOPSIS" |
| 5 | .sp |
| 6 | .ad l |
| 7 | .in +8 |
| 8 | .ti -8 |
| 9 | .B ip |
| 10 | .RI "[ " OPTIONS " ]" |
| 11 | .B neigh |
| 12 | .RI " { " COMMAND " | " |
| 13 | .BR help " }" |
| 14 | .sp |
| 15 | |
| 16 | .ti -8 |
| 17 | .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { " |
| 18 | .IR ADDR " [ " |
| 19 | .B lladdr |
| 20 | .IR LLADDR " ] [ " |
| 21 | .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy |
| 22 | .IR ADDR " } [ " |
| 23 | .B dev |
| 24 | .IR DEV " ]" |
| 25 | |
| 26 | .ti -8 |
| 27 | .BR "ip neigh" " { " show " | " flush " } [ " proxy " ] [ " to |
| 28 | .IR PREFIX " ] [ " |
| 29 | .B dev |
| 30 | .IR DEV " ] [ " |
| 31 | .B nud |
| 32 | .IR STATE " ]" |
| 33 | |
| 34 | |
| 35 | .SH DESCRIPTION |
| 36 | The |
| 37 | .B ip neigh |
| 38 | command manipulates |
| 39 | .I neighbour |
| 40 | objects that establish bindings between protocol addresses and |
| 41 | link layer addresses for hosts sharing the same link. |
| 42 | Neighbour entries are organized into tables. The IPv4 neighbour table |
| 43 | is known by another name - the ARP table. |
| 44 | |
| 45 | .P |
| 46 | The corresponding commands display neighbour bindings |
| 47 | and their properties, add new neighbour entries and delete old ones. |
| 48 | |
| 49 | .SS ip neighbour add - add a new neighbour entry |
| 50 | .SS ip neighbour change - change an existing entry |
| 51 | .SS ip neighbour replace - add a new entry or change an existing one |
| 52 | |
| 53 | These commands create new neighbour records or update existing ones. |
| 54 | |
| 55 | .TP |
| 56 | .BI to " ADDRESS " (default) |
| 57 | the protocol address of the neighbour. It is either an IPv4 or IPv6 address. |
| 58 | |
| 59 | .TP |
| 60 | .BI dev " NAME" |
| 61 | the interface to which this neighbour is attached. |
| 62 | |
| 63 | .TP |
| 64 | .BI lladdr " LLADDRESS" |
| 65 | the link layer address of the neighbour. |
| 66 | .I LLADDRESS |
| 67 | can also be |
| 68 | .BR "null" . |
| 69 | |
| 70 | .TP |
| 71 | .BI nud " NUD_STATE" |
| 72 | the state of the neighbour entry. |
| 73 | .B nud |
| 74 | is an abbreviation for 'Neighbour Unreachability Detection'. |
| 75 | The state can take one of the following values: |
| 76 | |
| 77 | .in +8 |
| 78 | .B permanent |
| 79 | - the neighbour entry is valid forever and can be only |
| 80 | be removed administratively. |
| 81 | .sp |
| 82 | |
| 83 | .B noarp |
| 84 | - the neighbour entry is valid. No attempts to validate |
| 85 | this entry will be made but it can be removed when its lifetime expires. |
| 86 | .sp |
| 87 | |
| 88 | .B reachable |
| 89 | - the neighbour entry is valid until the reachability |
| 90 | timeout expires. |
| 91 | .sp |
| 92 | |
| 93 | .B stale |
| 94 | - the neighbour entry is valid but suspicious. |
| 95 | This option to |
| 96 | .B ip neigh |
| 97 | does not change the neighbour state if it was valid and the address |
| 98 | is not changed by this command. |
| 99 | .in -8 |
| 100 | |
| 101 | .SS ip neighbour delete - delete a neighbour entry |
| 102 | This command invalidates a neighbour entry. |
| 103 | |
| 104 | .PP |
| 105 | The arguments are the same as with |
| 106 | .BR "ip neigh add" , |
| 107 | except that |
| 108 | .B lladdr |
| 109 | and |
| 110 | .B nud |
| 111 | are ignored. |
| 112 | |
| 113 | .PP |
| 114 | .B Warning: |
| 115 | Attempts to delete or manually change a |
| 116 | .B noarp |
| 117 | entry created by the kernel may result in unpredictable behaviour. |
| 118 | Particularly, the kernel may try to resolve this address even |
| 119 | on a |
| 120 | .B NOARP |
| 121 | interface or if the address is multicast or broadcast. |
| 122 | |
| 123 | .SS ip neighbour show - list neighbour entries |
| 124 | |
| 125 | This commands displays neighbour tables. |
| 126 | |
| 127 | .TP |
| 128 | .BI to " ADDRESS " (default) |
| 129 | the prefix selecting the neighbours to list. |
| 130 | |
| 131 | .TP |
| 132 | .BI dev " NAME" |
| 133 | only list the neighbours attached to this device. |
| 134 | |
| 135 | .TP |
| 136 | .BI proxy |
| 137 | list neighbour proxies. |
| 138 | |
| 139 | .TP |
| 140 | .B unused |
| 141 | only list neighbours which are not currently in use. |
| 142 | |
| 143 | .TP |
| 144 | .BI nud " NUD_STATE" |
| 145 | only list neighbour entries in this state. |
| 146 | .I NUD_STATE |
| 147 | takes values listed below or the special value |
| 148 | .B all |
| 149 | which means all states. This option may occur more than once. |
| 150 | If this option is absent, |
| 151 | .B ip |
| 152 | lists all entries except for |
| 153 | .B none |
| 154 | and |
| 155 | .BR "noarp" . |
| 156 | |
| 157 | .SS ip neighbour flush - flush neighbour entries |
| 158 | This command flushes neighbour tables, selecting |
| 159 | entries to flush by some criteria. |
| 160 | |
| 161 | .PP |
| 162 | This command has the same arguments as |
| 163 | .B show. |
| 164 | The differences are that it does not run when no arguments are given, |
| 165 | and that the default neighbour states to be flushed do not include |
| 166 | .B permanent |
| 167 | and |
| 168 | .BR "noarp" . |
| 169 | |
| 170 | .PP |
| 171 | With the |
| 172 | .B -statistics |
| 173 | option, the command becomes verbose. It prints out the number of |
| 174 | deleted neighbours and the number of rounds made to flush the |
| 175 | neighbour table. If the option is given |
| 176 | twice, |
| 177 | .B ip neigh flush |
| 178 | also dumps all the deleted neighbours. |
| 179 | |
| 180 | .SH EXAMPLES |
| 181 | .PP |
| 182 | ip neighbour |
| 183 | .RS |
| 184 | Shows the current neighbour table in kernel. |
| 185 | .RE |
| 186 | .PP |
| 187 | ip neigh flush dev eth0 |
| 188 | .RS |
| 189 | Removes entries in the neighbour table on device eth0. |
| 190 | .RE |
| 191 | |
| 192 | .SH SEE ALSO |
| 193 | .br |
| 194 | .BR ip (8) |
| 195 | |
| 196 | .SH AUTHOR |
| 197 | Original Manpage by Michail Litvak <mci@owl.openwall.com> |