how to change IP of my SUN solaris machine

Hello,

I want to change the IP of my SUN solaris machine but i am not bale to find the right way. I tried the following steps:
1) edit /etc/inet/hosts and change IP address for host listed in
/etc/hostname.le0
2) ifconfig le0 down
3) ifconfig le0 inet NEW_IP_ADDR netmask + broadcast +
4) ifconfig le0 up
5) netstat -rn (get name or ip_addr of "default" router)
6) ping ROUTER_IP_ADDR
7) if ping fails:
route add default ROUTER_IP_ADDR NEW_IP_ADDR 1
On the 3rd point i m getting error as bad address .

Pls help .

Thanks

Aparna

try sys-unconfig

I suspect the problem is the + in step 3. If you are moving it to another subnet, you need to update /etc/netmasks.

If you are only chaning the IP, and not the hostname, you only need to change /etc/hosts.

If you are changing the hostname, you also need to edit /etc/hosts, /etc/hostname.<interface>, ajd /etc/nodename. Technically there are 2 or 3 more places where the old hostname is encoded, but I have never changed any of them and have never had a problem.

like andryk said, sys-unconfig is the recommended by also by SUN (working for a SUN partner). you can but shouldnt change those settings by hand, sys-unconfig is your friend, and I�ve used it really often for example when installing a server and you dont� know the customers settings, than you just enter sys-unconfig when your done and the customer will have a normal solaris question+answer when he first startup.

Sys-unconfig will do:

x) Revert to a blank system, no hostname, no IP settings, no language selected, no name service and so on...

x) Will bring the SUN down to the OBP

x) Then just boot with "boot" and you will get the normal solaris installation menu.

greetz

hello,

why dont you just edit your /etc/hosts? much simple right?

cheers..

if the box stays on the same subnet as the original IP address --- this method is the quickest way to get the IP address change ... just put in the correct IP address of the box in /etc/hosts and reboot ...

if the box is changing subnets, sys-unconfig is cleaner ...