Hi there, normally I access the internet via ADSL. Due to a mixup by my ISP, broadband has been cut off, and while I'm waiting for it to be restored they've provided a free dialup connection. I managed to get the dialup modem working (which was a saga in itself), but there is a complication: since the computer the modem is in is normally on a LAN and connects via an external modem router, the default route is through the ethernet connection gateway. This means that when I connect via dialup, networking programs are unable to find their way out of the local net.
To fix the problem, after the connection is established, I run 'route add default ppp0' to add the dialup connection as the default for IP connections. This works fine for me, but the computer has a number of other users. A lot of these people are non tech-savvy and consequently don't know how to use the command line, and don't have access to root privileges (I'm using Ubuntu so this is done via sudo).
Since the net interface ppp0 doesn't exist until the dialup connection is established, I can't just put the command 'route add default ppp0' in the boot sequence. I'm not willing to make the boot sequence open the dialup connection automatically (and then fix the route), because doing so obviously ties up the phone line, which is needed for calls (not to mention problems with making sure the connection is established before setting the route)!
In order to make it possible for other people to use the dialup, I tried making a script, which looked like this:
Code:
#!/bin/sh
route add default ppp0
I set the owner of the script to root, and turned on the sticky bit, which I *thought* would enable the script to be run by other users, while taking on root privileges, therefore allowing the command to run. However, when I try running this script I get a "SIOCADDRT: Operation not permitted" error, the same as if an unprivileged user tries to run route.
I guess one way of getting round the problem would be to temporarily set the sticky bit on route (right?), but there must be a more elegant way. Can anyone suggest one?
This problem isn't massively important, broadband should be back in a few days, but it would stop people bugging me about it, and also I'm always keen to learn more about what I'm doing...
Thanks!