Operating System - HP-UX
1820475 Members
3263 Online
109624 Solutions
New Discussion юеВ

Changing IP address via command

 
SOLVED
Go to solution
???_185
Regular Advisor

Changing IP address via command

Hello everyone.
Last week, I changed IP addresses on a rp7405 server /w the following steps.

[original conf]
lan0: 10.10.10.10/24
lan1: 20.20.20.20/24

[target conf]
lan0: 20.20.20.20/24
lan1: 10.10.10.1024

[each steps that I did]
# ifconfig lan0 down
# ifconfig lan0 unplumb
# ifconfig lan1 down
# ifconfig lan1 unplumb
# ifconfig lan0 20.20.20.20 255.255.255.0 20.20.20.1
# ifconfig lan0 plumb
# ifconfig lan0 up
# ifconfig lan1 10.10.10.10 255.255.255.0 10.10.10.1
# ifconfig lan1 plumb
# ifconfig lan1 up

and after reconfiguration,
# netstat -in
# netstat -rn
showed correct information that I want.

All NIC's link status were OK.
but afterall cannot ping anywhere except NIC itself. ie. ping 10.10.10.10 on lan1...

I couldn't solve the problem, so I resolv it /w the help of SAM...

Did I miss the step?
Or are there any miss/wrong steps?

Thank you...
6 REPLIES 6
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: Changing IP address via command

Hi,

# ifconfig lan0 down
# ifconfig lan0 unplumb
# ifconfig lan1 down
# ifconfig lan1 unplumb
# ifconfig lan0 plumb
# ifconfig lan0 20.20.20.20 255.255.255.0 20.20.20.1 up
# ifconfig lan1 plumb
# ifconfig lan1 10.10.10.10 255.255.255.0 10.10.10.1 up

and change the /etc/rc.config.d/netconf file.

Regards,
Robert-Jan
John Dvorchak
Honored Contributor

Re: Changing IP address via command

Any time you can't ping off of your subnet it is a missing or incorrectly defined default router. Are you sure netstat -rn had correct router associated with the correct LAN number?

The step you were missing is the route delete and route add commands. To get the default routers to survive a reboot you would have had to change /etc/rc.config.d/netconf so the correct instance [0] pointed to the correct router.

Sam is a good way to change the addresses because it remembers everything. If you want to change the address from a command line take a look at man set_parms and that script will ask you all the right questions and modify all of the right files. i.e.

set_parms initial


One more thing did you remember to change the IP address in /etc/hosts to reflect any name/address change?
If it has wheels or a skirt, you can't afford it.
Steven E. Protter
Exalted Contributor

Re: Changing IP address via command

Shalom,

I would conclude that the settings you input are not compatible with the target lan. Its possible you have the cables crossed. Try reversing them.

Also, you might want to run a quick hardware check on the two lan cards with cstm, mstm, or xstm

I doubt however that both of them are bad.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Nguyen Anh Tien
Honored Contributor

Re: Changing IP address via command

I think you should modify IP address in /etc/rc.config.d/netconf
then restart net service:
#/sbin/inet.d/net stop
#/sbin/inet.d/net start
HP is simple
Yogeeraj_1
Honored Contributor

Re: Changing IP address via command

hi,

/etc/rc.config.d/netconf should be modified manually to as to retain the changes.

don't forget to backup the netconf file prior to any modifications.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
???_185
Regular Advisor

Re: Changing IP address via command

Gentleman Thank you for all the responses