Solved

AIX add static route

Posted on 2014-09-19
7
7,436 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
Comment Utility
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
Comment Utility
Thanks WMP, Why are we using mkdev command after adding the route using chdev...
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Ramu Shetty
Comment Utility
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
Comment Utility
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
Comment Utility
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:Member_2_7970249
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.:

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now