IP addr添加网络的使用

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.sxszhian.com/archives/12274
来源:上海永驰网络科技有限公司
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
< <上一篇
下一篇>>