Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris networking script

Status
Not open for further replies.

terrywashington

Technical User
Jun 28, 2001
185
US
My company will soon be readdressing our internal network. This will mean changing all of the network info on over 100 hundred servers and workstations. Many of these systems are running NIS. The only thing that will not change will be the hostname and netmask. Does anyone know of a script that could make this less painful?
 
I was thinking you could probably write a script that would insert an "at" job into the machine to run an appropriate ifconfig command that would make the changes. Use a file with 3 columns to run the script with hostname, interface, new_ip as your seed data for the ifconfig command, also a new /etc/hosts file (Not sure how your environment is, but all our machines have the same one).

logically it would be something like
For every row in data file
telnet $HOSTNAME as root (or alternative if you like)
run at command with ifconfig $INTERFACE $IP_ADDRESS
logout
use secure copy to send new /etc/hosts or scriptable vi to make the necessary changes.
loop

There's still some work involved getting the files together but it's less than going to each machine and changing the information manually.

Or, get an intern =)

HTH,
Brian
 
Brian,

Thanks for the response. I was also thinking of somehow incorporating an at job into the procedure.

Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top