Skip to content

Commit

Permalink
修正 ip 命令部分解释 (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutixiaya committed Aug 30, 2022
1 parent 6acbdf6 commit ea631fe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions command/ip.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ ip
### 语法

```shell
ip(选项)(参数)
ip(选项)(对象)
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
ip [ -force ] -batch filename
```
### 选项
### 对象
```shell
OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
Expand All @@ -31,7 +31,7 @@ OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
-r:显示主机时,不使用IP地址,而使用主机的域名。
```
### 参数
### 选项
```shell
OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
Expand All @@ -50,16 +50,16 @@ help:显示网络对象支持的操作命令的帮助信息。
### 实例
```shell
ip link show # 显示网络接口信息
ip link show # 显示网络接口信息
ip link set eth0 up # 开启网卡
ip link set eth0 down # 关闭网卡
ip link set eth0 promisc on # 开启网卡的混合模式
ip link set eth0 promisc offi # 关闭网卡的混个模式
ip link set eth0 promisc offi # 关闭网卡的混合模式
ip link set eth0 txqueuelen 1200 # 设置网卡队列长度
ip link set eth0 mtu 1400 # 设置网卡最大传输单元
ip addr show # 显示网卡IP信息
ip addr add 192.168.0.1/24 dev eth0 # 设置eth0网卡IP地址192.168.0.1
ip addr del 192.168.0.1/24 dev eth0 # 删除eth0网卡IP地址
ip addr add 192.168.0.1/24 dev eth0 # 为eth0网卡添加一个新的IP地址192.168.0.1
ip addr del 192.168.0.1/24 dev eth0 # 为eth0网卡删除一个IP地址192.168.0.1

ip route show # 显示系统路由
ip route add default via 192.168.1.254 # 设置系统默认路由
Expand Down

0 comments on commit ea631fe

Please sign in to comment.