Sunday, February 2, 2014

Quick way to configure Statis IP in Virtual-box Solaris 11 Guest

root@solaris:~# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --

root@solaris:~# ipadm delete-ip net0

root@solaris:~# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --


root@solaris:~# ipadm create-ip net0

root@solaris:~# ipadm create-addr -T static -a 192.168.6.101/24 net0

root@solaris:~# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --

root@solaris:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           static   ok           192.168.6.101/24
lo0/v6            static   ok           ::1/128



Configure default gateway

root@solaris112:~# route -p show
No persistent routes are defined
root@solaris112:~# route -p add default 192.168.6.2
add net default: gateway 192.168.6.2: entry exists
add persistent net default: gateway 192.168.6.2
root@solaris112:~# route -p add -net 192.168.6.0 -gateway 192.168.6.2
add net 192.168.6.0: gateway 192.168.6.2: entry exists
add persistent net 192.168.6.0: gateway 192.168.6.2
root@solaris112:~# route -p show
persistent: route add default 192.168.6.2
persistent: route add -net 192.168.6.0 -gateway 192.168.6.2

Configure DNS Client

root@solaris112:~# svccfg  -s "dns/client" setprop 'config/nameserver = net_address: ( 192.168.6.2 )'
root@solaris112:~# svccfg  -s "dns/client" setprop 'config/domain = astring: ("dbaglobe.com")'
root@solaris112:~# svccfg -s "name-service/switch" setprop 'config/host = astring: "files dns"'
root@solaris112:~# svccfg  -s "dns/client" listprop 'config/nameserver'
config/nameserver net_address 192.168.6.2
root@solaris112:~# svccfg  -s "dns/client" listprop 'config/domain'
config/domain astring     dbaglobe.com
root@solaris112:~# svccfg  -s "name-service/switch" listprop 'config/nameserver'
root@solaris112:~# svccfg  -s "name-service/switch" listprop 'config/host'
config/host astring     "files dns"
root@solaris112:~# svcadm refresh name-service/switch
root@solaris112:~# svcadm enable dns/client