Solved

AIX add static route

Posted on 2014-09-19
7
9,456 Views
Last Modified: 2016-08-03
How to add a static route in AIX using a command line     -     10.29.17.0 /20 gateway 10.39.225.5
0
Comment
Question by:Ramu Shetty
  • 3
  • 3
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 40334155
route add -net 10.29.17.0 -netmask 255.255.240.0 10.39.225.5

Please note that there must be an interface which can reach the gateway's network!
Note, too, that this route will not survive the next reboot.

To make it permanent use "smitty mkroute". This is the preferred method.

Alternatetively you can use "chdev" to change inet0:

chdev -l inet0 -a route=net,,-netmask,255.255.240.0,10.29.17.0,10.39.225.5
mkdev -l inet0
0
 

Author Comment

by:Ramu Shetty
ID: 40334157
Thanks WMP, Why are we using mkdev command after adding the route using chdev...
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40334166
That's to make sure that the changes are indeed applied to the device. In older AIX versions "mkdev" was mandatory, in newer AIXes "chdev" will try to update the ODM as well as to apply the changes to the device  (if the device supports it).

Which is your AIX version? If it's 5.3 or up you can omit "mkdev".

Consider using "smitty mkroute". You'll be always on the safe side.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ramu Shetty
ID: 40334621
Hello wmp,
My version or AIX is 6.1 TL9, So looks like I can omit.

Thanks for all your help...
0
 

Author Comment

by:Ramu Shetty
ID: 40334624
ALso on one of the blogs I found this command, there is a -static in the command...

--> chdev -l inet0 -a route=net,-netmask,255.255.240.0,-static, 10.29.17.0, 10.39.225.5

Please let me know if this also works...
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40334689
You don't need it for "-a route=..."

"-static" identifies a manually added route, and only "-a delroute=..." might (possibly) need a distinction between "-static" and "-nostatic". The latter identifies routes added by the kernel or special routing daemon methods.

The command you posted in your last comment will work, of course - but only if you eliminate the spaces after "-static," and "10.29.17.0," !

And to anticipate your question for "-hopcount": This parameter is only needed to prioritize routes going to the same destination. It's the same as "cost" in some network technology dialects. So if there's just one route to a given destination "-hopcount" is not required.
0
 

Expert Comment

by:fuad abdulla
ID: 41740738
This is absolutely a perfect Blog.
I would like to know where I could see my permanent routes present. In linux, /etc/rc.local will list the static routes.

On my AIX server, I see a couple of routes on netstat -rn command. However, how can I confirm if they will be present after the next reboot?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question