[Gllug] "ip" command

John Edwards john at cornerstonelinux.co.uk
Fri Feb 3 12:57:58 UTC 2006


On Fri, Feb 03, 2006 at 01:17:56PM +0000, Richard Jones wrote:
> 
> Anyone know what the "ip" command is?  All the Xen scripts seem to use
> it.  Stuff like:
> 
>     if ip addr show dev ${dst} | egrep -q '^ *inet ' ; then
>         return
>     fi
> 
> Rich.

It's part of iproute2 package, and is used to query or set ip address, 
routing and other network options, replacing such programs as ifconfig 
and route. It's probably present on most modern Linux distributions.

Examples:
----------------------------------------------------------------------
$ /sbin/ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:0f:ea:54:df:df brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
    inet6 fe80::20f:eaff:fe54:dfdf/64 scope link
       valid_lft forever preferred_lft forever
$ /sbin/ip route
192.168.2.0/24 dev eth0  proto kernel  scope link  src 192.168.2.1
default via 192.168.2.254 dev eth0
----------------------------------------------------------------------

-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
|                                                         |
| A. Because it breaks the logical sequence of discussion |
| Q. Why is top posting bad ?                             |
#---------------------------------------------------------#
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list