Professional Documents
Culture Documents
GNULinux IP Command With Examples
GNULinux IP Command With Examples
am a new Linux system admin user. How do I use ip command line utility to display or
configure networking, routing, and tunnels on Linux operating systems? How do I
configures or displays network interface parameters for a network using TCP/IP on Linux
operating systems?
The ip command is used to assign an address to a network interface and/or configure
network interface parameters on Linux operating systems. This command replaces old good
and now deprecated ifconfig command on modern Linux distributions. It is used for the
following purposes:
1.
2.
3.
4.
5.
6.
7.
8.
Purpose
Use this command to display and configure the network parameters for host interfaces.
Syntax
ip OBJECT COMMAND
ip [options] OBJECT COMMAND
ip OBJECT help
link
Network device.
address
a
addr
addrlabel addrl
n
neighbour neigh
route
rule
ru
maddress
m
maddr
Multicast address.
mroute
mr
tunnel
xfrm
Page 1 of 7
OBJECT help
OBJECT h
a help
r help
Warning: The commands described below must be executed with care. If you make a mistake, you will loos connectivity
to the server. You must take special care while working over the ssh based remote session.
ip command examples
Don't be intimidated by ip command syntax. Let us get started quickly with examples.
[1]
##
###
Page 2 of 7
Page 3 of 7
meaning
Page 4 of 7
permanent
The neighbour entry is valid forever and can be only be removed administratively
noarp
The neighbour entry is valid. No attempts to validate this entry will be made but it can be removed when
its lifetime expires.
stale
The neighbour entry is valid but suspicious. This option to ip neigh does not change the neighbour state if
it was valid and the address is not changed by this command.
reachable
r
r list
r list [options]
route
Sample outputs:
default via 192.168.1.254 dev eth1
192.168.1.0/24 dev eth1 proto kernel
scope link
src 192.168.1.10
scope link
src 192.168.1.10
proto kernel
route
route
route
route
add
add
add
add
Page 5 of 7
Delete a route
The syntax is as follows to delete default gateway:
ip route del default
In this example, delete the route created in previous subsection [7]:
ip route del 192.168.1.0/24 dev eth0
Category
Processes bg [12] disown [13] fg [14] jobs [15] kill [16] killall [17] pwdx [18] time [19] pidof [20] pstree
Management [21]
Searching
User Information
Page 6 of 7
Page 7 of 7