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 eth0-profile1.sh that once executed, it changes eth0 ips to: ip 192.168.1.17 doh 255.255.255.0 gw 192.168.1.1 ns 192.168.100.1 and i'll do the eth0-profile2.sh (looking at what you wrote) Thank you! Goodbye! |
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. |
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: Code:
$ sudo find /etc | grep ifcfg-eth0 2) Once the backups are created, use a script like this: Warning: This is untested code! Code:
#!/bin/bash |
All times are GMT -5. The time now is 12:02 PM. |