linux-ip命令杂记

11.3 ip命令

11.3.1 ip

查看ip是由哪个rpm生成的

[[email protected] ~]# rpm -qf `which ip`
iproute-2.6.32-32.el6_5.i686

查看iproute生成的文件

[[email protected] ~]# rpm -ql iproute
/etc/iproute2
/etc/iproute2/ematch_map
/etc/iproute2/rt_dsfield
/etc/iproute2/rt_protos
/etc/iproute2/rt_realms
/etc/iproute2/rt_scopes
/etc/iproute2/rt_tables
/etc/sysconfig/cbq
/etc/sysconfig/cbq/avpkt
/etc/sysconfig/cbq/cbq-0000.example
/sbin/bridge
/sbin/cbq
/sbin/ifcfg
/sbin/ip
/sbin/rtmon
/sbin/tc
/usr/lib/tc
/usr/lib/tc/m_xt.so
/usr/sbin/arpd
/usr/sbin/lnstat
/usr/sbin/nstat
/usr/sbin/rtacct
/usr/sbin/ss
/usr/share/doc/iproute-2.6.32
/usr/share/doc/iproute-2.6.32/COPYING
/usr/share/doc/iproute-2.6.32/README
/usr/share/doc/iproute-2.6.32/README.decnet
/usr/share/doc/iproute-2.6.32/README.distribution
/usr/share/doc/iproute-2.6.32/README.iproute2+tc
/usr/share/doc/iproute-2.6.32/README.lnstat
/usr/share/man/man8/arpd.8.gz
/usr/share/man/man8/bridge.8.gz
/usr/share/man/man8/cbq.8.gz
/usr/share/man/man8/ifcfg.8.gz
/usr/share/man/man8/ip.8.gz
/usr/share/man/man8/lnstat.8.gz
/usr/share/man/man8/nstat.8.gz
/usr/share/man/man8/routel.8.gz
/usr/share/man/man8/rtacct.8.gz
/usr/share/man/man8/rtmon.8.gz
/usr/share/man/man8/ss.8.gz
/usr/share/man/man8/tc-bfifo.8.gz
/usr/share/man/man8/tc-cbq-details.8.gz
/usr/share/man/man8/tc-cbq.8.gz
/usr/share/man/man8/tc-htb.8.gz
/usr/share/man/man8/tc-pfifo.8.gz
/usr/share/man/man8/tc-pfifo_fast.8.gz
/usr/share/man/man8/tc-prio.8.gz
/usr/share/man/man8/tc-red.8.gz
/usr/share/man/man8/tc-sfq.8.gz
/usr/share/man/man8/tc-tbf.8.gz
/usr/share/man/man8/tc.8.gz
/usr/share/tc
/usr/share/tc/normal.dist
/usr/share/tc/pareto.dist
/usr/share/tc/paretonormal.dist

11.3.2 ip-link

查看所有接口属性

[[email protected] ~]# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff

查看指定接口属性

[[email protected] ~]# ip link show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff

关闭接口

[[email protected] ~]# ip link set dev lo down
[[email protected] ~]# ip lin show lo
1: lo: <LOOPBACK> mtu 65536 qdisc noqueue state DOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

开启接口

[[email protected] ~]# ip link set dev lo up
[[email protected] ~]# ip lin show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

11.3.2 ip-addr

显示所有接口ip

[[email protected] ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1018sec preferred_lft 1018sec
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

增加一个地址,两个地址

[[email protected] ~]# ip addr add  10.201.106.119 dev ens33
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# ip addr show dev ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1654sec preferred_lft 1654sec
    inet 10.201.106.119/32 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

删除IP地址

[[email protected] ~]# ip addr delete 10.201.106.119/32 dev ens33
[[email protected] ~]# ip addr show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1372sec preferred_lft 1372sec
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

在原有的基础上增加一个IP地址,并添加label

[[email protected] ~]# ip addr add 10.201.106.222/24 dev ens33 label ‘ens33:1‘
[[email protected] ~]# ip add show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1151sec preferred_lft 1151sec
    inet 10.201.106.222/24 scope global secondary ens33:1    #显示label
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

带label参数删除IP

[[email protected] ~]# ip addr del 10.201.106.222/24 dev ens33 label ens33:1
[[email protected] ~]# ip addr show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1482sec preferred_lft 1482sec
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

只显示主地址

[[email protected] ~]# ip addr show dev ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1183sec preferred_lft 1183sec
    inet 10.201.106.222/24 scope global secondary ens33:3
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# ip addr show dev ens33 primary
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1181sec preferred_lft 1181sec
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever
[[email protected] ~]# 

只显示辅助地址

[[email protected] ~]# ip addr show dev ens33 secondary
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.222/24 scope global secondary ens33:3
       valid_lft forever preferred_lft forever

根据标签清除IP地址

[[email protected] ~]# ip addr flush dev ens33 label ens33:3
[[email protected] ~]# ip addr show dev ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a7:7a:ec brd ff:ff:ff:ff:ff:ff
    inet 10.201.106.130/24 brd 10.201.106.255 scope global dynamic ens33
       valid_lft 1718sec preferred_lft 1718sec
    inet6 fe80::20c:29ff:fea7:7aec/64 scope link
       valid_lft forever preferred_lft forever

11.3.3 ip route

添加主机路由

[[email protected] ~]# ip route add 192.168.1.3/32 via 10.201.106.2 dev ens33
[[email protected] ~]# ip route show
default via 10.201.106.2 dev ens33  proto static  metric 100
10.201.106.0/24 dev ens33  proto kernel  scope link  src 10.201.106.130  metric 100
192.168.1.3 via 10.201.106.2 dev ens33

添加网段路由

[[email protected] ~]# ip route add 192.168.0.0/24 via 10.201.106.2 dev ens33
[[email protected] ~]# ip route show dev ens33
default via 10.201.106.2  proto static  metric 100
10.201.106.0/24  proto kernel  scope link  src 10.201.106.130  metric 100
192.168.0.0/24 via 10.201.106.2
192.168.1.3 via 10.201.106.2 

删除路由

[[email protected] ~]# ip route del 192.168.1.3
[[email protected] ~]# ip route list
default via 10.201.106.2 dev ens33  proto static  metric 100
10.201.106.0/24 dev ens33  proto kernel  scope link  src 10.201.106.130  metric 100
192.168.0.0/24 via 10.201.106.2 dev ens33
[[email protected] ~]# ip route del 192.168.0.0/24
[[email protected] ~]# ip route list
default via 10.201.106.2 dev ens33  proto static  metric 100
10.201.106.0/24 dev ens33  proto kernel  scope link  src 10.201.106.130  metric 100 

添加默认路由

[[email protected] ~]# ip route add default via 10.201.106.102
[[email protected] ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.201.106.102  0.0.0.0         UG    0      0        0 ens33
0.0.0.0         10.201.106.2    0.0.0.0         UG    100    0        0 ens33
10.201.106.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33

清空所有路由表

ip route flush

11.3.4 ss

显示所有TCP进程,以端口号显示

[[email protected] ~]# ss -tan
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port
LISTEN     0      128     *:22                  *:*
LISTEN     0      100    127.0.0.1:25                  *:*
ESTAB      0      0      10.201.106.130:22                 10.201.106.1:49530
ESTAB      0      0      10.201.106.130:22                 10.201.106.1:49506
LISTEN     0      128    :::22                 :::*
LISTEN     0      100       ::1:25                 :::* 

显示已连接状态的TCP连接

[[email protected] ~]# ss -tan state ESTABLISHED
Recv-Q Send-Q Local Address:Port               Peer Address:Port
0      52     10.201.106.130:22                 10.201.106.1:49530
0      0      10.201.106.130:22                 10.201.106.1:49506    

配置文件配置网络

ifcfg-eth0配置

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=eth0
# If you‘re having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
ONBOOT="yes"
TYPE="Ethernet"
NM_CONTROLLED="yes"
BOOTPROTO="static"
IPADDR=10.201.106.250
NETMASK=255.255.255.0
GATEWAY=10.201.106.2

配置文件配置路由条目(1)

[[email protected] network-scripts]# vim route-eth0 

192.168.0.0/24 via 10.201.106.2

[[email protected] network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.201.106.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     10.201.106.2    255.255.255.0   UG    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         10.201.106.2    0.0.0.0         UG    0      0        0 eth0

配置文件配置路由条目(2)

[[email protected] network-scripts]# vim route-eth0 

ADDRESS0=192.168.20.0
NETMASK0=255.255.255.0
GATEWAY0=10.201.106.2
ADDRESS1=192.168.30.0
NETMASK1=255.255.255.0
GATEWAY1=10.201.106.2

[[email protected] network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
ipcalc: bad IPv4 address: 192.168.3330.0
Error: an inet prefix is expected rather than "192.168.3330.0/24".
                                                           [  OK  ]
[[email protected] network-scripts]# vim route-eth0
[[email protected] network-scripts]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
                                                           [  OK  ]
[[email protected] network-scripts]#
[[email protected] network-scripts]#
[[email protected] network-scripts]#
[[email protected] network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.20.0    10.201.106.2    255.255.255.0   UG    0      0        0 eth0
10.201.106.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.30.0    10.201.106.2    255.255.255.0   UG    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         10.201.106.2    0.0.0.0         UG    0      0        0 eth0

ifcfg配置多地址

[[email protected] network-scripts]# ifconfig eth0:1 192.168.0.22/24 up

[[email protected] network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:4E:AF:24
          inet addr:10.201.106.128  Bcast:10.201.106.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe4e:af24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2221 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1851 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:204895 (200.0 KiB)  TX bytes:278337 (271.8 KiB)

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:4E:AF:24
          inet addr:192.168.0.22  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

    [[email protected] network-scripts]#
    [[email protected] network-scripts]# ping 192.168.0.22
    PING 192.168.0.22 (192.168.0.22) 56(84) bytes of data.
    64 bytes from 192.168.0.22: icmp_seq=1 ttl=64 time=1.05 ms
    64 bytes from 192.168.0.22: icmp_seq=2 ttl=64 time=0.339 ms

配置文件添加别名网卡地址

cp ifcfg-eth0 ifcfg-eth0:1
[[email protected] network-scripts]# vim ifcfg-eth0:1

DEVICE=eth0:1
HWADDR=00:0C:29:4E:AF:24
TYPE=Ethernet
UUID=a493b909-229d-4a02-b1b5-ebbb51d16983
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO="static"
IPADDR=192.168.0.22
NETMASK=255.255.255.0
DNS1=10.201.106.2

tui

setup调用 network configuration

更改主机名

[[email protected] network-scripts]# vim /etc/sysconfig/network

NETWORKING=yes            #网络总开关,网络不通先确认该项有没打开
HOSTNAME=zabbix.localdomain

将eth0改为eth1

[[email protected] ~]# cd /etc/udev/rules.d/

vim 70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:4e:af:24", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1   #改为eth1

[[email protected] rules.d]#  lsmod               #查看网卡
[[email protected] rules.d]# modprobe -r e1000    #卸载网卡
[[email protected] rules.d]# modprobe  e1000      #加载网卡
[[email protected] ~]# service network restart    #重启网络服务
[[email protected] ~]# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:0C:29:4E:AF:24
          inet addr:10.201.106.128  Bcast:10.201.106.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe4e:af24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:350 errors:0 dropped:0 overruns:0 frame:0
          TX packets:305 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:34875 (34.0 KiB)  TX bytes:65070 (63.5 KiB)

原文地址:http://blog.51cto.com/zhongle21/2091353

时间: 2024-10-17 02:02:26

linux-ip命令杂记的相关文章

linux IP命令总结

一.作用 linux的ip命令和ifconfig类似,但ip命令功能更强大,ip是iproute2软件包里的一个网络配置工具,使用权限为超级用户,它是用来显示或操作linux主机的路由,设备,策略路由和隧道. 二.用法 ip [OPTIONS] OBJECT { COMMAND | help } ip [ -force ] -batch filename OBJECT := { link | address | addrlabel | route | rule | neigh | ntable

linux常用命令杂记(一)--Lsof

lsof的用法 lsof全名list opened files,也就是列举系统中已经被打开的文件.linux环境中,任何事物都是文件,设备是文件,目录是文件,甚至sockets也是文件.所以,用好lsof命令,对日常的linux管理非常有帮助. lsof是linux最常用的命令之一,通常的输出格式为:#lsof +d /usr/local/#lsof -i :22 知道22端口现在运行什么程序等等查看相应用法可以查看man帮助查找对应选项:man lsof 常见包括如下几个字段: 1.COMMA

Linux基础命令杂记

今天又一次搞Linux生产环境搭建.这是种步骤很多,很繁琐而且又不得不做的事情.虽然做过很多次,但还是有很多步骤.命令不记得,每一次到处找资料很麻烦,于是将一些步骤记下,以便查找. 登录远程MySQL mysql -h 192.168.1.100 -u root -p 给MySQl非root账户分配权限 给账号user1 密码为123456 的用户testDB数据库的所有表的select,insert,update,delete权限: grant select,insert,update,del

Linux下的ip命令

linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务.ifconfig是net-tools中已被废弃使用的一个命令,许多年前就已经没有维护了.iproute2套件里提供了许多增强功能的命令,ip命令即是其中之一. Net tools vs Iproute2 要安装ip,请点击这里下载iproute2套装工具 .不过,大多数Linux发行版已经预装了iproute2工具. 你也可以使用git命令来下载最新源代码

linux包之iproute之ip命令

[[email protected] ~]# rpm -qf /sbin/ipiproute-2.6.32-31.el6.x86_64ip 是个命令, ip 命令的功能很多!基本上它整合了 ifconfig 与 route 这两个命令ip - show / manipulate routing, devices, policy routing and tunnels ip [ OPTIONS ] OBJECT { COMMAND | help } OBJECT := { link | addr

linux 下ip命令对比ifconfig命令

原文:https://linux.cn/article-3144-1.html ------------------------------------------------------------------------------------------------------------------------------------------ 试试Linux下的ip命令,ifconfig已经过时了 linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip

linux命令总结之ip命令

Linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务.ifconfig是net-tools中已被废弃使用的一个命令,许多年前就已经没有维护了.iproute2套件里提供了许多增强功能的命令,ip命令即是其中之一. 要安装ip,请点击这里下载iproute2套装工具 .不过,大多数Linux发行版已经预装了iproute2工具. 你也可以使用git命令来下载最新源代码来编译: $ git clone https

每天一个Linux命令(60)ip命令

    ip命令是Linux下较新的功能强大的网络配置工具.     (1)用法:     用法:  ip  [OPTIONS]  OBJECT  [COMMAND [ARGUMENTS]]     (2)功能:     功能:  ip命令用来显示或操纵Linux主机的路由.网络设备.策略路由和隧道.     (3)选项参数: 1)OPTIONS:  是一些修改ip行为或者改变其输出的选项,所有的选项都是以-字符开头,分为长.短两种形式: -V -Version 打印ip的版本并退出 -s -s

Linux网络综合命令——IP

1.作用 ip是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具,例如ifconfig.route等,使用权限为超级用户.几乎所有的Linux发行版本都支持该命令. 2.格式ip [OPTIONS] OBJECT [COMMAND [ARGUMENTS]] 3.主要参数OPTIONS是修改ip行为或改变其输出的选项.所有的选项都是以-字符开头,分为长.短两种形式.目前,ip支持如表1所示选项. OBJECT是要管理者获取信息的对象.目前ip认识的对象见表2所示

Linux下的ip命令,除了ifconfig还有很多

linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务.ifconfig是net-tools中已被废弃使用的一个命令,许多年前就已经没有维护了.iproute2套件里提供了许多增强功能的命令,ip命令即是其中之一. 要安装ip,请点击这里下载iproute2套装工具 .不过,大多数Linux发行版已经预装了iproute2工具. 你也可以使用git命令来下载最新源代码来编译: $ git clone https