歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> Solaris為單塊網卡配置多個IP

Solaris為單塊網卡配置多個IP

日期:2017/2/28 11:10:25   编辑:關於Unix


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 #網關地址
Copyright © Linux教程網 All Rights Reserved