How to get a Solaris box online
Notes:
- I've done this many times on
Solaris 2.6. Other versions may or may not be different and may or may not work.
- The following assumes a static
IP address, a full-time Ethernet network connection, and the desire to use DNS
for name resolution.
- This information is provided as
a courtesy. It may or may not be accurate and it may or may not work for you.
Use at your own risk.
1. Log in as root
2. cd /etc
3. Edit /etc/hostname.hme0
This file should contain the hostname of your machine, without the domain
name. So, if the FQDN (Fully Qualified Domain Name = hostname + domain name)
is solaris-box-1.yourdomain.com, the file should look like this:
# cat hostname.hme0
solaris-box-1
This assumes that your Ethernet adatper is hme0, the default device name
for the first Ethernet adapter.
4. Set up your /etc/hosts file.
It should look something like this:
127.0.0.1 localhost
192.168.0.150 solaris-box-1 solaris-box-1.yourdomain.com loghost
Make sure the second line has the correct IP address, hostname, and FQDN.
The first line is the loopback entry. Along with #5, Solaris will know its
name and IP address.
5. Create or edit /etc/nodename
Contains the hostname of the computer (same as hostname.hme0).
# cat nodename
solaris-box-1
6. Create or edit /etc/defaultrouter
Surprisingly enough, this file contains the IP address of your default router
(or gateway). When you reboot and the network initialization scripts run,
it will add a default route to the IP address in this file.
# cat defaultrouter
192.168.0.1
Now it knows about it's own network parameters and it's time to get it to use
DNS. The next steps will tell it to use other nameservers. If you want to set
up a nameserver on the local machine, see the man page for named.
7. Edit /etc/nsswitch.conf
If you haven't edited this file before, it should look suspiciously like like this:
passwd: files
group: files
hosts: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files
Add the word 'dns' after 'files' on the 'hosts' line:
passwd: files
group: files
hosts: files dns
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files
Now it knows to query a nameserver when looking up a name. Next we have to
tell it what nameservers to use:
8. Create or edit /etc/resolv.conf
Here you tell it three things:
- What domain we're in
- Specify any additional search domains
- What the nameservers are (it will use them in the order you put them in the file)
When you're done it should look something like this:
# cat resolv.conf
domain yourdomain.com
search yourdomain.com
search client1.com
nameserver 192.168.0.9
nameserver 192.168.0.11
For more information, see the man page for resolv.conf.
9. Reboot
# sync;sync;sync
# reboot
You should now be normally online. If not, check everything above; if it's correct, try
- ping your gateway
- ping a machine on your local network
- ping your nameservers
- ping a well-known host, like www.yahoo.com
10. Go to www.sunfreeware.com
and download some stuff.
They maintain a fairly comprehensive archive of free software precompiled for various versions of Solaris.
It'll make your life a lot easier, especially if your home environment is Linux.
Packages I suggest are:
| Program |
Function |
| joe |
editor |
| pico |
editor (required to run pine w/o any additional configuration) |
| pine |
email client |
| gzip |
file compression |
| tar |
GNU tar, more flexible and includes gzip file compression |
| gcc |
GNU C compiler |
| gdb |
GNU debugger |
| top |
memory monitoring tool |
| perl |
scripting language |
| bash |
shell |
| apache |
web server |
| less |
text paginator (use instead of more) |
That's about it. If you have any comments or corrections, please email me at
nick@pantsblazing.com.
Author: Nick Grossman
Last Updated: 5/30/2000
|