本文主要是介绍MAN IP 学习及示例(centos7),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
MAN IP 学习及示例(centos7)
NAME
ip - show / manipulate routing, devices, policy routing and tunnels
ip - 用于查看或配置路由,设备,策略路由及隧道
SYNOPSIS概要
ip [ OPTIONS ] OBJECT { COMMAND | help }
以上是配置格式示例,下面有不同格式参数的说明
ip [ -force ] -batch filename
第二种配置格式,可批量执行命令参数
OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable | tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm | netns | l2tp | tcp_metrics }
OBJECT可选以上列表参数
OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] | -n[etns] name }
OPTIONS可选以上列表参数;
以下是OPTIONS说明:
OPTIONS
-V,-Version
查看IP功能版本,以下为执行示例
[root@localhost ~]# ip -Vip utility, iproute2-ss130716
-b, -batch <FILENAME>
从提供的文件或标准输出中读取命令,默认,遇到错误将中断后续参数执行
[root@localhost ~]# cat zz.sh
addr
ip addr
link
[root@localhost ~]# ip -b zz.sh
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:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:03:6d:7b brd ff:ff:ff:ff:ff:ffinet 192.168.5.27/24 brd 192.168.5.255 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fe03:6d7b/64 scope link valid_lft forever preferred_lft forever
Object "ip" is unknown, try "ip help".
Command failed zz.sh:2
[root@localhost ~]#
-force
在批处理模式下忽略报错,当某个命令报错依旧执行
[root@localhost ~]# ip -force -b zz.sh
1: lo: <LOOPBACK,UP,LOWER_UP>
这篇关于MAN IP 学习及示例(centos7)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!