AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  AIX add route with subnet

    Posted Tue August 06, 2013 05:19 PM

    Originally posted by: E8K5_shreyash_chaudhari


    hi,

    I want to add below entry in netstat on AIX. 

    160.118.106.128/26 as destination. 

     

    How can I add that ? I tried to add that using smitty mkroute but smitty doesnt allow me to add /26.

     

    Please let me know.

     



  • 2.  Re: AIX add route with subnet

    Posted Wed August 07, 2013 01:31 PM

    Originally posted by: E8K5_shreyash_chaudhari


    Hi Joseph,

    I tried this way - 

    destn type - net 

    destn address -  160.118.106.128/26

    gaeway addr - 6.2.63.43

    netmask -  252.0.0.0  and tried with 255.255.255.0 as well

     

    Not showing up in netstat table yet, getting error that 160.118.106.128/26 is not valid address.

     



  • 3.  Re: AIX add route with subnet

    Posted Wed August 07, 2013 07:51 PM

    Originally posted by: The_Doctor


    I must be missing something..... AFAIK: 

    • 160.118.106.128/26 suggests a network mask consisting of 26 bits or 255.255.255.192 ....... doesn't it ?

    Using smiitty mkroute with:

    • Destination Type - net 
    • Destination Address - 160.118.106.128            ( /26 has no business being entered here )
    • Default Gateway Address - 6.2.63.43
    • Network Mask -  255.255.255.192 

    works ok here.

    What am I missing ?

     

     

     



  • 4.  Re: AIX add route with subnet

    Posted Thu August 08, 2013 10:41 AM

    Originally posted by: GarlandJoseph


    I computed the subnet mask wrong.  I reversed the meaning of the prefix and used it for bits in the hosts field.  255.255.255.192 is correct.



  • 5.  Re: AIX add route with subnet

    Posted Thu August 08, 2013 12:36 PM

    Originally posted by: E8K5_shreyash_chaudhari


    Awesome. this worked. thanks. 

    Another route I need to add  is - .160.118.109.224/27  and gateway 6.2.63.43.

    What will be the netmask should I use for this route to add.

     



  • 6.  Re: AIX add route with subnet

    Posted Fri August 09, 2013 08:55 AM

    Originally posted by: hdkutz


    For a permanent:

    Net Route

    chdev -l inet0 -a route=net,-hopcount,1,-netmask,netmask,network,gateway

    Host Route

    chdev -l inet0 -a route=host,-hopcount,1,-netmask,netmask,network,gateway

    In Your case:

    chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.224.160.118.109.224,6.2.63.43

     

    Cheers,

    ku



  • 7.  Re: AIX add route with subnet

    Posted Fri August 09, 2013 12:18 PM

    Originally posted by: E8K5_shreyash_chaudhari


    Cool. Thanks . I am able to add that entry.

     

    Now I am trying to remove an unwanted entry as below using smitty rmroute

     

    160.118.109.192/26 6.2.63.43         UGS       0         0 en2      -      -
     

    but getting error as below:

     

    Method error (/usr/lib/methods/chginet):
            0514-009 Cannot delete an object from the device
                     configuration database.
    0821-216 chginet: Cannot delete route (net,160.118.109.192,6.2.63.43) from CuAt.
     

    Suggest.

    Thanks

     



  • 8.  Re: AIX add route with subnet

    Posted Wed August 14, 2013 05:51 AM

    Originally posted by: hdkutz


    Do

    # lsattr -El inet0

    You'll see the Entries for the routing tables.

    Just pick up the one which is desired for delete.

    chdev -l inet0 delroute=<picked entry from lsattr command>

     

    Cheers,

    ku



  • 9.  Re: AIX add route with subnet

    Posted Wed August 07, 2013 03:50 PM

    Originally posted by: E8K5_shreyash_chaudhari


    I did with 

     

    route add -net 160.118.106.128/26 6.2.63.43  

     

    But this is temporary. HOw can I make it persistent. ?

    this is showing up into netstat.



  • 10.  Re: AIX add route with subnet

    Posted Wed August 07, 2013 04:03 PM

    Originally posted by: GarlandJoseph


    chdev -l inet0 -a route...this will add it to the odm and make it persistent across reboots.   Can you ping that gateway you're using?



  • 11.  Re: AIX add route with subnet

    Posted Wed August 07, 2013 04:07 PM

    Originally posted by: E8K5_shreyash_chaudhari


    Yes I can ping that.

     

    can you give me complete command.

    is it like :

    chdev -l inet0 -a route 160.118.106.128/26 6.2.63.43   ?