From: wilcox@kpw104 (Ken Wilcox) Subject: Re: Help: SIOCADDRT error running /etc/route in NET-2 Date: 8 Oct 1993 14:40:56 GMT
Hello all,
I think that I can give some insight to this SIOCADDRT problem.
The rc.inet1 adds the default route to be your own IP addr. This is the
line that gives you the error. I am a sysadmin for a Sun network here and
we don't add the the route for the local machine IP address. ie each machine
does not add it's own address as a route. All of the clients of the server's
add the server as a gateway. One route. All of the servers add the router
for the network and all of the other server's.
Correct me if I am wrong but route only gives you a route off your wire.
that should be all that you need is the one route to get to the gateway.
Enclosed is a little map of our network to make things make sense.
===========================================================
(Campus Backbone) |
|
=================RT========================================
(Our backbone) | | | | | | |
| | | | | | |
MS SS SS SS SS SS SS
| | | | | |
| | | | | |
CW CW CW CW CW CW
RT = Router
MS = Master Server(NIS)
SS = Slave Server (NIS) Gateway
CW = Client Wires (multi- clients on one wire)
The following are examples of our route config.
Example of SS (above)
Machine IP addr = 128.186.130.3, 128.186.131.65 (gateway for CW)---
|
echo "Configuring static routes:" |
route add default 128.186.130.1 1 (Router addr) |
route add net 128.186.130.192 128.186.130.6 1 (Rest of servers) |
route add net 128.186.130.128 128.186.130.4 2 |
route add net 128.186.130.64 128.186.130.7 1 |
route add net 128.186.131.192 128.186.130.5 1 |
route add net 128.186.131.128 128.186.130.4 1 |
|
Example of a client |
Machine IP addr 128.186.131.78 |
|
echo "Configuring static routes:" |
route add default 128.186.131.65 1---------------------------------
As you can see none ever add their own IP as a route.
My machine works...(the one that I am posting from now.)
Here is what the rc.net (I changed it) looks like:
# /etc/rc.net
# Linux networking startup script. Should be run by /etc/rc.local at
# boot time. Configures the interfaces and starts the deamons.
# It assumes hostname has been set.
#
#
echo -n "[/etc/rc.net:] "
HOSTS=/etc/hosts
INETD=/etc/inetd
NAMED=/etc/named
PORTMAP=/etc/portmap
NFSD=/etc/nfsd
MOUNTD=/etc/mountd
IPDEV=eth0
HOSTNAME=`hostname`
# This needs more testing and more diagnostics. */
IPADDR=`grep "^[^#]*\b$HOSTNAME\b" $HOSTS | cut -f1`
echo -n "[$HOSTNAME($IPADDR)]"
IPADDR=128.118.193.58
ROUTER=128.118.193.1
NETWORK=128.118.193.0
BROADCAST=128.118.193.255
NETMASK=255.255.255.0
ifconfig lo 127.0.0.1 up netmask 255.255.255.0
route add 127.0.0.1 lo
ifconfig eth0 $IPADDR netmask $NETMASK broadcast $BROADCAST
route add $NETWORK
route add default gw $ROUTER
B
if [ -x $PORTMAP ]; then
echo -n "[ `basename $PORTMAP`]"
$PORTMAP
fi
if [ -x $INETD ]; then
echo -n "[ `basename $INETD`]"
$INETD
fi
if [ -x $MOUNTD ]; then
echo -n "[ `basename $MOUNTD`]"
$MOUNTD
fi
echo ""
I hope this helps some people that are having this problem
-Ken Wilcox