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!

Adding static routes to /etc/rc.net

Status
Not open for further replies.

mitchymartell

IS-IT--Management
Mar 23, 2001
10
0
0
US
I am attempting to add static routes to /etc/rc.net but on system reboot I get errors returned in the /tmp/rc.net.out file indicating the route add commands issued for establishing the static routes failed. It gives a message of "file already exists".
Its's as though routes are already established for these and my additional route add commands are not being allowed to execute.

Any clues ?

- thank-you, mitchymartell ( famous french race car driver)
 
Maybe they are really in the odm already? They get recreated at reboot,
which if they are already in the odm you do not need in the rc.net file….

You could check the netstat -rn and see if the routes exist after reboot?
Do they have a c next to them meaning cloned routes? If so you can
turn off cloned routing (see below)


Check to see if there are there in the ODM? Did someone add them through smit mkroute?
lsattr -El inet0 to see if they are in the database……
If they are not in the database, you should be able to add them
in the rc.net file… If they are not in the ODM, and you still can't add them, well I don't know...that is strange.....

.But if they exist in the ODM you can delete them first
if you want to do it manually in the rc.net file.

-----------------------------------------
Routes Routes You have to Have Routes!
To create/delete routes in AIX.
the chinet command (which smitty route uses) stores the route in the ODM.
These types of routes will be automatically recreated upon reboot.

OR the route add/delete command
Which creates the route, but does not store them in the ODM and hence are
lost upon reboot (unless a script is run from /etc/inittab to recreate them or
add to /etc/rc.net).

How do you tell if a route is in the ODM or not (besides rebooting to see if
it comes back)?
lsattr -El inet0

How do you clear a routing table? route -f (flush)

Add static routes with smitty smit mkroute or :
chdev -l inet0 -a addroute=XXXXXXXXXXXXXXXXXX
Remove static routes with smitty smit rmroute :
chdev -l inet0 -a delroute=XXXXXXXXXXXXXXXXXX

chdev -l inet0 -a delroute=net,destination_address,gateway,subnet_mask -
chdev calls a routine that will delete the route from the ODM.
================================================

Cloning routes in 4.3.3
add to rc.net also......They need to be before /usr/lib/methods/definet.
#no -o tcp_pmtu_discover=0
#no -o udp_pmtu_discover=0
. This values are set to 1 by default in AIX 4.3.3.
Which means clone routes....if you don't want cloned
routes change to zero.

Here is where it is (near the bottom) in the rc.net file:
at the very bottom..... /usr/sbin/no -o extendednetstats=0 >>/dev/null 2>&1
if [ -f /usr/sbin/no ] ; then
/usr/sbin/no -o tcp_sendspace=65536
/usr/sbin/no -o tcp_recvspace=65536
/usr/sbin/no -o ipforwarding=1
/usr/sbin/no -o tcp_pmtu_discover=0
/usr/sbin/no -o udp_pmtu_discover=0
fi
#-)
 
One last thing....there were tons of patches for bos.net.tcp in 4.3.3
In fact there were a lot of routing problems with early 4.3.3.0

lslpp -l | grep bos.net
and see what bos.net.tcp is at.... 4.3.3.31
and bos.net.tcp.server is at 4.3.3.29

instfix -k | grep ML
and see what maintnenace level you are at. Remember that AIX 433 is now up to
maintenance level 7
AIX 4.3.3:
IY16465 - Recommended Maintenance Level 4.3.3.0-07
IY15741 - Patch to Installfix
IY16583 - Latest Updates as of February 2001(must have 433-06 maint first)
IY15351 - Latest Updates as of December 2000
IY14072 - LATEST AIX 4.3.3 UPDATES AS OF OCTOBER 2000
IY12054 Recommended Maintenance Level 4.3.3.0-06


Good Luck. Maybe someone else has a better suggestion.
#-)
 
aixqueen,

Thank-you so much for your timely and most insightful reply !!

I have ran the commands on my system as you have stated ( by the way, I'm running AIX 4.1.5) in your email and it looks like the problem is in the ODM upon system startup. I have taken all static route commands out of rc.net, therefore routes that are added at system startup are what is in the ODM. But, the /tmp/rc.net.out log file indicates it can not establish these routes saved in the ODM. I have included output from the rc.net.out file. Why the ODM is having problems adding these at system startup is the question I can't answer.

thanks again for your help ...... mitchy

inet0
ibm161ap04
writing to routing socket: File exists
161.24.8.10 net 161.19.34.101: gateway 161.24.8.10: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -net -hopcount 1 -netmask 255.255.252.0 161.19.34.101 161.24.8.10 failed.
writing to routing socket: File exists
161.24.1.251 net 161.24.19.250: gateway 161.24.1.251: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -host -hopcount 1 -netmask 255.255.255.0 161.24.19.250 161.24.1.251 failed.
writing to routing socket: File exists
161.24.8.10 net 161.19.34: gateway 161.24.8.10: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -net -hopcount 1 -netmask 255.255.255.0 161.19.34 161.24.8.10 failed.
writing to routing socket: File exists
24.1.0.252 net 161.24.18: gateway 161: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -net -hopcount 1 -netmask 255.255.255.0 161.24.18 161.24.1.0.252 failed.
writing to routing socket: File exists
161.24.1.251 net 161.24.19.250: gateway 161.24.1.251: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -host -hopcount 1 -netmask 255.255.0.0 161.24.19.250 161.24.1.251 failed.
writing to routing socket: File exists
161.24.1.251 net 161.24.21.0: gateway 161.24.1.251: File exists
ioctl returns 17
0821-103: The command /usr/sbin/route add -net -hopcount 1 -netmask 255.255.255.0 161.24.21.0 161.24.1.251 failed.
l
 
I don't know that is strange........... maybe someone else will have a
suggestion....when you ran the lsattr -El inet0 did it show the routes?

When did this start....(what caused it) Did it ever work? Did someone add
something that now causes the problems? If it worked before and now it
doesn't something had to change. Did someone try to add things and
they got corrupt? Do you have more than one card? Did you change the IP?
You can flush the routing tables....and delete the ethernet
setting and start again and see if it makes a difference...
===================

There is a maintenance level patches for 4.1.5 as well...
AIX 4.1.5:
IX73330 RECOMMENDED Maintenance Level(4150-01)
IX85586 March 99
IX85019 Dec 98

My thought would be to flush the ODM.... in smit (remember to write them
down...same with the IP and type of cable and subnet mask and gateway...
and maybe delete the ethernet settings and try again

if the default ethernet....
ifconfig en0 down
ifconfig en0 detach
rmdev -dl en0
cfgmgr
(et0 if you have it defined also....)
then go back in and redo the ethernet connection with smit tcpip

Either way, you will be down when you do that....but maybe it will remove the
corruption. Good luck...
 

One last note...be careful...if you do the ifconfig and the rmdev, you are
removing whatever setting you had for your ethernet...tuning etc....and if you
have anything nfs mounted or DNS dependent, you are removing all settings
for the ethernet in the database
and you could be left with no one logging in...unless you can redefine it
quickly.......You can also remove the adapter....

rmdev -dl ent0 ...and the cfgmgr will recreate it..

ifconfig en0 down
ifconfig en0 detach
rmdev -dl en0
rmdev -dl ent0
cfgmgr

Other than that...if the following doesnt fix it .........If it just started happening....
you could restore from a mksysb before the problem....
(after backing up your data and restoring it)
But these are drastic moves....

Cloning routes was a problem in 4.3.3 only...not 4.1.5

The levels for software for 4.1.5
were 4.1.5.29 for bos.net.tcp.client
and 4.1.5.26 for bos.net.tcp.server

Bye and good luck....hope someone else has a suggestion...You might end up
calling IBM on this.......
 
I little point: Don't do these route mods in rc.net... do the modifications in rc.tcpip.


I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top