AIX, Networking↑ Adding and deleting a static network route using the command line |
There are two commands that can be used to add a route on an AIX system. # route add -net 10.0.0.0 -netmask 255.255.255.0 192.168.0.1 After running this command, you can use the netstat -nr command to confirm that the route indeed has been set up: # netstat -nr | grep 192.168.0.1 172.30.224/24 192.168.0.1 UG 0 0 en1 - - To remove that route again, simply change the route command from "add" to "delete": # route delete -net 10.0.0.0 -netmask 255.255.255.0 192.168.0.1 Again, confirm with the netstat -nr command that the route indeed has been removed. # chdev -l inet0 -a route=net,-netmask,255.255.255.0,-static,10.0.0.0, 192.168.0.1 inet0 changed This time, again, you can confirm with the netstat -nr command that the route has been set up. But now you can also confirm that the route has been added to the ODM, by using this command: # lsattr -El inet0 -a route | grep 192.168.0.1 route net,-netmask,255.255.255.0,-static,10.0.0.0,192.168.0.1 Route True At this point, you can reboot the system, and you'll notice that the route is still there, by repeating the netstat -nr and lsattr -El inet0 commands. # chdev -l inet0 -a delroute=net,-netmask,255.255.255.0,-static,10.0.0.0, 192.168.0.1 inet0 changed Finally, again confirm using the netstat -nr and lsattr -El inet0 commands that the route indeed has been removed. |
Posted - Fri, Apr 19, 2019 2:30 PM. This article has been viewed 2326 times. |
Online URL: http://kb.ictbanking.net/article.php?id=564 |
Powered by PHPKB (Knowledge Base Software)