Linux配置静态IP、设置DNS和主机名
1:静态IP
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR= ;这里是你网卡的物理地址,通常检测到的网卡你就不用输入了
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
GATEWAY= ;这里输入你的网关,路由器的IP地址
保存退出
#/sbin/service network restart
如果网卡启动是OK的话就说明IP地址设定成功了
2: 配置dns解析
#vi /etc/resolv.conf
修改里面的值;
nameserver 192.168.1.1
通知网关更新信息:
#/etc/init.d/network restart
3: 配置host
#vi /etc/host
修改值同windows
查看ip配置信息:
#ifconfig (已经启动的网络设置)
#ifconfig -a (所有的网络设置)
eth0 eth1 ... ethn 代表你的网卡配置
启动网卡:#/sbin/ifup eth0
关闭网卡:#/sbin/ifdown eth0
相关推荐
jidonghui 2019-08-27
citic 2011-10-20
windzoone 2020-07-29
kenson 2020-05-15
zhoushuaiyin 2011-12-14
dahege 2020-02-22
furongwei 2020-02-13
zealfish 2019-12-10
wqx 2016-05-31
cuixingwudi 2008-08-06
LychieFan 2007-12-09
Linuxest 2007-12-09
梦想天空分外蓝 2007-12-02
taianxiaojia 2007-11-27
wozijisunfly 2007-10-29
HeKing 2007-10-28
thone00 2007-09-19
kyssfanhui 2007-09-15