Operating System - HP-UX
1826755 Members
3110 Online
109702 Solutions
New Discussion

Re: How can I know my IP address?

 
Antoniov.
Honored Contributor

How can I know my IP address?

Hello world!
I'm newbie in HP-UX and I have a lof of questions about this os.
First question.
I have a HP RX2600 with Itanium.
I have to set ip address but I'm not able. I know there is ifconfig command but I don't understand how this work.

How can I know my IP address?
How can I set new IP address?
Thank In Advance.

Antonio Vigliotti
Antonio Maria Vigliotti
19 REPLIES 19
Pete Randall
Outstanding Contributor

Re: How can I know my IP address?

Try ifconfig lan0. Do a man on ifconfig. It can also be used to set your IP address.


Pete

Pete
Antoniov.
Honored Contributor

Re: How can I know my IP address?

Pete,
thank you but id doesn't work.
Reading man I've seen netstat -i. It answer lan1 and my ip address.
Is it right?
Now how can set new IP address?

Antonio Vigliotti
Antonio Maria Vigliotti
Stephen Keane
Honored Contributor

Re: How can I know my IP address?

ifconfig lan1 inet new_ip_addr

Or something like that (asuming you are using IPv4)
Fred Ruffet
Honored Contributor

Re: How can I know my IP address?

Do you want to change lan1's current IP, or configure other virtual interfaces ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Pete Randall
Outstanding Contributor

Re: How can I know my IP address?

Ok, it's probably not lan0 then. Run lanscan to determine the name of your interface. It sounds like you're using lan1, so the command would be "ifconfig lan1".


Pete

Pete
Peter Godron
Honored Contributor

Re: How can I know my IP address?

Antonio,
once you know the ip-address etc.
if you wish to repeat the part of the installation for setting networks etc.
/sbin/set_parms

then select one of the options:
example:
/sbin/set_parms ip_address

Regards
Antoniov.
Honored Contributor

Re: How can I know my IP address?

Stephen,
I type ifconfig lan1 x.x.x.17 and after of this when I type ifconfig lan1 it shows my new ip address. Does still remain after reboot?

Fred,
I'm newbie here! I need simple configuration.

Pete,
lanscan doesn't exist!

Peter,
now I try it.

Anotonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: How can I know my IP address?

Ok,
ping to another address now works fine!
Ping from another host find this server.
It appears to work fine.
Now reboot.

Antonio Vigliotti
Antonio Maria Vigliotti
Fred Ruffet
Honored Contributor

Re: How can I know my IP address?

Question was to know wether you want to change current IP or give your machine a secondary IP.

If you only want to change IP of lan1, ifconfig will change it for current system. To change it beyond reboots, you have to change /etc/rc.config.d/netconf.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Stephen Keane
Honored Contributor

Re: How can I know my IP address?

It's /usr/sbin/lanscan, but that shows your hardware (MAC) address, not your IP address.
Pete Randall
Outstanding Contributor

Re: How can I know my IP address?

For the new setting to remain after reboot, you would need to change it in /etc/rc.config.d/netconf. Scan down to the section that begins "INTERFACE_NAME[0]=lan1" and change the next line to the new IP address. Better yet, to make sure that all the necessary places are changed, run "/sbin/set_parms ip_address".


Pete

Pete
Antoniov.
Honored Contributor

Re: How can I know my IP address?

cry!cry!cry! :-(
After reboot I see old ip address.

Antonio Vigliotti
Antonio Maria Vigliotti
Fred Ruffet
Honored Contributor

Re: How can I know my IP address?

Have a look at my last post :)
edit /etc/rc.config.d/netconf

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Stephen Keane
Honored Contributor

Re: How can I know my IP address?

If you want a permanent change, do what Fred/Pete have been trying to tell you.
Antoniov.
Honored Contributor

Re: How can I know my IP address?

/sbin/set_parms ip_address ask me the ip_address then reboot system; after reboot host has still old ip_address :-(

Now I try change manually /etc/rc.config.d/netconf ...
(I hope remember how work vi)

Antonio Vigliotti
Antonio Maria Vigliotti
Devesh Pant_1
Esteemed Contributor

Re: How can I know my IP address?

After making the changes to /etc/rc.config.d/netconf

stop and start the /sbin/init.d/net
by giving the command
/sbin/init.d/net stop
and then
/sbin/init.d/start
that should do it

I hope you have already identified the lan card from the ioscan -funC lan output and have plugged in the cables to the right device.
Antoniov.
Honored Contributor

Re: How can I know my IP address?

... and now I understand!
netconf is read only. I can't change with vi!
I guess I have to change with chmod ..

Antonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: How can I know my IP address?

After set read & write I could modify netconf file.
Fred, you are the 1.st told me about this file. Please post again, you merit the bunny!

Antonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: How can I know my IP address?

Thank to allbodies :-)

I have some other questions to write next days.

Antonio Vigliotti
Antonio Maria Vigliotti