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




版权声明: 原创作品,容许转载,转载时请务必以超链接形式标明文章 原始来由 、作者信息和本声明。否则将深究法律责任。

原文地址:https://www.cnblogs.com/zgqjymx/p/1973799.html