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
Solved

AIX add static route

Posted on 2014-09-19
7
8,968 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
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.

 

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating 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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

860 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