zoukankan      html  css  js  c++  java
  • ip命令

    ip命令用来显示或操纵Linux主机的路由、网络设备、策略路由和隧道,是Linux下较新的功能强大的网络配置工具。

    语法

    ip(选项)(参数)

    选项

    -V:显示指令版本信息;

    -s:输出更详细的信息;

    -f:强制使用指定的协议族;

    -4:指定使用的网络层协议是IPv4协议;

    -6:指定使用的网络层协议是IPv6协议;

    -0:输出信息每条记录输出一行,即使内容较多也不换行显示;

    -r:显示主机时,不使用IP地址,而使用主机的域名。

    参数

    网络对象:

    指定要管理的网络对象;

    具体操作:

    对指定的网络对象完成具体操作;

    help:

    显示网络对象支持的操作命令的帮助信息。

    实例

    用ip命令显示网络设备的运行状态 [root@localhost ~]# ip link list

    1: lo: <loopback,up,lower_up>mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    2: eth0: <broadcast,multicast,up,lower_up>mtu 1500 qdisc pfifo_fast qlen 1000

    link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff

    3: eth1: <broadcast,multicast,up,lower_up>mtu 1500 qdisc pfifo_fast qlen 1000

    link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff

    显示更加详细的设备信息

    [root@localhost ~]# ip -s link list

    1: lo: <loopback,up,lower_up>mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    RX: bytes packets errors dropped overrun mcast

    5082831 56145 0 0 0 0

    TX: bytes packets errors dropped carrier collsns

    5082831 56145 0 0 0 0

    2: eth0: <broadcast,multicast,up,lower_up>mtu 1500 qdisc pfifo_fast qlen 1000

    link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff

    RX: bytes packets errors dropped overrun mcast

    3641655380 62027099 0 0 0 0

    TX: bytes packets errors dropped carrier collsns

    6155236 89160 0 0 0 0

    3: eth1: <broadcast,multicast,up,lower_up>mtu 1500 qdisc pfifo_fast qlen 1000

    link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff

    RX: bytes packets errors dropped overrun mcast

    2562136822 488237847 0 0 0 0

    TX: bytes packets errors dropped carrier collsns

    3486617396 9691081 0 0 0 0

    显示核心路由表

    [root@localhost ~]# ip route list

    112.124.12.0/22 dev eth1 proto kernel scope link src 112.124.15.130

    10.160.0.0/20 dev eth0 proto kernel scope link src 10.160.7.81

    192.168.0.0/16 via 10.160.15.247 dev eth0

    172.16.0.0/12 via 10.160.15.247 dev eth0

    10.0.0.0/8 via 10.160.15.247 dev eth0

    default via 112.124.15.247 dev eth1

    显示邻居表

    [root@localhost ~]# ip neigh list

    112.124.15.247 dev eth1 lladdr 00:00:0c:9f:f3:88 REACHABLE

    10.160.15.247 dev eth0 lladdr 00:00:0c:9f:f2:c0 STALE

    来自: http://man.linuxde.net/ip

  • 相关阅读:
    【alpha】Scrum站立会议第2次....10.17
    【alpha】Scrum站立会议第1次····10.16
    【week4】技术随笔psp
    【week4】课堂Scrum站立会议
    【week3】psp (技术随笔)
    【week3】四则运算 单元测试
    【week3】词频统计 单元测试
    Oracle Split字符串

    指针函数与指针数组
  • 原文地址:https://www.cnblogs.com/flyingpig007/p/6994171.html
Copyright © 2011-2022 走看看