一、两大网络配置工具(net-tools/iproute2)
net-tools
- ifconfig
[root@myp ~]# ifconfig
查看网卡信息
[root@myp ~]# ifconfig eth0 down (禁用网卡)
[root@myp ~]# ifconfig eth0 up (激活网卡)
[root@myp ~]# ifconfig eth0 192.168.160.3 netmask 255.255.255.0 (临时设置网卡地址)
- route:查看/管理路由表
[root@myp ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.160.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 192.168.160.2 0.0.0.0 UG 0 0 0 eth0
[root@myp ~]# route -n (-n是不做名称解析)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.160.0 0.0.0