以CentOS5.5为例,RedHat和Federal应该也差不多:
配置IP地址,以网卡eth0为例:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.150.0.159
NETMASK=255.0.0.0
NETWORK=10.0.0.0
BROADCAST=10.255.255.255
HWADDR=00:0C:29:E0:79:1C
ONBOOT=yes |
配置默认网关,主机名:
vim /etc/sysconfig/network
NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=localhost.localdomain GATEWAY=10.150.0.254
|
配置DNS:
vim /etc/resolv.conf
nameserver 10.50.0.10 nameserver 8.8.4.4 search localdomain
|
另外,几个常用命令:
service network restart 重启网络
ifdown eth0 关闭eth0网卡
ifup eth0 打开eth0网卡
阅读(416) | 评论(0) | 转发(0) |