PDA

View Full Version : Laptop-net (or something like it) for Fedora?


Belayman
19th March 2004, 02:39 PM
before we begin, i thought i should warn you that i'm a complete Linux newbie... but, i have researched this question quite a bit, and i haven't found a good solution yet. so...

I'm running FC1 on a Dell Latitude D800. It's a work computer, but they allow us to take them home for use. At work, all the network stuff is static - Static IP, subnet mask, default gateway, ... DNS... everything. At home, everything is dynamic - my Linksys router uses DHCP to send out IP addresses to all the computers on my LAN.

So, with the "work" network configs, i can't use the laptop at home. I've tried making new network profiles, user names... all that - but i still can't get FC1 to maintain all the static network properties for work, while using dynamic (default) network properties at home.

But... i did run across this little app:

Laptop-net (http://packages.debian.org/testing/admin/laptop-net)

which will automatically change setting based on the network that it's plugged into. i've talked to someone running this, and they say it will do exactly what i want.

but, in the Laptop-net manual (http://www.swiss.ai.mit.edu/projects/omnibook/documentation/laptop-net.html) it says that it's Debian specific - only for use with Debian.

but, i was thinking that this little app is so useful, that there has to be something for other Linux distros (or, there has to be something inside the distro that i'm missing).

so... my basic question is, how do i make it such that FC1 will maintain all the static network settings when i'm at work (so i can log into the server and such), but it will allow for dynamic settings when i'm at home - so i can use the internet at home (on my LAN). i don't really care "how" this problem is solved - whether it's via an app like Latop-net or some other solution. but, i doubt that i'm the first person to ever try this with a laptop, and i can't find out how to do it.

anyway... i'd be open to any and all comments/suggestions that anyone has on this. but, please remember that i'm very new to Linux, so please speak to me like i'm an idiot (well, i am). you won't insult my intelligence. :D

thanks a bunch... i really appreciate the help.

joking
20th March 2004, 04:34 PM
1st don't change the laptop settings. hard code the ip address the laptop is using into your home router, would be my suggestion. You should be able to find out how to do that from you routers manufacturers site or their manual.

then moving back and forward between sites should be no problem.

djf_jeff
20th March 2004, 05:12 PM

I dont know anything that will help you make everything automatic. But I know something that can help you.

Configure your eth0 to be static, with the work value. With that, you simply plug your laptop at work.

After that, to use your laptop at home, simply log with root and type :

dhclient eth0

And you will have your eth0 configured dynamic. When you reboot your laptop, eth0 will always come with static settings.

Not automatic but take less than 5 seconds to do...

DrBytes
21st March 2004, 05:34 PM
On Woody, Debian.. there's a thingie called netenv. This allows you to select the appropiate network configurations at boot.
Not saying you go and install Debian, as a n00b you'll quickly be in tears but I bet you can use netenv on fedora too..

Read all about it on :
http://netenv.sourceforge.net/

-Yves.

Belayman
22nd March 2004, 09:36 PM
Originally posted by joking
1st don't change the laptop settings. hard code the ip address the laptop is using into your home router, would be my suggestion. You should be able to find out how to do that from you routers manufacturers site or their manual.

then moving back and forward between sites should be no problem.

That's probably the easiest thing to do... good call.

the only other "issue" would be that the computer would still be on my work domain, and transferring files to-and-from other computers on my LAN might get interesting. but, that's not that big of a deal (if it's a deal at all).

djf_jeff...

where exactly do i type " dhclient eth0 "? do i get into a terminal or something? (sorry... i'm new).

and DrBytes... that app looks great... i might try that later.

thanks for all the responses... i really appreciate the help.

thanks

Woogie
23rd March 2004, 04:01 AM
This solution isn't automatic, but it works without any additional software. Given some more free time, I'd like to write this as a how-to.



Step #1 - Setup network profiles

Run redat-config-network from the comand line or choose the network icon under the System Settings menu. Create a copy of your network device by clicking the Copy icon. Configure one with your static information and the other for DHCP. Give them meaningful nicknames. Next, create new profiles from the profile menu, one for work and one for home. I don't use the default profile. Pick one of the new profiles from the menu, then associate the correct network device with it by using the checkboxes on the left side. Fill out the DNS and hosts tabs also. Do the same for your other profile.

The duplicating devices is because the redhat network tool has the weird quirk that a device can only be configured to be either static or dynamic. The workaround is to create a copy of the network device and configure one the use DHCP and the other for your static address. If you connect to many more networks, you can create more devices and profiles.



Step #2 - Setup boot menu

This will allow you to choose your network profile at boot time. Below is an example /etc/grub.conf. The important part is the netprofile part, placed at the end of the kernel lines. This is where you put the name of the profiles you created with the network config tool. The title lines are what is displayed at the boot menu, so add a meaningful note.
Also, if an update installs a new kernel, you'll have to edit this file again since only the top profile will be updated.

title Fedora Core (2.4.22-1.2174.nptl) Work Network
root (hd0,2)
kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ rhgb netprofile=Work
initrd /initrd-2.4.22-1.2174.nptl.img

title Fedora Core (2.4.22-1.2174.nptl) Home Network
root (hd0,2)
kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ rhgb netprofile=Home
initrd /initrd-2.4.22-1.2174.nptl.img


Hope this helps.

adsmith
17th April 2004, 04:06 PM
RedHat's "network profiles" is a good way to go. It's a neat and under-documented feature. I've used it since it arrived (completely undocumented at first!) in RedHat 8.

the description above is good.
In addition to changing the network profile at boot time with hte kernel option, you can do it while running by (1) shutting down all network interfaces (2) changing the profile with redhat-config-network-cmd -p PROFILE (which works in RedHat and Fedora) or using the redhat-control-network gui in FC1.

crackers
17th April 2004, 05:21 PM
I haven't messed with it (no wireless - yet), but KDE has a nifty little wireless network manager that allows you to switch between profiles without rebooting.

micha
17th April 2004, 06:12 PM
I'm in the same case ; I use my laptop at home and at work.

First, I did use the network profiles. It works but each time you update your kernel, you have to modify the GRUB config file. Well ok, it's not a lot, but it's one more task to do each time you update the kernel.

So I put exactly the same network configuration at home as at work. I put the same static IP adress, I setup my router with the same gateway IP adress and Wifi configuration. It works great since you have exactly the same configuration for both work and home networks.

Moreover when my colleagues come home with their laptop for a little LAN party, they don't have to reconfigure their network settings :)

But if you go to other networks (let say you go to another friend home network for another LAN party), you have to use the network profiles. It's easy and you don't need to reboot when you change profile.

Here is the documentation for the network profiles:
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-network-profiles.html