您的位置:首页 > 运维架构 > Linux

Linux CentOS5.5 的 IP设置

2012-07-30 21:53 183 查看
1.IP设置

vim /etc/sysconfig/network-scripts/ifcfg-eth0

设置静态ip
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.102
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=00:0C.....
ONBOOT=yes
TYPE=Ethernet

动态IP
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C...
ONBOOT=yes


2.DNS设置

vim /etc/resolv.conf
配置DNS
nameserver 202.96.128.166


3.增加一个虚拟IP

ifconfig eth0:1 192.168.1.134 netmask 255.255.255.0 up

但是重启网络服务后.就会消失

service network restart

4. 删除一个虚拟ip
ip addr del 192.168.1.134 dev eth0


5.查看IP
[root@xuwu /]# ifconfig
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: