ifconfig 查看网卡
ifconfig eth0 查看网卡eth0
配置网络地址:
临时配置:
ifconfig eth0 192.168.10.100 netmask 255.255.255.0或者ifconfig eth0 192.168.10.100/24
service network restart 重启网络服务
永久配置:
vim /etc/sysconfig/network-scripts/ifxfg-eth0
NM-CONTROLLED = NO
ONBOOT = yes
BOOTPROTO = static (dhcp:动态获取)
IPADDR = 192.168.11.200
NETMASK = 255.255.255.0
GATWAY = 192.168.11.1
DNS1 = 202.106.0.20
DNS2 = 8.8.8.8
service network restart
service NetworkManager status 查看网络服务
service network status 查看网络设备
service NetworkManager stop 停止网卡守护进程
chkconfig --list 查看服务在各个级别的状态
chkconfig --list |grep NetworkManager
改状态:
chkconfig --level 2,3,4,5 NetworkManager off
chkconfig NetworkManager on(off) 全部级别开(关)
chkconfig --level 35 NetworkManager on(off)
route -n 查看网关
cat /etc/resolve.cont 查看DNS