Q: I have a Cable Modem or DSL connection and I am using a router/sharing
device (i.e. Linksys, Netgear, UGate, etc...) to hook up several PCs to my
broadband connection. How do I add my Sun box to the network so I can surf
the web and check email from it, etc?
A:
NOTE: This solution is assuming you don't have a configured network connection
on your computer. It will start you from the very beginning, undoing any
configuration that has been previously done. Make sure you're plugged into
your hub/router before starting.
SUMMARY:
1) Edit the /etc/hosts, /etc/netmasks and /etc/hostname.hme0 files.
2) Edit /etc/resolv.conf and add your DNS server(s).
3) Edit /etc/defaultrouter and add your router's IP address.
4) Overwrite the /etc/nsswitch.conf file with the /etc/nsswitch.dns file.
5) Restart network services or just reboot the machine.
6) Test the connection.
DETAILED:
You will have to edit various configuration files on your Solaris box. In
order to do so, you need to do some preparatory "information gathering" work.
Gather the following:
(A) the IP addresses for your ISP's DNS servers
(B) the internal (private) IP address of your sharing device
(C) the IP address range and subnet mask of the machines currently on the
network
(D) an unused IP address in that address range
Once you have gathered that information, you can start configuring the connection:
1) Edit the /etc/hosts, /etc/netmasks and /etc/hostname.hme0 files. I've
grouped these files together, because they are the files responsible for
'setting up' the network interface itself. After editing just these files
in Step 1, you should be able to communicate with other machines on your
LAN. The rest of the steps are just required for connecting to the Internet.
First we will edit the /etc/hosts file. Type:
vi /etc/hosts
Edit the file to look like the following:
127.0.0.1 localhost
192.168.0.5 poe loghost
My system's hostname is "poe", you should substitute your system's hostname
in place of it. Save the file and quit.
Next we will create the /etc/netmasks file with the necessary configuration
information. Type:
echo 192.168.0.0 255.255.255.0 > /etc/netmasks
Finally, we'll create /etc/hostname.hme0 file:
echo poe > /etc/hostname.hme0
Again, remember to use the same hostname as you did in the /etc/hosts file.
2) Edit /etc/resolv.conf and add your DNS server(s). Type:
vi /etc/resolv.conf
The file will probably not exist at this point, so it will be blank. Add
your DNS servers, using the following format:
nameserver 12.34.56.78
nameserver 98.76.54.32
Although you can use a single space between the word "nameserver" and the
IP address, it is recommended that you use a TAB, for readability. You only
need to enter one DNS server. However, if there is ever a problem with that
DNS server, your machine will be unable to resolve domain names. It is recommended
that you enter at least two DNS servers. Once you have entered this information,
save the file and quit.
3) Edit /etc/defaultrouter and add your router's IP address. Type:
vi /etc/defaultrouter
This file will also not exist by default, so it will also be blank. This
file should only contain the IP address of your gateway (the sharing device)
on a line by itself. The file will look something like this:
192.168.0.1
Save the file and and quit.
4) Overwrite the /etc/nsswitch.conf file with the /etc/nsswitch.dns file.
Type:
cp /etc/nsswitch.dns /etc/nsswitch.conf
5) Restart the machine. Type:
init 6
6) After it reboots, test the connection. Type:
ping anysystem.com
ping sunsolve.com
One site or the other (or both) may be down on occasion. If so, test other
popular domains, such as yahoo.com, amazon.com, etc. If none of them work,
go back and check all the files you have edited to make sure there are no
mistakes, such as commas instead of periods, wrong numbers, etc.