Solaris 10 X86 新增網卡的設定

我是在VirtualBox中安裝Solaris 10,原本設定一個網卡,後來因為測試需要,
所以又增加了兩個網卡,開機後只有原來的網卡可以使用,新增的網卡全都無法使用。
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.10.1.100 netmask ffffff00 broadcast 10.10.1.255
        ether 8:0:27:4:b7:5b

先檢查有沒有抓到網卡,底下顯示有識別到新的網卡
bash-3.00# dmesg |grep mac
Jan 16 14:40:23 sol mac: [ID 469746 kern.info] NOTICE: e1000g0 registered
Jan 16 14:41:19 sol mac: [ID 469746 kern.info] NOTICE: e1000g1 registered
Jan 16 14:41:20 sol mac: [ID 469746 kern.info] NOTICE: e1000g2 registered
Jan 16 14:46:13 sol mac: [ID 736570 kern.info] NOTICE: e1000g1 unregistered
Jan 16 14:46:13 sol mac: [ID 736570 kern.info] NOTICE: e1000g2 unregistered
Jan 16 15:14:06 sol mac: [ID 469746 kern.info] NOTICE: e1000g1 registered
Jan 16 15:14:07 sol mac: [ID 469746 kern.info] NOTICE: e1000g2 registered

利用dladm查詢網卡的狀態,三張網卡都是up。
bash-3.00# dladm show-dev
e1000g0         link: up        speed: 1000  Mbps       duplex: full
e1000g1         link: up        speed: 1000  Mbps       duplex: full
e1000g2         link: up        speed: 1000  Mbps       duplex: full

直接加入e1000g1
bash-3.00# ifconfig e1000g1 plumb
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.10.1.100 netmask ffffff00 broadcast 10.10.1.255
        ether 8:0:27:4:b7:5b
e1000g1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 0.0.0.0 netmask 0
        ether 8:0:27:b8:88:8c
         
加入e1000g2
bash-3.00# ifconfig e1000g2 plumb
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.10.1.100 netmask ffffff00 broadcast 10.10.1.255
        ether 8:0:27:4:b7:5b
e1000g1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 0.0.0.0 netmask 0
        ether 8:0:27:b8:88:8c
e1000g2: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 0.0.0.0 netmask 0
        ether 8:0:27:9:78:fc

上面看的出來新的網卡並沒有IP,接著可以直接設定IP給它,不過開機後就會消失了。
bash-3.00# ifconfig e1000g1 10.10.1.101 netmask 255.255.255.0

增加IP的設定到/etc內,檔案名稱為hostname.<介面名>,例如:e1000g0 --> hostname.e1000g0
新增文字檔hostname.e1000g1,並加入IP如下:
10.10.1.101

再新增文字檔hostname.e1000g2,並加入IP如下:
10.10.1.102

這樣重開機後就不用重設IP了