Please login or register. September 22, 2017, 09:44:04 AM

Author Topic: Changing the default route  (Read 37345 times)

0 Members and 1 Guest are viewing this topic.

TestUser

  • Jr. Member
  • **
  • Posts: 7
  • Karma: +0/-0
Changing the default route
« on: November 09, 2006, 08:30:12 AM »
Hi
I have problem with routing table in aix,i have been changed ip address from 192.168.168.23 to 10.40.0.100 and need change default route ,i did it ,but when the server booted the old deafult gateway (192.168.168.4) back and create problem when client try to connect to server .
i can not find any file that may be has this ip address in it
please let me know how can fix this problem and delete old gateway from server ( which file must be check ) and can i use odm command and how?

regards,
Bashiri

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: Changing the default route
« Reply #1 on: November 09, 2006, 08:36:12 AM »
If you are adding an interface, the easiest way to change all the settings is to use:
smitty mktcpip

If you still have 'console' access I recommend the following:
* as root
# rmdev -dl en0
# rmdev -dl inet0
# cfgmgr
# smitty mktcpip

Normally you would need only to use smitty (or smit) mktcpip, but this will first remove all configuration settings for an interface (assuming you are using en0), base tcpip settings (including all static routes); create new empty configuration objects; and then configure them.

Lastly, verify manually (vi /etc/hosts) that your hostname is not showing up twice in /etc/hosts with old and new IP address.

regards, Michael

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: Changing the default route
« Reply #2 on: November 09, 2006, 08:58:15 AM »
I forgot to say that we are running HACMP on server and can not do rmdev or cfgmgr ,is it possible explain how can i find routing information where stored ( file )
i tried to search "192.168.168.4" pattern in all files on aix like :
find . -type f -exec grep -i 192.168.168.4 '{}' \; -print
but this command do not show which file contains this pattern
please let me more

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: Changing the default route
« Reply #3 on: November 09, 2006, 09:02:33 AM »
the command to modify default routes is:

smitty netstat

But, as this is HACMP related I need to know which address this (and I am moving topic to HACMP area of forums)

Is this a service (application) address, standby, admin, etc. etc.

And, actually, you should not be doing this while HACMP is active. imho as HACMP instructor.

This is kind of like when they close the roads you are using everyday without telling you that the roads have changed - and also not mentioning which roads are now open to use.

mahdi

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Changing the default route
« Reply #4 on: November 09, 2006, 10:13:27 AM »
Hi
I said hacmp running ,because i can not remove device only,the route problem before the hacmp starts appear and not related to hacmp ,before the hacmp configured we have this problem and we must remove this routing from route table maunally but when the server start ( boot ) the old route come back

route table after booting:
/ # netstat -rn
Routing tables
Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups

Route Tree for Protocol Family 2 (Internet):
default   10.40.0.2         UGc       0        0  en0     -   -
default   192.168.168.4 .....

and i deleted by:
route delete default 192.168.168.4

and the problem solve until next booting


Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: Changing the default route
« Reply #5 on: November 09, 2006, 10:21:07 AM »
using smitty netstat you can delete individual static routes.

for destination enter either 0 (zero) or default, for router enter the address you want deleted (in your case 192.168.168.4)

As you have already deleted the entry from the kernel (live situation) you may get a warning/error message.

To verify before and after that the settings are removed:

lsattr -El inet0 -a route

an example output:
Code: [Select]
root@x054:[/var/spool/mail]lsattr -El inet0 -a route
route net,-hopcount,0,,0,192.168.129.124                                   Route True
route net,-hopcount,0,-netmask,255.255.255.0,,,192.168.1.0,192.168.129.100 Route True

mahdi

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Changing the default route
« Reply #6 on: November 09, 2006, 10:31:49 AM »
i did smitty netstat to delete 192.168.168.4 static route ,but return below message :

Command: failed        stdout: yes           stderr: no

Before command completion, additional instructions may appear 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,0,192.168.168.4) from CuAt.

/ # lsattr -El inet0 -a route
route net,-hopcount,0,,0,10.40.0.2 Route True


now what can o do



     

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: Changing the default route
« Reply #7 on: November 09, 2006, 11:00:26 AM »
Did you do the lsattr command before the smitty command? Or only after?

If only after, the warning message is what I expected, as you had already removed the active route info.

To verify, you will need to do a reboot. If the 'bad' route returns, then the route is being added in a non-standard location.

I can help with that as well I expect, but first I need verification of the current situation.

nath

  • Jr. Member
  • **
  • Posts: 8
  • Karma: +0/-0
Re: Changing the default route
« Reply #8 on: November 09, 2006, 02:58:50 PM »
What version of AIX?
Are you using etherchannel?

Try to set your default Gateway IP using "smit mktcpip"

Also look at lsattr -El inet0 for default gateway, and use chdev to change the Correct GW IP if the above didn't work

mahdi

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Changing the default route
« Reply #9 on: November 11, 2006, 06:56:50 AM »
the aix version is 5.1 ml4
i am searchinf to find the bad gateway on incorrect location as i said before ,i tried to search bad gateway with find command and find it ,but i can not find on which file and is it possible to edit file manully without damage to os files or no?