Solved

AIX add static route

Posted on 2014-09-19
7
10,223 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 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
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

696 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