logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ip-address.8 (12102B)


  1. .TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
  2. .SH "NAME"
  3. ip-address \- protocol address management
  4. .SH "SYNOPSIS"
  5. .sp
  6. .ad l
  7. .in +8
  8. .ti -8
  9. .B ip
  10. .RI "[ " OPTIONS " ]"
  11. .B address
  12. .RI " { " COMMAND " | "
  13. .BR help " }"
  14. .sp
  15. .ti -8
  16. .BR "ip address" " { " add " | " change " | " replace " } "
  17. .IB IFADDR " dev " IFNAME
  18. .RI "[ " LIFETIME " ] [ " CONFFLAG-LIST " ]"
  19. .ti -8
  20. .BR "ip address del"
  21. .IB IFADDR " dev " IFNAME " [ " mngtmpaddr " ]"
  22. .ti -8
  23. .BR "ip address" " { " save " | " flush " } [ " dev
  24. .IR IFNAME " ] [ "
  25. .B scope
  26. .IR SCOPE-ID " ] [ "
  27. .B metric
  28. .IR METRIC " ] [ "
  29. .B to
  30. .IR PREFIX " ] [ " FLAG-LIST " ] [ "
  31. .B label
  32. .IR PATTERN " ] [ " up " ]"
  33. .ti -8
  34. .BR "ip address" " [ " show " [ " dev
  35. .IR IFNAME " ] [ "
  36. .B scope
  37. .IR SCOPE-ID " ] [ "
  38. .B to
  39. .IR PREFIX " ] [ " FLAG-LIST " ] [ "
  40. .B label
  41. .IR PATTERN " ] [ "
  42. .B master
  43. .IR DEVICE " ] [ "
  44. .B type
  45. .IR TYPE " ] [ "
  46. .B vrf
  47. .IR NAME " ] [ "
  48. .BR up " ] ["
  49. .BR nomaster " ]"
  50. .B proto
  51. .IR ADDRPROTO " ] ]"
  52. .ti -8
  53. .BR "ip address" " { " showdump " | " restore " }"
  54. .ti -8
  55. .IR IFADDR " := " PREFIX " | " ADDR
  56. .B peer
  57. .IR PREFIX " [ "
  58. .B broadcast
  59. .IR ADDR " ] [ "
  60. .B anycast
  61. .IR ADDR " ] [ "
  62. .B label
  63. .IR LABEL " ] [ "
  64. .B scope
  65. .IR SCOPE-ID " ] [ "
  66. .B proto
  67. .IR ADDRPROTO " ]"
  68. .ti -8
  69. .IR SCOPE-ID " := "
  70. .RB "[ " host " | " link " | " global " | "
  71. .IR NUMBER " ]"
  72. .ti -8
  73. .IR ADDRPROTO " := [ "
  74. .IR NAME " | " NUMBER " ]"
  75. .ti -8
  76. .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
  77. .ti -8
  78. .IR FLAG " := ["
  79. .RB [ - ] permanent " |"
  80. .RB [ - ] dynamic " |"
  81. .RB [ - ] secondary " |"
  82. .RB [ - ] primary " |"
  83. .RB [ - ] tentative " |"
  84. .RB [ - ] deprecated " |"
  85. .RB [ - ] dadfailed " |"
  86. .RB [ - ] temporary " |"
  87. .IR CONFFLAG-LIST " ]"
  88. .ti -8
  89. .IR CONFFLAG-LIST " := [ " CONFFLAG-LIST " ] " CONFFLAG
  90. .ti -8
  91. .IR CONFFLAG " := "
  92. .RB "[ " home " | " mngtmpaddr " | " nodad " | " optimistic " | " noprefixroute " | " autojoin " ]"
  93. .ti -8
  94. .IR LIFETIME " := [ "
  95. .BI valid_lft " LFT"
  96. .RB "] [ " preferred_lft
  97. .IR LFT " ]"
  98. .ti -8
  99. .IR LFT " := [ "
  100. .BR forever " |"
  101. .IR SECONDS " ]"
  102. .ti -8
  103. .IR TYPE " := [ "
  104. .BR bridge " | "
  105. .BR bridge_slave " |"
  106. .BR bond " | "
  107. .BR bond_slave " |"
  108. .BR can " | "
  109. .BR dummy " | "
  110. .BR hsr " | "
  111. .BR ifb " | "
  112. .BR ipoib " |"
  113. .BR macvlan " | "
  114. .BR macvtap " | "
  115. .BR vcan " | "
  116. .BR veth " | "
  117. .BR vlan " | "
  118. .BR vxlan " |"
  119. .BR ip6tnl " |"
  120. .BR ipip " |"
  121. .BR sit " |"
  122. .BR gre " |"
  123. .BR gretap " |"
  124. .BR erspan " |"
  125. .BR ip6gre " |"
  126. .BR ip6gretap " |"
  127. .BR ip6erspan " |"
  128. .BR vti " |"
  129. .BR vrf " |"
  130. .BR nlmon " |"
  131. .BR ipvlan " |"
  132. .BR lowpan " |"
  133. .BR geneve " |"
  134. .BR macsec " |"
  135. .BR netkit " ]"
  136. .SH "DESCRIPTION"
  137. The
  138. .B address
  139. is a protocol (IPv4 or IPv6) address attached
  140. to a network device. Each device must have at least one address
  141. to use the corresponding protocol. It is possible to have several
  142. different addresses attached to one device. These addresses are not
  143. discriminated, so that the term
  144. .B alias
  145. is not quite appropriate for them and we do not use it in this document.
  146. .sp
  147. The
  148. .B ip address
  149. command displays addresses and their properties, adds new addresses
  150. and deletes old ones.
  151. .SS ip address add - add new protocol address.
  152. .TP
  153. .BI dev " IFNAME "
  154. the name of the device to add the address to.
  155. .TP
  156. .BI local " ADDRESS " (default)
  157. the address of the interface. The format of the address depends
  158. on the protocol. It is a dotted quad for IP and a sequence of
  159. hexadecimal halfwords separated by colons for IPv6. The
  160. .I ADDRESS
  161. may be followed by a slash and a decimal number which encodes
  162. the network prefix length.
  163. .TP
  164. .BI peer " ADDRESS"
  165. the address of the remote endpoint for pointopoint interfaces.
  166. Again, the
  167. .I ADDRESS
  168. may be followed by a slash and a decimal number, encoding the network
  169. prefix length. If a peer address is specified, the local address
  170. cannot have a prefix length. The network prefix is associated
  171. with the peer rather than with the local address.
  172. .TP
  173. .BI broadcast " ADDRESS"
  174. the broadcast address on the interface.
  175. .sp
  176. It is possible to use the special symbols
  177. .B '+'
  178. and
  179. .B '-'
  180. instead of the broadcast address. In this case, the broadcast address
  181. is derived by setting/resetting the host bits of the interface prefix.
  182. .TP
  183. .BI label " LABEL"
  184. Each address may be tagged with a label string.
  185. The maximum allowed total length of label is 15 characters.
  186. .TP
  187. .BI scope " SCOPE_VALUE"
  188. the scope of the area where this address is valid.
  189. The available scopes are listed in
  190. .BR /share/iproute2/rt_scopes " or " /etc/iproute2/rt_scopes
  191. (has precedence if exists).
  192. Predefined scope values are:
  193. .in +8
  194. .B global
  195. - the address is globally valid.
  196. .sp
  197. .B site
  198. - (IPv6 only, deprecated) the address is site local, i.e. it is
  199. valid inside this site.
  200. .sp
  201. .B link
  202. - the address is link local, i.e. it is valid only on this device.
  203. .sp
  204. .B host
  205. - the address is valid only inside this host.
  206. .in -8
  207. .TP
  208. .BI metric " NUMBER"
  209. priority of prefix route associated with address.
  210. .TP
  211. .BI valid_lft " LFT"
  212. the valid lifetime of this address; see section 5.5.4 of
  213. RFC 4862. When it expires, the address is removed by the kernel.
  214. Defaults to
  215. .BR "forever" .
  216. .TP
  217. .BI preferred_lft " LFT"
  218. the preferred lifetime of this address; see section 5.5.4
  219. of RFC 4862. When it expires, the address is no longer used for new
  220. outgoing connections. Defaults to
  221. .BR "forever" .
  222. .TP
  223. .B home
  224. (IPv6 only) designates this address the "home address" as defined in
  225. RFC 6275.
  226. .TP
  227. .B mngtmpaddr
  228. (IPv6 only) make the kernel manage temporary addresses created from this one as
  229. template on behalf of Privacy Extensions (RFC3041). For this to become active,
  230. the \fBuse_tempaddr\fP sysctl setting has to be set to a value greater than
  231. zero. The given address needs to have a prefix length of 64. This flag allows
  232. to use privacy extensions in a manually configured network, just like if
  233. stateless auto-configuration was active.
  234. .TP
  235. .B nodad
  236. (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
  237. adding this address.
  238. .TP
  239. .B optimistic
  240. (IPv6 only) When performing Duplicate Address Detection, use the RFC 4429
  241. optimistic variant.
  242. .TP
  243. .B noprefixroute
  244. Do not automatically create a route for the network prefix of the added
  245. address, and don't search for one to delete when removing the address. Changing
  246. an address to add this flag will remove the automatically added prefix route,
  247. changing it to remove this flag will create the prefix route automatically.
  248. .TP
  249. .B autojoin
  250. Joining multicast groups on Ethernet level via
  251. .B "ip maddr"
  252. command does not work if connected to an Ethernet switch that does IGMP
  253. snooping since the switch would not replicate multicast packets on ports that
  254. did not have IGMP reports for the multicast addresses.
  255. Linux VXLAN interfaces created via
  256. .B "ip link add vxlan"
  257. have the
  258. .B group
  259. option that enables them to do the required join.
  260. Using the
  261. .B autojoin
  262. flag when adding a multicast address enables similar functionality for
  263. Openvswitch VXLAN interfaces as well as other tunneling mechanisms that need to
  264. receive multicast traffic.
  265. .TP
  266. .BI proto " ADDRPROTO"
  267. the protocol identifier of this route.
  268. .I ADDRPROTO
  269. may be a number or a string from the file
  270. .BR "/etc/iproute2/rt_addrprotos" .
  271. If the protocol ID is not given,
  272. .B ip assumes protocol 0. Several protocol
  273. values have a fixed interpretation. Namely:
  274. .in +8
  275. .B kernel_lo
  276. - The ::1 address that kernel installs on a loopback netdevice has this
  277. protocol value
  278. .sp
  279. .B kernel_ra
  280. - IPv6 addresses installed in response to router advertisement messages
  281. .sp
  282. .B kernel_ll
  283. - Link-local addresses have this protocol value
  284. .sp
  285. .in -8
  286. .sp
  287. The rest of the values are not reserved and the administrator is free
  288. to assign (or not to assign) protocol tags.
  289. .SS ip address delete - delete protocol address
  290. .B Arguments:
  291. coincide with the arguments of
  292. .B ip addr add.
  293. The device name is a required argument. The rest are optional.
  294. If no arguments are given, the first address is deleted.
  295. .SS ip address show - look at protocol addresses
  296. .TP
  297. .BI dev " IFNAME " (default)
  298. name of device.
  299. .TP
  300. .BI scope " SCOPE_VAL"
  301. only list addresses with this scope.
  302. .TP
  303. .BI to " PREFIX"
  304. only list addresses matching this prefix.
  305. .TP
  306. .BI label " PATTERN"
  307. only list addresses with labels matching the
  308. .IR "PATTERN" .
  309. .I PATTERN
  310. is a usual shell style pattern.
  311. .TP
  312. .BI master " DEVICE"
  313. only list interfaces enslaved to this master device.
  314. .TP
  315. .BI vrf " NAME "
  316. only list interfaces enslaved to this vrf.
  317. .TP
  318. .BI type " TYPE"
  319. only list interfaces of the given type.
  320. Note that the type name is not checked against the list of supported types -
  321. instead it is sent as-is to the kernel. Later it is used to filter the returned
  322. interface list by comparing it with the relevant attribute in case the kernel
  323. didn't filter already. Therefore any string is accepted, but may lead to empty
  324. output.
  325. .TP
  326. .B up
  327. only list running interfaces.
  328. .TP
  329. .B nomaster
  330. only list interfaces with no master.
  331. .TP
  332. .BR dynamic " and " permanent
  333. (IPv6 only) only list addresses installed due to stateless
  334. address configuration or only list permanent (not dynamic)
  335. addresses. These two flags are inverses of each other, so
  336. .BR -dynamic " is equal to " permanent " and "
  337. .BR -permanent " is equal to " dynamic .
  338. .TP
  339. .B tentative
  340. (IPv6 only) only list addresses which have not yet passed duplicate
  341. address detection.
  342. .TP
  343. .B -tentative
  344. (IPv6 only) only list addresses which are not in the process of
  345. duplicate address detection currently.
  346. .TP
  347. .B deprecated
  348. (IPv6 only) only list deprecated addresses.
  349. .TP
  350. .B -deprecated
  351. (IPv6 only) only list addresses not being deprecated.
  352. .TP
  353. .B dadfailed
  354. (IPv6 only) only list addresses which have failed duplicate
  355. address detection.
  356. .TP
  357. .B -dadfailed
  358. (IPv6 only) only list addresses which have not failed duplicate
  359. address detection.
  360. .TP
  361. .BR temporary " or " secondary
  362. List temporary IPv6 or secondary IPv4 addresses only. The Linux kernel shares a
  363. single bit for those, so they are actually aliases for each other although the
  364. meaning differs depending on address family.
  365. .TP
  366. .BR -temporary " or " -secondary
  367. These flags are aliases for
  368. .BR primary .
  369. .TP
  370. .B primary
  371. List only primary addresses, in IPv6 exclude temporary ones. This flag is the
  372. inverse of
  373. .BR temporary " and " secondary .
  374. .TP
  375. .B -primary
  376. This is an alias for
  377. .BR temporary " or " secondary .
  378. .TP
  379. .BI proto " ADDRPROTO"
  380. Only show addresses with a given protocol, or those for which the kernel
  381. response did not include protocol. See the corresponding argument to
  382. .B ip addr add
  383. for details about address protocols.
  384. .SS ip address flush - flush protocol addresses
  385. This command flushes the protocol addresses selected by some criteria.
  386. .PP
  387. This command has the same arguments as
  388. .BR show " except that " type " and " master " selectors are not supported."
  389. Another difference is that it does not run when no arguments are given.
  390. .PP
  391. .B Warning:
  392. This command and other
  393. .B flush
  394. commands are unforgiving. They will cruelly purge all the addresses.
  395. .PP
  396. With the
  397. .B -statistics
  398. option, the command becomes verbose. It prints out the number of deleted
  399. addresses and the number of rounds made to flush the address list.
  400. If this option is given twice,
  401. .B ip address flush
  402. also dumps all the deleted addresses in the format described in the
  403. previous subsection.
  404. .SH "EXAMPLES"
  405. .PP
  406. ip address show
  407. .RS 4
  408. Shows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show'
  409. subcommand can be omitted.
  410. .RE
  411. .PP
  412. ip address show up
  413. .RS 4
  414. Same as above except that only addresses assigned to active network interfaces
  415. are shown.
  416. .RE
  417. .PP
  418. ip address show dev eth0
  419. .RS 4
  420. Shows IPv4 and IPv6 addresses assigned to network interface eth0.
  421. .RE
  422. .PP
  423. ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
  424. .RS 4
  425. Adds an IPv6 address to network interface eth1.
  426. .RE
  427. .PP
  428. ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
  429. .RS 4
  430. Delete the IPv6 address added above.
  431. .RE
  432. .PP
  433. ip address flush dev eth4 scope global
  434. .RS 4
  435. Removes all global IPv4 and IPv6 addresses from device eth4. Without 'scope
  436. global' it would remove all addresses including IPv6 link-local ones.
  437. .RE
  438. .SH SEE ALSO
  439. .br
  440. .BR ip (8)
  441. .SH AUTHOR
  442. Original Manpage by Michail Litvak <mci@owl.openwall.com>