change ip in aix not using smitty

I want to change my ip by not using smitty, could please help me and what to edit files. So that everytime i will restart my server it will not change.

(man) ifconfig

I hope this helps.

bakunin

Chaninging the IP address with ifconfig does not live through reboot because then you are only changing running system and not the ODM.
Do a "lsattr -El enX" where X is the number of the ethernet device the ip address resides on. There you will see what parameters to change with chdev command.
Note that if you are moving to a different network and require a different route then the route is stored in the device inet0 - "lsattr -El inet0". A chdev would be required there as well for the route change, if neccessary.

True, but the threadstarter wanted exactly this behavior:

Or have i gotten him wrong?

bakunin

isn't it so that you can view the commands smitty is going to perform by hitting [F6] in the window you are in?

with that option you can figure out what statement(s) to perform from command line to achieve what you want..
(you need to look in smitty once...)

its true we can change Ip in command line using ifconfig,
same goes to solaris you can change ip by ifconfig. But what im trying to say, when you restart your server the one changed the ip it will goes back to its normal IP.

the one written in /etc/inet/ipnodes for solaris or /etc/rc/config.d/netconf for HP. So what im trying to say, you need to edit those files in order it will be permanent.

So you guys know, where are these so called config files in aix? All i know was linux,solaris and HP.
\

Yes, that is right. Alas, these scripts are sometimes a bit counterintuitive and hard to read.

bakunin

>where are these so called config files in aix? All i know was linux,solaris and HP.

Sprellarinn has just told you that, and this is the main difference with the 2 other OS you mentionned: AIX uses an ODM stored in NVRAM...
You ca go and modify the data in the ODM if you wish, but my experience is a corrupted ODM can be HELL...

Sorry, but: no. The ODM is stored not in NVRAM, but in the directories /etc/objrepos and /usr/lib/objrepos for the standard AIX part, some middleware extensions have their own ODM, for example HACMP in /usr/es/sbin/cluster/etc/objrepos and /etc/es/objrepos.

To clear the confusion about lasting/nonlasting IP changes up:

To change the IP adress until the next reboot use "ifconfig". To change routing accordingly in the same non-permanent way use "route delete ..." and "route add ...".

To change IP adressses permanently use "chdev", as Sprellarinn has said. To change the routing accordingly you will have to use "chdev ... inet0" as the routes are stored in the inet0 pseudodevice.

I hope this helps.

bakunin

ifconfig -a | grep inet
inet 10.118.5.43 netmask 0xffffff00 broadcast 10.118.5.255 inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255

Could you please help me, how to change IP permanently using command line.

output:

inet 10.118.6.43 netmask 0xffffff00 broadcast 10.118.6.255
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255

Use the "chdev" command on the device en0. You can find out how to use "chdev" by issuing "man chdev" on the commandline and you can get the names of the attributes to change from the output of "lsattr -El en0".

I hope this helps.

bakunin