blob: 3cfc56a9aa2cd8a24f51ba0f9fa45133a5e86815 [file] [log] [blame]
.TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
ip-address \- protocol address management
.ad l
.in +8
.ti -8
.B ip
.RI "[ " OPTIONS " ]"
.B address
.RI " { " COMMAND " | "
.BR help " }"
.ti -8
.BR "ip address" " { " add " | " del " } "
.ti -8
.BR "ip address" " { " show " | " flush " } [ " dev
.IR STRING " ] [ "
.B scope
.IR SCOPE-ID " ] [ "
.B to
.IR PREFIX " ] [ " FLAG-LIST " ] [ "
.B label
.ti -8
.B peer
.IR PREFIX " [ "
.B broadcast
.IR ADDR " ] [ "
.B anycast
.IR ADDR " ] [ "
.B label
.IR STRING " ] [ "
.B scope
.ti -8
.IR SCOPE-ID " := "
.RB "[ " host " | " link " | " global " | "
.ti -8
.ti -8
.IR FLAG " := "
.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
tentative " | " deprecated " | " dadfailed " | " temporary " ]"
.B address
is a protocol (IP or IPv6) address attached
to a network device. Each device must have at least one address
to use the corresponding protocol. It is possible to have several
different addresses attached to one device. These addresses are not
discriminated, so that the term
.B alias
is not quite appropriate for them and we do not use it in this document.
.B ip address
command displays addresses and their properties, adds new addresses
and deletes old ones.
.SS ip address add - add new protocol address.
.BI dev " NAME"
the name of the device to add the address to.
.BI local " ADDRESS " (default)
the address of the interface. The format of the address depends
on the protocol. It is a dotted quad for IP and a sequence of
hexadecimal halfwords separated by colons for IPv6. The
may be followed by a slash and a decimal number which encodes
the network prefix length.
.BI peer " ADDRESS"
the address of the remote endpoint for pointopoint interfaces.
Again, the
may be followed by a slash and a decimal number, encoding the network
prefix length. If a peer address is specified, the local address
cannot have a prefix length. The network prefix is associated
with the peer rather than with the local address.
.BI broadcast " ADDRESS"
the broadcast address on the interface.
It is possible to use the special symbols
.B '+'
.B '-'
instead of the broadcast address. In this case, the broadcast address
is derived by setting/resetting the host bits of the interface prefix.
.BI label " NAME"
Each address may be tagged with a label string.
In order to preserve compatibility with Linux-2.0 net aliases,
this string must coincide with the name of the device or must be prefixed
with the device name followed by colon.
.BI scope " SCOPE_VALUE"
the scope of the area where this address is valid.
The available scopes are listed in file
.BR "@SYSCONFDIR@/rt_scopes" .
Predefined scope values are:
.in +8
.B global
- the address is globally valid.
.B site
- (IPv6 only) the address is site local, i.e. it is
valid inside this site.
.B link
- the address is link local, i.e. it is valid only on this device.
.B host
- the address is valid only inside this host.
.in -8
.SS ip address delete - delete protocol address
.B Arguments:
coincide with the arguments of
.B ip addr add.
The device name is a required argument. The rest are optional.
If no arguments are given, the first address is deleted.
.SS ip address show - look at protocol addresses
.BI dev " NAME " (default)
name of device.
.BI scope " SCOPE_VAL"
only list addresses with this scope.
.BI to " PREFIX"
only list addresses matching this prefix.
.BI label " PATTERN"
only list addresses with labels matching the
is a usual shell style pattern.
.B up
only list running interfaces.
.BR dynamic " and " permanent
(IPv6 only) only list addresses installed due to stateless
address configuration or only list permanent (not dynamic)
.B tentative
(IPv6 only) only list addresses which have not yet passed duplicate
address detection.
.B deprecated
(IPv6 only) only list deprecated addresses.
.B dadfailed
(IPv6 only) only list addresses which have failed duplicate
address detection.
.B temporary
(IPv6 only) only list temporary addresses.
.BR primary " and " secondary
only list primary (or secondary) addresses.
.SS ip address flush - flush protocol addresses
This command flushes the protocol addresses selected by some criteria.
This command has the same arguments as
.B show.
The difference is that it does not run when no arguments are given.
.B Warning:
This command (and other
.B flush
commands described below) is pretty dangerous. If you make a mistake,
it will not forgive it, but will cruelly purge all the addresses.
With the
.B -statistics
option, the command becomes verbose. It prints out the number of deleted
addresses and the number of rounds made to flush the address list. If
this option is given twice,
.B ip address flush
also dumps all the deleted addresses in the format described in the
previous subsection.
ip address show dev eth0
.RS 4
Shows the addresses assigned to network interface eth0
ip addr add 2001:0db8:85a3::0370:7334/64 dev eth1
.RS 4
Adds an IPv6 address to network interface eth1
ip addr flush dev eth4
.RS 4
Removes all addresses from device eth4
.BR ip (8)
Original Manpage by Michail Litvak <>