Discussion Locked

script to change IP addressing at boot

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Does anyone have a simple script that will allow users to choose which IP conf to use? This would be great for users with portables that use a corporate network and a home network. Or maybe a script that lets the edit the IP, Mask, GW and DNS at boot.

Thanks

7 replies

by sdbytnar

Not the greatest solution but one that we used was to export the section of the registry where IP info is kept and create two reg files with the different IP info. When the user boots they merge the appropriate reg file into the registry and reboot. They will then have the new IP info.

Sean

by bruce timberlake

There are several solutions to this. Easiest "quick-and-dirty but not the most elegant" solution is to bind multiple network IP info to the Ethernet interface. In /etc/sysconfig/network-scripts/, there is a script file named ifcfg-eth0 which has the setup info for the default Ethernet adapter. You can make a copy of this in ifcfg-eth0:0 (cp ifcfg-eth0 ipcfg-eth0:0), and change the contents to be the second set of IP info. When the laptop boots, both scripts will get run and the Ethernet interface will be setup for both networks; content will be routed over whichever set of info works for the network the laptop is connected to at the time. (If you needed to add a third set of info, you would make a file called ifcfg-eth0:1, etc). Emailme for more elaborate info if you need it, or for other possibilities if this doesn't work for you for some reason.

by zbrain75

The easiest solution is to use DHCP both at work and home. It is easy to set up in Linux and on client computers.

This discussion is closed to new replies.