博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

Unix爱好者家园

卓越源代码  
   sdccf.cublog.cn
关于作者  
姓名:sdccf
职业:chinapost
年龄:36
位置:sd
个性介绍:

我的分类  




Solaris为单块网卡配置多个IP
作者: bychina     出自: http://www.linuxdiyf.com
solaris单网卡配置多IP:
root@shrsa2 # ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 10.221.15.19 netmask ffffff80 broadcast 10.221.15.127
ether 0:14:4f:75:1c:a4

这里只有一个可用物理网卡bge0,因为有一个应用软件在开发时与某个固定ip绑定,所以需要配置爽IP,但是只有一个网卡,怎么办呢。

在win里填加多个ip很方便,unix同样可以。
ifconfig bge0:1 plumb
ifconfig bge0:1 211.136.159.199 netmask 255.255.255.0 up

此时ifconfig -a可以看到填加的IP了:
root@shrsa2 # ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 10.221.15.19 netmask ffffff80 broadcast 10.221.15.127
ether 0:14:4f:75:1c:a4
bge0:1: flags=1000843 mtu 1500 index 2
inet 211.136.159.199 netmask ffffff00 broadcast 211.136.159.255
root@shrsa2 #
  
需要注意的地方。bge0;0不能添加,只能从bge0:1--2---3---等。
如果需要删除这个虚拟接口:
ifconfig bge0:1 unplumb
plumb是加载驱动的参数,plumb应该是卸载了吧!
  
相关的网络参数配置文件有:
/etc/hostname.pcn0 #ip地址对了就可以
/etc/hosts #10.221.15.19 shrsa2 shrsa2. loghost
/etc/netmasks #这里的内容一定要注意用网络号和相对应的10进制掩码表示。
/etc/defaultrouter #网关地址

 发表于: 2008-05-29,修改于: 2008-05-29 13:12 已浏览203次,有评论0条 推荐 投诉

  网友评论

  发表评论



Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们
页面生成时间:0.41027

京ICP证041476号