2.网络管理-Linux复习计划
Centos7
1.mii-tool eth0
查看网卡连接状态
eth0: negotiated 1000baseT-FD flow-control, link ok
2.route -n
查看路由IP不解析为主机名,netstat -nr
也可查看
route add default gw 192.168.1.1
route add -host 192.168.2.8 gw 192.168.2.1
route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.3.1
3.ip addr
查看网卡IP地址
ip addr add 192.168.1.2/24 dev eth0
ip route add 192.168.0.0/24 via 192.168.2.1
ip link set dev eth0 up
4.ifconfig eth0 192.168.1.2 netmask 255.255.255.0
临时设置网卡IP
ifup eth0
启动网卡
ifdown eth0
关闭网卡
版权声明:
作者:konoha
链接:https://muye.org/2-%e7%bd%91%e7%bb%9c%e7%ae%a1%e7%90%86-linux%e5%a4%8d%e4%b9%a0%e8%ae%a1%e5%88%92.html
文章版权归作者所有,未经允许请勿转载。
THE END