Blame man/man8/ip-address.8.in

Packit Service 3880ab
.TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
Packit Service 3880ab
.SH "NAME"
Packit Service 3880ab
ip-address \- protocol address management
Packit Service 3880ab
.SH "SYNOPSIS"
Packit Service 3880ab
.sp
Packit Service 3880ab
.ad l
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RI "[ " OPTIONS " ]"
Packit Service 3880ab
.B address
Packit Service 3880ab
.RI " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip address" " { " add " | " change " | " replace " } "
Packit Service 3880ab
.IB IFADDR " dev " IFNAME
Packit Service 3880ab
.RI "[ " LIFETIME " ] [ " CONFFLAG-LIST " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip address del"
Packit Service 3880ab
.IB IFADDR " dev " IFNAME " [ " mngtmpaddr " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip address" " { " save " | " flush " } [ " dev
Packit Service 3880ab
.IR IFNAME " ] [ "
Packit Service 3880ab
.B  scope
Packit Service 3880ab
.IR SCOPE-ID " ] [ "
Packit Service 3880ab
.B  metric
Packit Service 3880ab
.IR METRIC " ] [ "
Packit Service 3880ab
.B  to
Packit Service 3880ab
.IR PREFIX " ] [ " FLAG-LIST " ] [ "
Packit Service 3880ab
.B  label
Packit Service 3880ab
.IR PATTERN " ] [ " up " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip address" " [ " show  " [ " dev
Packit Service 3880ab
.IR IFNAME " ] [ "
Packit Service 3880ab
.B  scope
Packit Service 3880ab
.IR SCOPE-ID " ] [ "
Packit Service 3880ab
.B  to
Packit Service 3880ab
.IR PREFIX " ] [ " FLAG-LIST " ] [ "
Packit Service 3880ab
.B  label
Packit Service 3880ab
.IR PATTERN " ] [ "
Packit Service 3880ab
.B  master
Packit Service 3880ab
.IR DEVICE " ] [ "
Packit Service 3880ab
.B  type
Packit Service 3880ab
.IR TYPE " ] [ "
Packit Service 3880ab
.B vrf
Packit Service 3880ab
.IR NAME " ] [ "
Packit Service 3880ab
.BR up " ] ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip address" " { " showdump " | " restore " }"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR IFADDR " := " PREFIX " | " ADDR
Packit Service 3880ab
.B  peer
Packit Service 3880ab
.IR PREFIX " [ "
Packit Service 3880ab
.B  broadcast
Packit Service 3880ab
.IR ADDR " ] [ "
Packit Service 3880ab
.B  anycast
Packit Service 3880ab
.IR ADDR " ] [ "
Packit Service 3880ab
.B  label
Packit Service 3880ab
.IR LABEL " ] [ "
Packit Service 3880ab
.B  scope
Packit Service 3880ab
.IR SCOPE-ID " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR SCOPE-ID " := "
Packit Service 3880ab
.RB "[ " host " | " link " | " global " | "
Packit Service 3880ab
.IR NUMBER " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR FLAG-LIST " := [ "  FLAG-LIST " ] " FLAG
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR FLAG " := ["
Packit Service 3880ab
.RB [ - ] permanent " |"
Packit Service 3880ab
.RB [ - ] dynamic " |"
Packit Service 3880ab
.RB [ - ] secondary " |"
Packit Service 3880ab
.RB [ - ] primary " |"
Packit Service 3880ab
.RB [ - ] tentative " |"
Packit Service 3880ab
.RB [ - ] deprecated " |"
Packit Service 3880ab
.RB [ - ] dadfailed " |"
Packit Service 3880ab
.RB [ - ] temporary " |"
Packit Service 3880ab
.IR CONFFLAG-LIST " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR CONFFLAG-LIST " := [ "  CONFFLAG-LIST " ] " CONFFLAG
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR CONFFLAG " := "
Packit Service 3880ab
.RB "[ " home " | " mngtmpaddr " | " nodad " | " optimstic " | " noprefixroute " | " autojoin " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR LIFETIME " := [ "
Packit Service 3880ab
.BI valid_lft " LFT"
Packit Service 3880ab
.RB "] [ " preferred_lft
Packit Service 3880ab
.IR  LFT " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR LFT " := [ "
Packit Service 3880ab
.BR forever " |"
Packit Service 3880ab
.IR SECONDS " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR TYPE " := [ "
Packit Service 3880ab
.BR bridge " | "
Packit Service 3880ab
.BR bridge_slave " |"
Packit Service 3880ab
.BR bond " | "
Packit Service 3880ab
.BR bond_slave " |"
Packit Service 3880ab
.BR can " | "
Packit Service 3880ab
.BR dummy " | "
Packit Service 3880ab
.BR hsr " | "
Packit Service 3880ab
.BR ifb " | "
Packit Service 3880ab
.BR ipoib " |"
Packit Service 3880ab
.BR macvlan  " | "
Packit Service 3880ab
.BR macvtap  " | "
Packit Service 3880ab
.BR vcan " | "
Packit Service 3880ab
.BR veth " | "
Packit Service 3880ab
.BR vlan " | "
Packit Service 3880ab
.BR vxlan " |"
Packit Service 3880ab
.BR ip6tnl " |"
Packit Service 3880ab
.BR ipip " |"
Packit Service 3880ab
.BR sit " |"
Packit Service 3880ab
.BR gre " |"
Packit Service 3880ab
.BR gretap " |"
Packit Service 3880ab
.BR erspan " |"
Packit Service 3880ab
.BR ip6gre " |"
Packit Service 3880ab
.BR ip6gretap " |"
Packit Service 3880ab
.BR ip6erspan " |"
Packit Service 3880ab
.BR vti " |"
Packit Service 3880ab
.BR vrf " |"
Packit Service 3880ab
.BR nlmon " |"
Packit Service 3880ab
.BR ipvlan " |"
Packit Service 3880ab
.BR lowpan " |"
Packit Service 3880ab
.BR geneve " |"
Packit Service 3880ab
.BR macsec " ]"
Packit Service 3880ab
Packit Service 3880ab
.SH "DESCRIPTION"
Packit Service 3880ab
The
Packit Service 3880ab
.B address
Packit Service 3880ab
is a protocol (IPv4 or IPv6) address attached
Packit Service 3880ab
to a network device. Each device must have at least one address
Packit Service 3880ab
to use the corresponding protocol. It is possible to have several
Packit Service 3880ab
different addresses attached to one device. These addresses are not
Packit Service 3880ab
discriminated, so that the term
Packit Service 3880ab
.B alias
Packit Service 3880ab
is not quite appropriate for them and we do not use it in this document.
Packit Service 3880ab
.sp
Packit Service 3880ab
The
Packit Service 3880ab
.B ip address
Packit Service 3880ab
command displays addresses and their properties, adds new addresses
Packit Service 3880ab
and deletes old ones.
Packit Service 3880ab
Packit Service 3880ab
.SS ip address add - add new protocol address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dev " IFNAME "
Packit Service 3880ab
the name of the device to add the address to.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI local " ADDRESS " (default)
Packit Service 3880ab
the address of the interface. The format of the address depends
Packit Service 3880ab
on the protocol. It is a dotted quad for IP and a sequence of
Packit Service 3880ab
hexadecimal halfwords separated by colons for IPv6. The
Packit Service 3880ab
.I ADDRESS
Packit Service 3880ab
may be followed by a slash and a decimal number which encodes
Packit Service 3880ab
the network prefix length.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI peer " ADDRESS"
Packit Service 3880ab
the address of the remote endpoint for pointopoint interfaces.
Packit Service 3880ab
Again, the
Packit Service 3880ab
.I ADDRESS
Packit Service 3880ab
may be followed by a slash and a decimal number, encoding the network
Packit Service 3880ab
prefix length. If a peer address is specified, the local address
Packit Service 3880ab
cannot have a prefix length. The network prefix is associated
Packit Service 3880ab
with the peer rather than with the local address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI broadcast " ADDRESS"
Packit Service 3880ab
the broadcast address on the interface.
Packit Service 3880ab
.sp
Packit Service 3880ab
It is possible to use the special symbols
Packit Service 3880ab
.B '+'
Packit Service 3880ab
and
Packit Service 3880ab
.B '-'
Packit Service 3880ab
instead of the broadcast address. In this case, the broadcast address
Packit Service 3880ab
is derived by setting/resetting the host bits of the interface prefix.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI label " LABEL"
Packit Service 3880ab
Each address may be tagged with a label string.
Packit Service 3880ab
In order to preserve compatibility with Linux-2.0 net aliases,
Packit Service 3880ab
this string must coincide with the name of the device or must be prefixed
Packit Service 3880ab
with the device name followed by colon.
Packit Service 3880ab
The maximum allowed total length of label is 15 characters.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI scope " SCOPE_VALUE"
Packit Service 3880ab
the scope of the area where this address is valid.
Packit Service 3880ab
The available scopes are listed in file
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_scopes" .
Packit Service 3880ab
Predefined scope values are:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B global
Packit Service 3880ab
- the address is globally valid.
Packit Service 3880ab
.sp
Packit Service 3880ab
.B site
Packit Service 3880ab
- (IPv6 only, deprecated) the address is site local, i.e. it is
Packit Service 3880ab
valid inside this site.
Packit Service 3880ab
.sp
Packit Service 3880ab
.B link
Packit Service 3880ab
- the address is link local, i.e. it is valid only on this device.
Packit Service 3880ab
.sp
Packit Service 3880ab
.B host
Packit Service 3880ab
- the address is valid only inside this host.
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI metric " NUMBER"
Packit Service 3880ab
priority of prefix route associated with address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI valid_lft " LFT"
Packit Service 3880ab
the valid lifetime of this address; see section 5.5.4 of
Packit Service 3880ab
RFC 4862. When it expires, the address is removed by the kernel.
Packit Service 3880ab
Defaults to
Packit Service 3880ab
.BR "forever" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI preferred_lft " LFT"
Packit Service 3880ab
the preferred lifetime of this address; see section 5.5.4
Packit Service 3880ab
of RFC 4862. When it expires, the address is no longer used for new
Packit Service 3880ab
outgoing connections. Defaults to
Packit Service 3880ab
.BR "forever" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B home
Packit Service 3880ab
(IPv6 only) designates this address the "home address" as defined in
Packit Service 3880ab
RFC 6275.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B mngtmpaddr
Packit Service 3880ab
(IPv6 only) make the kernel manage temporary addresses created from this one as
Packit Service 3880ab
template on behalf of Privacy Extensions (RFC3041). For this to become active,
Packit Service 3880ab
the \fBuse_tempaddr\fP sysctl setting has to be set to a value greater than
Packit Service 3880ab
zero.  The given address needs to have a prefix length of 64. This flag allows
Packit Service 3880ab
to use privacy extensions in a manually configured network, just like if
Packit Service 3880ab
stateless auto-configuration was active.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B nodad
Packit Service 3880ab
(IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
Packit Service 3880ab
adding this address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B optimistic
Packit Service 3880ab
(IPv6 only) When performing Duplicate Address Detection, use the RFC 4429
Packit Service 3880ab
optimistic variant.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B noprefixroute
Packit Service 3880ab
Do not automatically create a route for the network prefix of the added
Packit Service 3880ab
address, and don't search for one to delete when removing the address. Changing
Packit Service 3880ab
an address to add this flag will remove the automatically added prefix route,
Packit Service 3880ab
changing it to remove this flag will create the prefix route automatically.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B autojoin
Packit Service 3880ab
Joining multicast groups on Ethernet level via
Packit Service 3880ab
.B "ip maddr"
Packit Service 3880ab
command does not work if connected to an Ethernet switch that does IGMP
Packit Service 3880ab
snooping since the switch would not replicate multicast packets on ports that
Packit Service 3880ab
did not have IGMP reports for the multicast addresses.
Packit Service 3880ab
Packit Service 3880ab
Linux VXLAN interfaces created via
Packit Service 3880ab
.B "ip link add vxlan"
Packit Service 3880ab
have the
Packit Service 3880ab
.B group
Packit Service 3880ab
option that enables them to do the required join.
Packit Service 3880ab
Packit Service 3880ab
Using the
Packit Service 3880ab
.B autojoin
Packit Service 3880ab
flag when adding a multicast address enables similar functionality for
Packit Service 3880ab
Openvswitch VXLAN interfaces as well as other tunneling mechanisms that need to
Packit Service 3880ab
receive multicast traffic.
Packit Service 3880ab
Packit Service 3880ab
.SS ip address delete - delete protocol address
Packit Service 3880ab
.B Arguments:
Packit Service 3880ab
coincide with the arguments of
Packit Service 3880ab
.B ip addr add.
Packit Service 3880ab
The device name is a required argument. The rest are optional.
Packit Service 3880ab
If no arguments are given, the first address is deleted.
Packit Service 3880ab
Packit Service 3880ab
.SS ip address show - look at protocol addresses
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dev " IFNAME " (default)
Packit Service 3880ab
name of device.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI scope " SCOPE_VAL"
Packit Service 3880ab
only list addresses with this scope.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI to " PREFIX"
Packit Service 3880ab
only list addresses matching this prefix.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI label " PATTERN"
Packit Service 3880ab
only list addresses with labels matching the
Packit Service 3880ab
.IR "PATTERN" .
Packit Service 3880ab
.I PATTERN
Packit Service 3880ab
is a usual shell style pattern.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI master " DEVICE"
Packit Service 3880ab
only list interfaces enslaved to this master device.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI vrf " NAME "
Packit Service 3880ab
only list interfaces enslaved to this vrf.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI type " TYPE"
Packit Service 3880ab
only list interfaces of the given type.
Packit Service 3880ab
Packit Service 3880ab
Note that the type name is not checked against the list of supported types -
Packit Service 3880ab
instead it is sent as-is to the kernel. Later it is used to filter the returned
Packit Service 3880ab
interface list by comparing it with the relevant attribute in case the kernel
Packit Service 3880ab
didn't filter already. Therefore any string is accepted, but may lead to empty
Packit Service 3880ab
output.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B up
Packit Service 3880ab
only list running interfaces.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR dynamic " and " permanent
Packit Service 3880ab
(IPv6 only) only list addresses installed due to stateless
Packit Service 3880ab
address configuration or only list permanent (not dynamic)
Packit Service 3880ab
addresses. These two flags are inverses of each other, so
Packit Service 3880ab
.BR -dynamic " is equal to " permanent " and "
Packit Service 3880ab
.BR -permanent " is equal to " dynamic .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B tentative
Packit Service 3880ab
(IPv6 only) only list addresses which have not yet passed duplicate
Packit Service 3880ab
address detection.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B -tentative
Packit Service 3880ab
(IPv6 only) only list addresses which are not in the process of
Packit Service 3880ab
duplicate address detection currently.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B deprecated
Packit Service 3880ab
(IPv6 only) only list deprecated addresses.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B -deprecated
Packit Service 3880ab
(IPv6 only) only list addresses not being deprecated.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B dadfailed
Packit Service 3880ab
(IPv6 only) only list addresses which have failed duplicate
Packit Service 3880ab
address detection.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B -dadfailed
Packit Service 3880ab
(IPv6 only) only list addresses which have not failed duplicate
Packit Service 3880ab
address detection.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR temporary " or " secondary
Packit Service 3880ab
List temporary IPv6 or secondary IPv4 addresses only. The Linux kernel shares a
Packit Service 3880ab
single bit for those, so they are actually aliases for each other although the
Packit Service 3880ab
meaning differs depending on address family.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR -temporary " or " -secondary
Packit Service 3880ab
These flags are aliases for
Packit Service 3880ab
.BR primary .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B primary
Packit Service 3880ab
List only primary addresses, in IPv6 exclude temporary ones. This flag is the
Packit Service 3880ab
inverse of
Packit Service 3880ab
.BR temporary " and " secondary .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B -primary
Packit Service 3880ab
This is an alias for
Packit Service 3880ab
.BR temporary " or " secondary .
Packit Service 3880ab
Packit Service 3880ab
.SS ip address flush - flush protocol addresses
Packit Service 3880ab
This command flushes the protocol addresses selected by some criteria.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
This command has the same arguments as
Packit Service 3880ab
.BR show " except that " type " and " master " selectors are not supported."
Packit Service 3880ab
Another difference is that it does not run when no arguments are given.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B Warning:
Packit Service 3880ab
This command and other
Packit Service 3880ab
.B flush
Packit Service 3880ab
commands are unforgiving. They will cruelly purge all the addresses.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
With the
Packit Service 3880ab
.B -statistics
Packit Service 3880ab
option, the command becomes verbose. It prints out the number of deleted
Packit Service 3880ab
addresses and the number of rounds made to flush the address list.
Packit Service 3880ab
If this option is given twice,
Packit Service 3880ab
.B ip address flush
Packit Service 3880ab
also dumps all the deleted addresses in the format described in the
Packit Service 3880ab
previous subsection.
Packit Service 3880ab
Packit Service 3880ab
.SH "EXAMPLES"
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address show
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Shows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show'
Packit Service 3880ab
subcommand can be omitted.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address show up
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Same as above except that only addresses assigned to active network interfaces
Packit Service 3880ab
are shown.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address show dev eth0
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Shows IPv4 and IPv6 addresses assigned to network interface eth0.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Adds an IPv6 address to network interface eth1.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Delete the IPv6 address added above.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip address flush dev eth4 scope global
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Removes all global IPv4 and IPv6 addresses from device eth4. Without 'scope
Packit Service 3880ab
global' it would remove all addresses including IPv6 link-local ones.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.br
Packit Service 3880ab
.BR ip (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Original Manpage by Michail Litvak <mci@owl.openwall.com>