Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-18-2004, 03:06 PM   #1
LQ Newbie
Registered: May 2004
Posts: 4

Rep: Reputation: 0
Question Need to set up 2 IP configs and choose auto the good one


I have a laptop (Mandrake 10.0 Community) that I use at work and at home. At work, it is connected to a LAN with a fixed non-private IP address. At home, it is connected by an Ethernet link to a PC with Linux/XP connected to the Internet by ADSL. There it uses a fixed private IP but it could use DHCP if needed. Note that both connections use the same Ethernet eth0.

My problem is that I have to manually switch network config two times a day. I'd like to choose automatically the good configuration or at least to select the good one at boot time in LILO.

Do you know a solution for that ?

Old 05-18-2004, 05:05 PM   #2
Senior Member
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
In /etc/sysconfig/network-scripts/ifcfg-eth0, you should find the network info. Make two copies of it, with the set-up for both networks. You should then be able to write a script that attempts to contact the network after booting... If it can't contact the gateway, then it can switch the network set-up, restart the eth0, and attempt to contact again. If it can't contact after switching, it can tell you so.

My /etc/sysconfig/network-scripts/ifcfg-eth0...

# 3Com Corporation|3c905B 100BaseTX [Cyclone]


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set wireless configs automatically apocoloco Linux - Wireless Networking 4 10-22-2005 11:43 AM
Choose Linux stand in internet Cafe, is it good idea? and why? Khmer Linux - General 2 08-26-2005 03:12 AM
Unable to choose good dial-up provider for linux Itami Linux - Software 3 11-30-2004 01:41 PM
Let's choose a good distro for my lapper topper :) orange400 Linux - Distributions 6 05-01-2004 11:37 AM
How to choose a good mirror for apt-get/Synaptic Eugene Linux - General 6 12-08-2003 11:17 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration