Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Say, I have this laptop, on office they use DHCP, on my home we use static IP Lan, on my friend's home they use static IP Lan, I go to an internet cafes often and they use either DHCP or static IP is there any easy way to get through all these settings easily on my laptop?
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
That can be tricky. What distro and version are you using? There might be a tool just for that distro. There is many variation in the network segment from distro to distro that I haven't really seen a specfic tool that can handle all distros.
One way is to know where you distro stores the network configuration files and then using scripts to bring down the interface, copy over the needed configuration, and then bring up the nic. Again depends on distro. I mostly know Redhat and the Redhat clone structure.
If you use some sort of a network control applet, it may be able to store configurations.
The wpa_supplicant.conf can have different sections, one for each "ssid". This will help with authentication for different wireless networks.
Check your slackware scripts to see if they source a network device configuration file.
Other distro's use configuration files in /etc/sysconfig/network/ of the form "ifcfg-<device>".
You could have a script that copies over the config for the device, for example, ifcfg.eth0.home -> ifcfg-eth0
ifcfg.eth0.work -> ifcfg-eth0, ifcfg.wlan.coffeeshop1->ifcfg-wlan0, ifcfg.wlan.coffeeshop2->ifcfg-wlan0.
I had a similar situation when we were installing equipment at work. We were replacing equipment in 5 sites, and each had a different network. I had to use ftp to download files that needed transferring onto my laptop, and had to reconfigure the ip settings on the fly. I simply wrote a script the A) copied over the old config with the new one. B) restarted the network service. The process would take only a few seconds and was a lot quicker than it would be in windows. ( And was a lot easier and fool proof. This was important on about 3 hours of sleep a night that week).
I use SuSE which seems to be recognized as one of the most user-friendly in terms of configuration.
I never ran into problems until I came to college with a brand new LinuxCertified laptop. I have DHCP at home, DHCP in my dorm, and a static on my LAN at work.
There's a Network Chooser applet that comes with SuSE, but it seems to be crap.
I've done a bit of investigation, but haven't been able to come up with anything worthwhile. It's definitely a good idea for a project.
In the time being, here is my idea:
configure each network by hand from the CLI. save all appropriate configuration files with unique names. write a small shell program (call it something like "netchoose") which takes an argument and makes symlinks from your configuration files (where your distro looks for them) to the unique files for each connection/location.
the end result being you will sudo netchoose <networkname>
and it will rotate in the correct configuration files, and run your distro's config scripts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.