Linux 系统管理 网络配置

配置IP地址 

[root@light ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0HWADDR=00:0C:29:50:F0:10TYPE=EthernetUUID=67d51e6d-e3d9-448e-832a-9890c7f91ed9ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=192.168.1.52GATEWAY=192.168.1.1NETMASK=255.255.255.0

配置DNS

[root@light ~]# vi /etc/resolv.conf nameserver 8.8.8.8nameserver 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...                                                           [确定]