The ip
command is similar to the ifconfig
command, but more powerful than the ifconfig
command. Its main function is to display or set the configuration of network devices, routes, and tunnels. The ip
command is an enhanced version of the network configuration tool in Linux
, used to replace the ifconfig
command.
-b, -batch <FILENAME>
: Read commands from the provided file or standard input, the first failure will lead to the termination of the ip
execution.-force
: Do not terminate ip
due to errors in batch mode. If any error occurs during command execution, the application return code will be non-zero.-s, -stats, -statistics
: Output more information. If this option appears two or more times, the amount of information will increase. Typically, the information is statistical information or some time values.-l, -loops <COUNT>
: Specify the maximum number of loops attempted by ip addr flush
before giving up. The default value is 10
, 0
means looping until all addresses are deleted.-f, -family <FAMILY>
: Specify the protocol family used. The protocol family identifier can be one of inet
, inet6
, bridge
, ipx
, dnet
, or link
. If this option does not exist, the protocol family is guessed based on other parameters. If the rest of the command line does not provide enough information to guess the family, ip
will fall back to the default ip
setting, usually inet
or any
. link
is a special family identifier that does not involve any network protocols.-4
: Shortcut for -family inet
.-6
: Shortcut for -family inet6
.-B
: Shortcut for -family bridge
.-D
: Shortcut for -family decnet
.-I
: Shortcut for -family ipx
.-0
: Shortcut for -family link
.-o, -oneline
: Output each record as a single line, replacing newline characters with \
character. This is convenient when counting records with wc
or grepping the output.-r, -resolve
: Print DNS
names using the system's name resolution program instead of host addresses.-V, -Version
: Output version information.address
: Protocol address on a device, IP
or IPv6
.addrlabel
: Label configuration used for protocol address selection.l2tp
: IP tunnel Ethernet L2TPv3
.link
: Network device.maddress
: Multicast addresses.monitor
: Monitor netlink
messages.mroute
: Multicast routing cache entry.mrule
: Rule in the multicast routing policy database.neighbour
: Manage ARP
or NDISC
cache entries.netns
: Manage network namespaces.ntable
: Operations on the neighbour cache.route
: Routing table entry.rule
: Rule in the routing policy database.tcp_metrics/tcpmetrics
: Manage TCP
metrics.tunnel
: IP
tunnel.tuntap
: Manage TUN/TAP
devices.xfrm
: Manage IPSec
policies.To view network interface information, such as IP
addresses and subnets.
To view information about the eth0
network card.
To enable a network interface.
To disable a network interface.
To view routing and default gateway information.
To get routing information for a specific IP
.
To view arp
entries.
To view network statistics.
For detailed help information.