From: Conor Daly (conor.daly at domain oceanfree.net)
Date: Sat 15 Jun 2002 - 18:27:01 IST
On Sat, Jun 15, 2002 at 10:35:06AM +0100 or so it is rumoured hereabouts,
Patrick Kiernan thought:
> I've setup my dial-up connection with pppconfig so to get online I type
> "pon iol". I've given my
> normal user account access to do this also but everytime I connect I
> still have to change to root and
> add the default gw otherwise I can't ping anywhere. The default gw being:
>
> ppp0 Link encap:Point-to-Point Protocol
> *inet addr:194.165.160.102* P-t-P:194.145.128.243
> Mask:255.255.255.255
> UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
> RX packets:136 errors:2 dropped:0 overruns:0 frame:2
> TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:10
> RX bytes:70775 (69.1 Kb) TX bytes:6201 (6.0 Kb)
>
> The bit in bold there and since this changes everytime I connect, I have
> to change it manually.
Yup. If you do:
INET_ADDR=`/sbin/ifconfig ppp0 | grep "P-t-P" | cut -f 1 -d'P' | cut -f 2 -d ':'`
route add default gw $INET_ADDR
Stick those two lines in your pon script (assuming it's suid root already)
and away you go. If the pon script isn't suid root, you'll need to
put these lines in a dedicated "setroute" script that _is_ suid root.
Conor
-- Conor Daly <conor.daly at domain oceanfree.net> Domestic Sysadmin :-) --------------------- Faenor.cod.ie 1:23pm up 22 days, 22:41, 0 users, load average: 0.08, 0.02, 0.01 Hobbiton.cod.ie 1:30pm up 22 days, 22:51, 2 users, load average: 0.00, 0.06, 0.03
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:17:17 GMT