Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default gateway 1

Status
Not open for further replies.

dragon67

MIS
Jan 30, 2001
9
0
0
US
I have already use ifconfig to add a local ip and subnetmask to my nic and I can ping locally, How do I add a default gateway to get on the net? Any help would be appreciated? Thanks.
 
Hi

I dont have any idea for defaultgateway but if u need to
get on the net..

You can also specify the address of your router manually. You do this by creating a file /etc/defaultrouter, with the IP address of the router in it. You'll need to reboot after creating this file. An easy way to create is is with echo:
echo 128.6.1.1 >/etc/defaultrouter
Replace 128.6.1.1 with the actual address of your router. You'll need to get this from your departmental liaison or the Network Operations Group.
Once you create this file and reboot, "netstat -n -r" should show a default route. If it doesn't, then there is a configuration error on your system. Probably someone has changed something they shouldn't have. When /etc/defaultrouter exists, in.rdisc and in.routed are not run, because the default route is taken directly from that file.
The advantage of creating this file is that you know you'll always have a default route, even if something was wrong when your machine is booted. However there are disadvantages:
First, it requires you to find the address of the router. Second, sometimes router address changes. This won't happen on a routine basis. if you have created /etc/defaultrouter, you'll have to update it to have the new address. If you let Solaris run the router discovery daemon, it will find the new router automatically.
Thus Network Operations recommends that you not create /etc/defaultrouter, but depend upon the router discovery daemon.

Test network connectivity
At this point you may wish to reboot your machine and verify that you can reach other portions of the network. (Some of the changes above do not take effect until the next reboot.) I suggest the following test:
/usr/sbin/ping 128.6.4.4
You should see
mysun# /usr/sbin/ping 128.6.4.4
128.6.4.4 is alive
If you see "no answer from 128.6.4.4", then you have a problem. It is possible that the machine 128.6.4.4 is down. (This particular machine should be one of the most reliable.) Other machines to try are 128.6.21.6 and 128.6.7.5. If you can't get to any of them, either you've got a problem or there are major problems with the campus network.
If you see the message
ICMP Host Unreachable from gateway geneva.rutgers.edu (128.6.26.11)
where the "gateway" is your own computer, you probably do not have a default route. Try "netstat -n -r" and verify that one of the lines has "default" in the first column. If not, see the previous section on setting up /etc/defaultrouter.
If you see a similar message, where the "gateway" is some other machine (probably with -gw at the end of its hostname), either the campus network is confused, or the hosts I've suggested no longer exist. (This is *very* unlikely. We have long-term commitments to the address 128.6.4.4.)
If you see "no answer" with no other error messages, it is possible that your have specified the wrong address in /etc/defaultrouter, that the campus network is confused, or that your system is somehow misconfigured in some other way.

Cheers

Venkat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top