Solaris IPアドレスの追加・変更

Solaris10 x86版でIPアドレスの追加・変更を行う。

■IPアドレスの追加

/etc/hostname.hme0  (コピーして増やす) 
/etc/hostname.hme0:1
/etc/hostname.hme0:2
/etc/hostname.hme0:3

/etc/hostname.iprb0  (今使っているx86だとiprb0だった) 
/etc/hostname.iprb0:1  
/etc/hostname.iprb0:2

 というように増やして、ホスト名を書き換えておく。

■/etc/hosts

上で、追加したホスト名のIPアドレスを記述する。

127.0.0.1       localhost       
10.197.26.28    www www.mydomain.com    loghost
10.197.26.24    www2 www2.mydomain.com
10.197.26.29    www3 www3.mydomain.com
203.216.247.225 www.yahoo.co.jp


■再起動して有効にする

# /usr/sbin/shutdown -y -i6 -g0 

-i0  停止
-i6  再起動  (-i0は停止)
-g0  0秒後に

■再起動せずに有効にする

(起動するだけなら)
# ifconfig  /etc/hostname.iprb0:1 up
(再起動する)
# ifconfig  /etc/hostname.iprb0:1 down ; ifconfig  /etc/hostname.iprb0:1 up
(確認する)
# ifconfig -a

■/etc/nodename(ホスト名)

  bdtowns8 

■/etc/resolv.conf

domain mydomain.com 
nameserver 172.16.164.33
search mydomain.com

■/etc/netmasks(ルータの場合、複数行)

  10.197.26.0     255.255.255.0 

■/etc/defaultrouter(デフォルトルート)

  10.197.26.1 

■/etc/nsswitch.conf と /etc/nsswitch.dns

  hosts:  files dns  

編集後、/etc/init.d/nscdを再起動する。

#/etc/init.d/nscd stop
#/etc/init.d/nscd start