Newsgroups: comp.os.linux.networking Date: 2001-07-27 13:51:24 PST
I'm using kernel PPPoE with the patched pppd-2.4.1 under kernel 2.4.7. That laptop shares the adsl connection with a w2k laptop using IP masquerading. I would like the internet connection always to be available to the win box, without my having to monitor it, and ideally surviving putting the "server" laptop on suspend and then waking it up. I tried the "persist" option to pppd today, but it didn't quite do it for me, as pppd itself seemed to die, but left the ppp0 interface up, albeit unresponsive (no internet connection). I suppose the next thing to try would be to have init respawn pppd, but I seem to recall seeing someone advising against it. In addition, I might have to have apmd do some acrobatics.
As I'm sure many people here are doing exactly the same thing, I'd appreciate hearing some opinions. Thanks!
David Bragason
You cannot have it survive suspension. The other end will notice no connection and kill the connection. Use something like demand or the program diald which reconnects when there is some traffic to send.
Bill Unruh
I suppose the first thing to determine is why is the connection terminating. Is it the result of the device just becoming idle and hence the network connection is dropped. If it is, then a small cron job which starts up every 10 minutes or so and pings a couple of sites should fix the problem.
If it is a case of the power management aspects like the machine going into standby/sleep mode, then you might want to check the BIOS and see whether APM support is enabled. If it is, you might like to adjust the settings, or if possible, actually turn the support off so that the laptop runs all the time.
Have you been able to work out whether it is the remote end which terminates the connection or is it the local end ?, it seems strange if the ppp0 interface continues to live but there is no connection. Almost sounds like power management might actually be the problem in this case.
Dean Thompson
Thanks for the replies. The reason I mentioned apmd is that I actually want to use suspend, and have the internet connection instantly available when it resumes. That way I can tell the person using the other computer just to make sure my computer is awake, and then there will be a connection.
Just using pppd with "persist" I find it survives a suspend/resume of a few minutes, but not a few hours. What happens is the pppd process is dead, ppp0 up but dead, and another invocation of pppd ifconfigs ppp1, and things gets screwy.
I don't really like the idea of a cronjob either, as that way the connection might stay down for a few minutes. I've instead settled on having pppd persist running from boot time on, but apmd taking it down and starting it again via suspend/resume scripts. I hope that works nicely. These suspends are all user initiated, by the way, as I don't want the system to be permanently connected (crackers…)
David Bragason
> Hmm, I didn't know that it was possible to actually put a machine into > suspend and have the PPP session survive. The only thing that I could > recommend is to check to see whether or not the apmd daemon actually > invokves any scripts when a system is revived from its standby period. If > it does, you might want to actually issue a "service network restart" > command to restart all the network services. I just don't think everything > would be happy with networking being there, going to sleep and then waking > up. Surely, connections in the system or cache memory in a switch/router > might expire during that period. > Dean Thompson
I think I've got it now. It seems best to use pcmcia-cs's own apm support, and I've taken apmd away altogether, as it didn't play in harmony with pcmcia-cs (my SuSE apmd assumed pcmcia had no apm support), but mucked the interfaces up instead. Now the /etc/pcmcia/network script (with arguments "suspend" and "resume") takes care of pppd. Compiling pcmcia-cs with apm support seems to take care of the interfaces themselves (eth0 and eth1).
David Bragason