Solved

sol9 gw setting

Posted on 2004-10-02
2
285 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now