设置静态IP
配置文件位于:
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.0.2
NETMASK=255.0.0.0
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.0.2
NETMASK=255.0.0.0
GATEWAY=10.0.0.1
通知网关更新信息
service network restart (/etc/init.d/network restart )
设置DNS
配置文件位于:
/etc/resolv.conf
/etc/resolv.conf
nameserver 208.67.222.222
nameserver 208.67.220.220
更改主机名
第一步:
#hostname yourname
第二步:
修改/etc/sysconfig/network中的hostname
第三步:
修改/etc/hosts文件
#hostname yourname
第二步:
修改/etc/sysconfig/network中的hostname
第三步:
修改/etc/hosts文件
注销(ctrl+D)后登陆

没有评论:
发表评论