操作系统:Linux Cent OS 5
- 设置静态ip地址:
1234567891011nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=
static
HWADDR=
00
:F1:F3:
07
:
11
:4A
ONBOOT=yes
DHCP_HOSTNAME=ehangpc
TYPE=Ethernet
NETMASK=
255.255
.
255.0
IPADDR=
192.168
.
1.2
GATEWAY=
192.168
.
1.1
- 设置DNS:
123nano /etc/resolv.conf
nameserver
8.8
.
8.8
- 重启网络服务使配置生效:
1service network restart