Solved

sol9 gw setting

Posted on 2004-10-02
2
286 Views
Last Modified: 2013-12-27
Hi!

I have Solaris9, using the Gnome2 and CDE interface. I dont know where to set the default gateway. I have a local subnet - 192.168.0/24 and want to connect to the internet. Sol9 recognises the machines and the server (192.168.0.1) in the subnet but cant connect to the net. I have set everything except the gw, because I do not know how. Where can I access the network settings and how to configure them, for example add a different ip etc.

Thanks,

B.
0
Comment
Question by:MorganStanley
2 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 12206962
Create /etc/defaultrouter, set the mode to 644 and change the ownership to root:sys

This is a simple text file and should contain the IP address of the router to the Internet. So let's that that router's IP was 10.1.1.1, you might enter the following commands to achieve this (NOTE: I would be logged in, as root, at the system console using the Command-Line interface - and the "<CONTROL-D>" below is a key-sequence, don't actually type all those characters, just hold down the CONTROL key and press the D key and then release both):

# cd /etc
# cat > defaultrouter
10.1.1.1
<CONTROL-D>
# chown root:sys defaultrouter
# chmod 664 defaultrouter

You can then reboot the system:

# /usr/sbin/shutdown -i 6 -y -g 1

And when it comes back up it will know where the gateway router is.

A short-term fix for this is:

# route add default 10.1.1.1

Which will last until the next reboot. So you can do both ("route add" and create the "defaultrouter" file) and have it immediately effective without rebooting. I'm just old-fashioned and prefer to make sure everything that might need to know about that change is informed, and the easiest way to ensure that is a reboot. It probably unnecessary - like I said, I'm old-fashioned-cautious.
0
 

Accepted Solution

by:
karahalis earned 50 total points
ID: 12228982
You have probably already setup DNS but If not here is how you would. The /etc/nsswitch.conf file tells Solaris which naming services to use in which order. The /etc/resolv.conf file is the configuration file for the DNS client settings.

To setup the nsswitch.conf file for dns :

1. Make a backup of your old one
cp /etc/nsswitch.conf /etc/nswitch.old

2. Copy the nsswitch.dns file to nsswitch.conf to configure solaris to use DNS
cp /etc/nsswitch.dns /etc/nsswitch.conf

3. Set permissions
chown root:sys /etc/nsswitch.conf
chmod 664 /etc/nsswitch.conf

To setup the /etc/resolv.conf:

1. touch /etc/resolv.conf
2. Use a text editor to add the following lines to the /etc/resolv.conf file
domain yourcompany.com
nameserver 10.10.10.2 #where 10.10.10.2 is your primary dns server
nameserver 10.10.10.3 #where 10.10.10.3 is your secondary dns server
3. Save the /etc/resolv.conf file
4.  Set permissions on the /etc/resolv.conf
chown root:sys /etc/resolv.conf
chmod 664 /etc/resolv.conf
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question