test_touch 发表于 2013-1-31 00:50:16

CentOS 修改网络设置以及解决一些命令不存在

 
一、CentOS 修改IP地址
修改对应网卡的IP地址的配置文件
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改以下内容
<div class="hl-surround" style="font-family: Arial; font-size: 14px; line-height: 25px; text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; background-color: #f9fbfc; width: auto; height: auto; padding: 0px; border: 1px solid #c3ced9;"><div class="hl-main" style="padding-top: 6px; padding-right: 24px; padding-bottom: 6px; padding-left: 24px; background-color: transparent; margin: 0px;">DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0
BOOTPROTO=static #设置网卡获得ip地址的方式,可能的选项为static,dhcp或bootp,分别对应静态指定的 ip地址,通过dhcp协议获得的ip地址,通过bootp协议获得的ip地址
BROADCAST=192.168.0.255 #对应的子网广播地址
HWADDR=00:07:E9:05:E8:B4 #对应的网卡物理地址
IPADDR=12.168.1.2 #如果设置网卡获得 ip地址的方式为静态指定,此字段就指定了网卡对应的ip地址
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0 #网卡对应的网络掩码
NETWORK=192.168.1.0 #网卡对应的网络地址
ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备
页: [1]
查看完整版本: CentOS 修改网络设置以及解决一些命令不存在