IP addr 添加网络的使用
添加IP到网口
[root@localhost ~]# ip addr add 192.168.10.100/24 dev em1
查看添加的IP
[root@localhost ~]# ip addr show
移除添加的IP
[root@localhost ~]# ip addr del 192.168.10.100/24 dev em1
启用网口IP
[root@localhost ~]# ip link set em1 up
禁用网口
[root@localhost ~]# ip link set em1 down
检测路由
[root@localhost ~]# ip route show
添加路由
root@localhost ~]# ip route add 10.30.40.0/24 via 192.168.3.254 dev em1
移除路由
[root@localhost ~]# ip route del 10.30.40.0/24
添加网关
[root@localhost network-scripts]# ip route add default via 192.168.10.254
移除网关
[root@localhost network-scripts]# ip route del default via 192.168.10.254
文章来源:https://www.cnaaa.net,转载请注明出处:https://www.cnaaa.net/archives/12274