Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96373
  • 博文数量: 40
  • 博客积分: 426
  • 博客等级: 下士
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-02 11:04
文章分类

全部博文(40)

文章存档

2013年(1)

2012年(1)

2011年(38)

我的朋友

分类: LINUX

2011-03-22 15:26:13

具体做法如下:

1.进入目录:
[root@dfxg root]# cd /etc/sysconfig/network-scripts/

2:ifcfg-eh0:0中的eh0:0是网卡的代号,当然你也可以用eh0:1之类的,随你喜欢怎么弄,但在eh0:X之前必须有ifcfg,也就是下面这种形式的,我们以eh0:0为例。

[root@dfxg root]#cp ifcfg-eth0 ifcfg-eth0:0

3,编辑ifcfg-eth0:0
[root@Linuxsir root]# vi ifcfg-eth0:0

ifcfg-eth0:0里面有这样的内容,你可以这样设置,然后IP可以自己设置了。象我这样设置也一样。

# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
USERCTL='no'
NETMASK='255.255.255.0' -》子掩码
BOOTPROTO='static' -》协议
DEVICE='eth0:0' -》虚拟网卡的代号
IPADDR='192.168.0.9' -》我自己设定的IP
TYPE='Ethernet'
ONBOOT='yes' -》是否开机激活
NETWORK='192.168.0.0' -》网域
BROADCAST='192.168.0.255' -》广播

4.保存退出,然后运行如下的命令,来激活虚拟的网卡。
[root@dfxg root]# ifup eh0:0

阅读(440) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~