I have a Cable Modem or DSL connection (or some type of broadband) 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?

UNFINISHED:

  • – re-read and complete

A: This solution is assuming you don’t have a configured network connection on your Sun box. It will start you from the very beginning, undoing any configuration that has been previously done. Make sure you’ve got a network cable plugged into your hub/router before starting.

NOTE: This solution is assuming that your internal network is using a class C (192.168.x.x) address space. If this is not the case, just substitute your address space in the appropriate places (the next most popular address space is class A — 10.0.0.x)

NOTE2: This solution is also using hme0 as an example. Depending on which Sun machine or add-on network card you are using, you will have to replace it with hme1, qfe0, eri0, etc

SUMMARY:

  1. Gather information about your network setup.
  2. Edit the /etc/hosts, /etc/netmasks and /etc/hostname.hme0 files.
  3. Edit /etc/resolv.conf and add your DNS server(s).
  4. Edit /etc/defaultrouter and add your router’s IP address.
  5. Overwrite the /etc/nsswitch.conf file with the /etc/nsswitch.dns file.
  6. Restart network services or just reboot the machine.
  7. Test the connection.

DETAILED:
1) Gather information about your network setup.

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 (or you can use these from OpenDNS)
(B) the internal (private) IP address of your sharing device (usually called your Default Router)
(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:

2) 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 the files in this step, 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

A few things to note: The first line should already be there. My system’s hostname is “poe”, you should substitute your system’s hostname in place of it. My IP address is 192.168.0.5 — make sure you substitute your IP in this spot.

Save the file and quit. (You’ll need some vi skills for this.)

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.

3) Edit /etc/resolv.conf and add your DNS server(s).

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 208.67.222.222
nameserver 208.67.220.220

Although you can use a space between the word “nameserver” and the IP address, I recommend that you use a TAB for readability.

In the example above, I used the IP Addresses for the DNS servers provided by OpenDNS. You should substitute your own ISP’s DNS servers if you know the IP addresses.

You are only required 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, so it’s common practice to enter at least two DNS servers. Once you have entered this information, save the file and quit.

4) Edit /etc/defaultrouter and add your router’s IP address.

Type:

vi /etc/defaultrouter

Just like resolv.conf, this file will not exist by default, so it should also be blank when you open it in vi. Your defaultrouter file will only contain the IP address of your gateway (the sharing device) on a line by itself. The file will look something like this when you’re edited it properly:

192.168.0.1

Save the file and and quit.

5) Overwrite the /etc/nsswitch.conf file with the /etc/nsswitch.dns file.

Type:

cp /etc/nsswitch.dns /etc/nsswitch.conf

6) Restart network services or just reboot the machine.

To reboot the machine, type:

init 6

7) After it reboots, test the connection.

Once the machine reboots, type something like

ping 3113.com

or

ping sunsolve.com

This will go out to the internet and try to resolve the domain name to an IP address, so it can then ping that IP address. This is a good test to perform to make sure that the setup you’ve just done is working.

NOTE: One site or the other (or both) may be down on occasion. Frankly, if you are not getting a response from either one, chances are there’s something wrong with your setup. However, you can test other popular domains, such as google.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.

Still not working?

Some common errors:

  • the file is /etc/resolv.conf — NOT /etc/resolve.conf (i.e. no “e” at the end of resolv)
  • nameserver is all one word, no spaces (i.e. not name server or name-server)
  • go back and double check your IP addresses, did you fat finger one or miss a period?
  • if you have double checked everything and it’s still not working – triple check it, with an eye towards minute details like missing (or extra) dots, commas, spaces, letters, etc. . it’s always the little things that will trip you up.

PS: Don’t forget to stop by AnySystem.com for all your Sun server needs.

Comments are closed.