Here are some general tips on setting up ones connection to a network. One may or may not have to use everything listed here. Just pick out what you need for your system.
#! /bin/sh
#
# Since the routers don't work correctly, we have to turn routed off and
# add static routes.
#
# Brent L. Bates 9508.22
#
if /etc/chkconfig routed; then :
exit
fi
case "$1" in
'start')
echo "Adding Static Routes"
route add net default `IP address or name of router' 0
route add net `another network' `IP address or name of router' 1
;;
'stop')
echo "Deleting Static Routes"
route delete net default `IP address or name of router'
route delete net `another network' `IP address or name of router'
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
----------------------- End of network.local -----------------------
Either list IP addresses above or use the router name AND have the router name listed in your /etc/hosts file.
Don't forget to do `chkconfig routed off', or the above script will NOT be run. Also see resolv.conf info below. For the other networks, if you have multiple routers/routes, either use the IP address or put the name and address in the file /etc/networks. Here are some sample lines from my /etc/networks file:
------------------------- Start of networks -------------------------nsf 128.150 national-science-foun-net larcnet 128.155 NASA-Langley-Net LaRCNET LaRCNET-Backbone lerc 128.156 NASA-Lewis-Net-------------------------- End of networks --------------------------
# gated.conf # # # The information in the file is identified by the keywords which commence # at the start of a new line. Any text to the right of a # is a comment. # To change initialization info after egpup is running, kill the process # (which will initiate the correct cease message exchange) and restart it. # Trace options #traceflags general # Don't use any of the fancy routing # protocols - just install some static routes RIP no HELLO no EGP no defaultgateway `IP address or name' rip metric 0 passive net `IP or name' gateway `IP or name' metric 1 rip------------------------ End of gated.conf ------------------------
$ROUTE $QUIET add net default xxx.xxx.xxx.xxx
For IRIX < 6.5, I have 3 types of lines in my /etc/resolv.conf file. The `hostresorder' line isn't used for IRIX >= 6.5 and the file /etc/nsswitch.conf replaces this lines functionality.
hostresorder local bind domain `your_domain_name_hear' nameserver `IP address of name server'
Use one's domain name in the second line. On the first line the `local' MUST be first. If one is also running NIS (Yellow pages), then one wants `nis' before `bind' but AFTER `local'. One can have up to 3 nameserver lines. It checks them in the order they are listed. If a server is down or doesn't resolve the name, it goes to the next name server. Make sure all the name servers listed still work. If a name server is permanently out, delete it from the list or one could have problems. Some old software looks for the resolv.conf file in a different directory so put a symbolic link in /usr/etc/resolv.conf pointing to /etc/resolv.conf. (The last sentence isn't needed for IRIX 6.2 or greater. Just have the file in /etc.)
For IRIX >= 6.5, make sure one has a line in their /etc/nsswitch.conf file that looks like this:
hosts: files dns
The same rules listed above for the `hostresorder' line also apply to this line as well (`local' is replaced with `files' and `bind' is replaced with `dns'). If one isn't using NIS at all, delete all references to `nis' in this file. If one is using NIS, then `nis' should be AFTER `files' but before `dns'. I also have the following in the /etc/config/nsd.options file:
-a nis_security=local -a wait_for_server=true -a negative_timeout=0
One also needs at least a minimal /etc/hosts file. One needs at a MINIMUM two lines in their /etc/hosts file. One like the following:
127.0.0.1 localhost loopback loghost me
and one with YOUR machines IP address, the FQDN, and maybe some other aliases. One MUST use the FQDN AND it MUST be listed as the FIRST name with in that line. I would ALSO add entries for a few local hosts that one wants to get to even if the network connections are lost to all the name servers. This includes machines one mounts/shares NFS mounts with. The file /etc/sys_id should have the short alias name and not the FQDN.
If one is having intermittent DNS problems, instead of rebooting, one might want to try using `nsadmin restart'. Every once in a while, I'll see DNS time out on a lot of look ups. After a `nsadmin restart', DNS works fine. The `nslookup' command does not go through `nsd', it only uses the /etc/resolv.conf, so one can use this to test name servers with out going through `nsd'.
I hope this is of some help.
If you have any comments on any of my pages, please email me at: blbates@vigyan.com, thanks.
Total number of accesses to this page since its creation :
Last update: August 19, 2002