?
Solved

AIX add static route

Posted on 2014-09-19
7
Medium Priority
?
10,980 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 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
Technology Partners: 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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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