Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-26-2007, 03:36 PM   #1
Registered: Mar 2005
Posts: 33

Rep: Reputation: 15
Anyone knows an applications that changes eth0 ip with a click?

Hello all!

I own a laptop which i have t take it with me at work and bring it home in the evening.

The problem is i have to manually setup those IPs twice a day (dhcp is not avail).

Basically, i need something that stays in tray and if i right click it, a menu appears with options 'profile1' and profile2. when i click profile1, the program changes eth0's ip, gw dns and so on with some IPs i've attached to that profile.

clicking profile2 will change eth0 to a whole bunch of different ip addresses, these also preconfigured by me earyler.

if you don't know such program (if it doesn't exist), someone on freenode suggested i should use bash scripts. can anyone write the that once executed, it changes eth0 ips to:


and i'll do the (looking at what you wrote)

Thank you! Goodbye!
Old 11-26-2007, 04:22 PM   #2
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 49
Sounds like you could try NetworkManager.

There you can set properties on any given interface and then just click the icon in the taskbar and select which interface to use.

If you use KDE there is KNetworkManager.
Old 11-26-2007, 05:26 PM   #3
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
You don't mention the distribution you're using, nor why DHCP isn't working. Can you use your laptop "automatically" at a shop where WiFi is available for free? (Starbucks comes to mind.) If you can't, then I'd suspect that you've failed to install a DHCP client service, or don't have it automatically started. If this is the case, fixing the problem should fix your daily aggravation.

If you still want a "switch profiles" script, try this:
1) Backup your home and office ifcfg-eth0 files. (On my Fedora 7 system, there are three such files:
$ sudo find /etc | grep ifcfg-eth0
but they are all identical. Thus, to make a copy of my "home" cfg files, I could create a "home" directory (mkdir ~/home) use the command sudo cp /etc/sysconfig/networking/devices/ifcfg-eth0 ~/home/ and, after I'd connected to the "office" system, do the same. replacing "home" with "office." (The names are, of course, quite arbitrary).)

2) Once the backups are created, use a script like this: Warning: This is untested code!
# Names used:
# Sanity check
if ! [ -f ~/$h/ifgfg-eth0 ]; do
  echo You have not yet created the ~/$h/ifcgf-eth0 file. >2;
if ! [ -f /$o/ifcfg-eth0 ]; do
  echo You have not yet created the ~/$o/ifcfg-eth0 file. >2;
if [ sane = no ]; exit 1

#Copy the file to the three destinations
if [ $# != 1 ]; do echo You must supply exactly one argument, either "$h" or "$o." >2;exit;done
case $1 in
   "$h" | "$o )
     sudo cp -f ~/$1/ifcfg-eth0 /etc/sysconfig/network-scripts/;
     sudo cp -f ~/$1/ifcfg-eth0 /etc/sysconfig/networking/devices/;
     sudo cp -f ~/$1/ifcfg-eth0 /etc/sysconfig/networking/profiles/default/;
   *) do;
     echo "$1" is not a valid argument. Use "$h" or "$o." >2;
     exit 1;


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
Single-click, double-click icons in KDE Doug Vitale Linux - Newbie 6 06-11-2015 11:09 AM
CTRL+click, SHIFT+click no longer selecting multiple items General Linux - Hardware 1 05-20-2007 04:11 PM
Mapping CTRL+Click as right click using xmodmap in Modular X.Org 7 on Gentoo amitron Linux - General 0 10-12-2006 12:25 PM
mouse: single-click becomes double-click kinzlaw Linux - Hardware 2 08-24-2005 08:55 PM
Gnome 2.6.1: Single Click acts like Double Click Der_tolle_Emil Linux - Software 2 09-13-2004 09:59 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:05 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