Looking for UNIX and IT expertise? Why not get in touch and see how we can help?
Having covered how to manually configure ethernet interfaces in Solaris, I’ll now go over configuring the DHCP client. Solaris comes bundled with both a DHCP client and server, but here we just want to configure the client to go out and configure a Solaris ethernet interface.
Instead of a hostname.<interface> file, you need to create two empty files – dhcp.<interface> and hostname.<interface>, in the /etc/directory
bash-3.2$ touch /etc/dhcp.e1000g0
bash-3.2$ touch /etc/hostname.e1000g0
Reboot for the changes to take effect.
NOTE: you can have either DHCP or a static IP address – so double check which files are in place under /etc and what their contents are.
DHCP can be checked with the following commands:
bash-3.2$ /usr/sbin/ifconfig e1000g0 dhcp status
And you can release the DHCP lease with:
bash-3.2$ /usr/sbin/ifconfig e1000g0 dhcp release
DHCP from within VMWare will allocate a default router and DNS settings automatically to your Solaris VM. To enable this to work properly, both /etc/defaultrouter and /etc/resolv.conf must be present, but empty.
If these files already exist, just delete them:
bash-3.2$ rm /etc/defaultrouter
bash-3.2$ rm /etc/resolv.conf
Then recreate them as empty files with the touch command:
bash-3.2$ touch /etc/defaultrouter
bash-3.2$ touch /etc/resolv.conf
Now reboot and note the new settings take effect.
Looking for UNIX and IT expertise? Why not get in touch and see how we can help?
Recently I’ve had several clients who’ve just started with Solaris, and who have had roughly similar questions. So I thought I’d put up a few “How To” posts covering some Solaris basics.
Each LAN interface in Solaris has a configuration file in /etc which is named after the interface name and it’s instance.
So, let’s assume that you have two e1000g interfaces configured – you’d have two configuration files:
/etc/hostname.e1000g0
/etc/hostname.e1000g1
These files will just contain a hostname, which maps to an entry in /etc/hosts.
An example from my OpenSolaris development workstation:
bash-3.2$ cat /etc/hostname.e1000g0
grond
And this is /etc/hosts:
# Internet host table
#
::1 grond grond.local localhost loghost
127.0.0.1 localhost
192.168.13.100 grond grond.local loghost
When Solaris boots, all it does to configure a LAN interface is look for hostname.* files in /etc. It then looks up the hostname in /etc/hosts to find out the IP address, then configures the interface.
So if you need to change the IP address of a LAN interface in Solaris, all you need to do is edit the hostname entry in /etc/hosts and reboot. For example, to change grond’s e1000g0 IP address to a different subnet, /etc/hosts would be modified to:
# Internet host table
#
::1 grond grond.local localhost loghost
127.0.0.1 localhost
192.168.125.100 grond grond.local loghost
Then reboot the host for the changes to take effect.