Based on instructions from http://dd-b.net/ddbcms/2009/01/opensolaris-static-ip/
1 | pfexec bash |
Find your network interface (hint, not lo0):
1 | MYNIC=$( ifconfig -a | grep -v lo0 | grep IPv4 | sed 's/:.*//g' ) |
Enable network, disable NWAM:
1 | svcadm enable physical:default |
Backup hosts file:
1 | cp /etc/hosts /etc/hosts.bak |
Comment existing, populate with 2 entries:
1 | cat /etc/hosts.bak | sed 's/^/#/g' > /etc/hosts |
Check that you have DNS servers in /etc/resolv.conf
, otherwise, overwrite with the Google and OpenDNS ones:
1 | cp /etc/resolv.conf /etc/resolv.conf.bak |
Tell name server service to look at DNS for hosts:
1 | cp /etc/nsswitch.dns /etc/nsswitch.conf |
Save nic settings in file:
1 | HOSTNIC=/etc/hostname.$MYNIC |
Manually set IP:
1 | ifconfig $MYNIC $MYIP netmask $MYSUBMASK up |
Add default route:
1 | route add 0.0.0.0 $MYROUTER |
Check that your default gateway/router is marked as default:
1 | netstat -rn |
Check that your IP is set:
1 | ifconfig $MYNIC |