Linux 系统管理 网络配置
配置IP地址
[root@light ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:50:F0:10
TYPE=Ethernet
UUID=67d51e6d-e3d9-448e-832a-9890c7f91ed9
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.1.52
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
配置DNS
[root@light ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 202.101.224.68
重启网卡 两个方法:
[root@light ~]# service network restart
正在关闭接口 eth0: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: Determining if ip address 192.168.1.52 is already in use for device eth0...
[确定]
[root@light ~]# /etc/init.d/network restart
正在关闭接口 eth0: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: Determining if ip address 192.168.1.52 is already in use for device eth0...
[确定]
原文地址:http://zmyxn.blog.51cto.com/3029175/1619007