Edit: Still good information.
Originally posted September 27, 2016 on AIXchange
I was recently asked how to remove a static route from the AIX Object Data Manager (ODM), so I pointed my customer to this techdoc.
Although this information is pretty basic, many times when we revisit the basics we’re reminded of something we already knew. And sometimes, we even learn new things.
Some information from the techdoc follows. However, I encourage you to open the above link, which also has images and output:
“Question
How do I remove a static route from the ODM?
Answer
When you are trying to remove a static route it’s best to use smitty or a chdev command to get rid of it. When you use the route delete command that just removes it from the running Kernel. Here is how we can remove the static route.
First Option: Smitty
Step 1: Run netstat -rn.
Step 2: Verify the route you want to remove. Also look at the ODM so you can see later that it was removed from there to. To verify from the odm run lsattr -El inet0. In this example we will remove the route circled in red. Notice on the flags column and you will see it has a flag of H, meaning it is a Host route.
Here is the odm output and circled in red is the same route from the netstat -rn output. It also shows you that it is a Host route we are going to remove. It looks similar to the route above it, but one is a network route and the other is a host specific route.
Step 3: Type smitty route.
Step 4: Select remove a static route.
Step 5: Enter the information for destination and gateway exactly how you see it in the routing table.
For Destination Type we can hit F4 and it will give us two options: net and host. In our case we will select host since we are removing a host specific route.
Under Destination Address we will enter what is in the Destination column of the netstat -rn.
The Gateway value will be what’s in the Gateway column of the netstat -rn.
Hit enter when done.
Step 6: Verify that it was gone with the lsattr command. lsattr -El inet0.
Notice we don’t see the following value for route any longer:
host,-interface,,,,,,153.6.24.0,153.6.24.56
Second Option: Command line using chdev command.
Step 1: Verify the route we want to remove in the netstat -rn output.
Step 2: Verify which route is the offending route in the lsattr -El inet0 output.
Step 3: Run the following command:
chdev -l inet0 -a delroute=”net,-interface,,,,,,153.6.24.0,153.6.24.56″
Step 4: Verify that the route is gone in the ODM.”
For further reading on routes and networking with AIX, check out these articles (here and here) as well.