LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Multiple Network Profiles (https://www.linuxquestions.org/questions/linux-networking-3/multiple-network-profiles-88002/)

vrillusions 09-01-2003 11:18 AM

Multiple Network Profiles
 
I just started using my laptop at work and have run into a problem. At home I use DHCP. At work I use a static IP. How could I switch between the two network profiles? One idea was to write some scripts that I just executed. Another idea, which I found here while searching was setting up another profile in lilo so I just choose whichever network I'm using and boot from that. Another idea was to have two eth adapters that point to the same device. Only problem with that is I still have to setup the dns when going to the static network. Any other ideas or HOW to do any of this? thanks. BTW I'm using Mandrake 9.1

Half_Elf 09-01-2003 11:55 AM

well I think it could be very easy to do.

Just edit your network boot script (/etc/init.d/network, probably) and then assign a static ip BEFORE the system try to get DHCP. So if the DHCP request fail, I suppose that you'll keep the static ip (and that you'll get a new ip if the request suceed).
I'm not sure about this, because having an assigned ip adress may force the DHCP to run on assigned adress broadcast (instead the global broadcast), but I think you should give a try :p

vrillusions 09-01-2003 02:00 PM

I was able to make some scripts that did it. I just went through linuxconf and watched what files it modified and what it did and just copied that over to a script. I have the files all zipped up and ready to post here till I realized that you can't attach files on this forum. I'll get it linked somewhere eventually, but for now if someone is interested in them, let me know and I'll send them.

Half_Elf 09-01-2003 03:32 PM

drop it in my anonymous ftp. Host is elf.homelinux.org :)

vrillusions 09-01-2003 06:27 PM

k, I'll throw it on my server too. Couldn't when I did that post because I was heading out

(update)
OK you can get it at the following address:

http://www.vrillusions.com/download.php?id=bash_ifcfg
(/update)


All times are GMT -5. The time now is 09:02 PM.