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  关闭网卡

THE END