Part I:使用命令配置
1>ifconfig eth0 192.168.1.90
2>route add default gw 192.168.1.1
3>service network restart




Part II:使用配置文件配置
1>修改主机名
vi /etc/sysconfig/network

======================================
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=sense
======================================

vi /etc/hosts

===================================================================
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       sense   localhost
::1     localhost6.localdomain6 localhost6
===================================================================


2>配置IP地址及网关
vi /etc/sysconfig/network-scripts/ifcfg-eth0

==================================================================================================
# Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.1.90
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
HWADDR=00:16:D3:27:B5:02
ONBOOT=yes
GATEWAY=192.168.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
==================================================================================================


3>配置DNS
vi /etc/resolv.conf

=========================================================
search sense
nameserver 202.99.160.68
nameserver 202.99.166.4
nameserver 192.168.1.252
=========================================================

Logo

更多推荐