免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1619 | 回复: 0
打印 上一主题 下一主题

Solaris为单块网卡配置多个IP [复制链接]

论坛徽章:
1
15-16赛季CBA联赛之北控
日期:2022-03-04 22:35:50
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-29 13:12 |只看该作者 |倒序浏览

作者: 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 #网关地址

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_715387.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP