My task is to verify that all current routes will be preserved after a reboot of AIX 6.1 and 7.1 systems, i.e., I want to verify the system will reboot and build the current routing table with a script that can be run periodically. We have had instances where operators have added routes without adding the information to the ODM. Everything is fine until the system is rebooted weeks or months later. The system comes up and is missing routes. Managers and customers are upset with the down time. You get the idea. We've all been there.
First of all, I'm new to AIX but not to UNIX. I've been using RHEL lately, so my Solaris and IRIX knowledge is rusting away from disuse. ;-)
If there is an AIX tool to verify the ODM and current routing table match, I'd love to use it!
If not, my plan is to gather information from
odmget -q "attribute=route" CuAt
or
lsattr -El inet0 -a route -F value
to compare with the output of netstat -rn. Unfortunately, I do not understand how the system parses this information to build the routing table at boot time. I've looked at a couple systems. Selected output of the lsattr command from above looks something like this.
net,-hopcount,0,,0,10.20.225.1 net,-hopcount,0,-netmask,255.255.255.0,,,10.29.200.0,10.22.160.5 net,10.20.226.0,-netmask,255.255.254.0,10.20.225.1 net,-hopcount,0,-netmask,255.255.255.0,,,10.19.215.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.192.0,,,,,10.22.125.0,10.22.160.5 [many more with this format] net,-hopcount,0,-netmask,255.255.255.0,,,,,10.10.10.0,10.22.160.5 net,,0,10.20.225.1 net,-hopcount,0,-netmask,255.255.254.0,-if,en1,,,,-static,10.20.245.0,10.22.160.5net,-hopcount,0,,0,10.20.225.1 net,-hopcount,0,,,,,,-static,170.225.25.40,10.22.135.5 net,-hopcount,0,,,,,,-static,170.225.25.40,10.22.195.5 net,-hopcount,0,-netmask,255.255.255.0,,,,,-static,10.0.1.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.255.0,-if,en1,,,,-static,10.0.5.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.255.0,-if,en1,,,,-static,10.10.10.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.240.0,-if,en1,,,,-static,10.10.20.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.240.0,-if,en1,,,,-static,10.19.25.0,10.22.160.5 net,-hopcount,0,-netmask,255.255.255.0,-if,en1,,,,-static,10.20.5.0,10.22.160.5 host,-hopcount,0,,-if,en1,,,,-static,170.225.25.40,10.22.160.5
(I've changed the IPs a bit, but not netmasks or other values. If you find a networking error, it's my fault. I'm trying to discover the syntax/layout, not verify routing.)
My machines have interfaces like en0, en1, en2. I don't see references to all of them. I don't see any explicit mention of the loopback or default routes, but I think I see them. (The default route has the values -hopcount,0,,0?)
What script or process reads the ODM and converts it to a routing table? If I read that, I can probably work out how the routing table is built. Barring that, is there an on-line document describing or simple explanation of how it is done?
Should I be using different commands to pull information from the ODM? Perhaps smitty has something that can help me?
I've looked at all the other questions with the "aix" tag (There are only 97 of them.) and not found anything like this. Mr. Google hasn't turned up anything useful (to me) after a day of searching. The man pages do not give me enough detail regarding lsattr output or how the routing table is created. Obviously, I'm missing something.
I realize I could just save the output of netstat -rn when the machine is booted and periodically compare that with the current values, but it won't tell me if the ODM has changed, and I'd really like to learn something more AIX-specific. Thank you, in advance, for all answers and suggestions!