script to change IP and hostname under Solaris 10
Hi!
I have to migrate from solaris 9 to solaris 10. The solaris 10 is ready and I would like to test it. Therefore I would like to write a script in order to change easily the IP address and the hostname. Quite a lot of files seem to be involved. Should I reither use "sys-unconfig" or edit directly /etc/hostname.*, /etc/hosts, /etc/inet/ipnodes and /etc/nodename (any other files?). Does anyone have maybe such a script? Under http://sysunconfig.net/unixtips/sola...ame_script.txt I found a script to change the hostname: Quote:
Thanks for your help. |
I would just go with sys-unconfig. It is safer in my opinion.
|
Quote:
could Quote:
Is there a command to change only the hostname? Is it enough to change it in /etc/hostname ? Or does it have to be changed in many other files? Thanks. |
I'm not a fan of sys-unconfig at all. Just change the /etc files and call it good.
Mark |
related files
/etc/hosts
/etc/nodename /etc/hostname.* Plus files listed by find /etc -name hosts -print |
Ok. I wrote a script. It seems to work. I tested it. Its purpose is to change quickly between 2 IPs and hostnames. I took all the related files listed by AbrahamJose and also added /etc/inet/ipnodes.
Quote:
|
Just a remark.
There is no need to reboot for the changes to take effect. Just add to your script something like: Code:
ifconfig bge0 down |
Quote:
I tried what you advice but it doesn't work. The server hangs and I have to set up everything back with the console since I loose every ssh connection and I cannot reconnect myself wether with the old nor with the new IP. I also tried Quote:
|
Oops, I thought that you're running the script locally and not through ssh.
Quote:
Code:
ifconfig bge0 unplumb Code:
ifconfig bge0 IP-myhost1 netmask xx.xx.xx.xx |
Quote:
|
All times are GMT -5. The time now is 02:57 PM. |