Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '/etc/ppp/options works as it should' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
/etc/ppp/options works as it should
Authored by: nobody on May 18, '02 09:32:41PM

to make an options file, copy the pppd options (ps -alwwx | grep pppd) to the clipboard
then create the directory /etc/ppp
open a new file there, call it options
paste the contents of the clipboard.
now, most options are 2 words, some are only one.
replace the spaces between the options with newlines.
so you will end up like this:

serviceid 6
logfile /tmp/ppp.log
plugin PPPoE.ppp
pppoeinterface en0
cancelcode 136
lcp-echo-interval 10
lcp-echo-failure 3
receive-all
noipdefault
ipcp-accept-local
ipcp-accept-remote
usepeerdns
noauth
# note here: if your username contains characters like the @ enclose the username with quotes!
user 'username@serviceprovider.com'
password 45398503948
forcedetach
noccp
defaultroute

---------------
your actual file maybe will look a little different from mine.
save the file, make it readable only for root (chmod 600 options) otherwise anybody will be able to see the contents.

of course this configuration will only work if you stop starting and configuring pppd with the OSX supplied tools.
I start it via a script in /Library startup-items.



[ Reply to This | # ]
/etc/ppp/options works as it should
Authored by: progers@alumni.u on Jun 16, '02 04:04:40PM

Has anyone managed to successfully launch pppd from the command line? I'm trying to create a script that will allow me to make my iMac go online from my Powerbook over airport.

I tried extracting the parameters associated with the pppd command issued by the system using "ps -axww" but the returned parameters don't work. I've tried putting the supplied options into /etc/ppp/options all on one line and also broken up into separate lines, but some of the options are not recognized. I've also tried entering the command directly from the shell and still the options are not recognized. The man page is no help, as it doesn't mention the extra options apple created for interfacing with OSX. The options (and command) I see in the output from ps are:

pppd serviceid 0 logfile /tmp/ppp.log /dev/cu.modem 115200 connect /usr/libexec/
CCLEngine -l 0 -f '/Library/Modem Scripts/Apple Internal 56K Modem (v.34)' -T '
4165555555' -E -S 150 -s 0 -e 1 -c 1 -p 0 -d 0 -C 'Cancel' -I 'Internet
Connect' -i 'file://localhost/System/Library/SystemConfiguration/PPPController.b
undle/Contents/Resources/NetworkConnect.icns' redialalternate altconnect /usr/li
bexec/CCLEngine -l 0 -f '/Library/Modem Scripts/Apple Internal 56K Modem (v.34)'
-T '4165555555' -E -S 150 -s 0 -e 1 -c 1 -p 0 -d 0 -C 'Cancel' -I 'Int
ernet Connect' -i 'file://localhost/System/Library/SystemConfiguration/PPPContro
ller.bundle/Contents/Resources/NetworkConnect.icns' -T '4165555555' busycode 12
2 redialcount 1 redialtimer 30 disconnect /usr/libexec/CCLEngine -m 1 -l 0 -f '/
Library/Modem Scripts/Apple Internal 56K Modem (v.34)' -E -S 150 -C 'Cancel'
-I 'Internet Connect' -i 'file://localhost/System/Library/SystemConfiguration/PP
PController.bundle/Contents/Resources/NetworkConnect.icns' remoteaddress 4169411
462 cancelcode 136 idle 900 lcp-echo-interval 10 lcp-echo-failure 3 mru 1500 mtu
1500 receive-all ipparam 10.0.1.2 0:0 noipdefault ipcp-accept-local ipcp-accept
-remote usepeerdns noauth user <myusername> password <mypassword> forcedetach
noccp plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/
PlugIns/PPPDialogs.ppp noaskpassword call <Provider>

This results in a the error "pppd: unrecognized option '-l'" if entered on the command line or if saved in the options file minus the initial "pppd". Parsing an options file with the above options even causes the regular ppp connect from the GUI to fail (I assume because of the same error). So what's up with all the strange options? (-l -E etc?).

Ideally, I'd like to use a separate options file when connecting remotely, and ignore it for local dialup, but the "file <filename>" option doesn't seem to work either. I can just make a script that calls pppd with the full parameter list and activate it by ssh.

- Pat



[ Reply to This | # ]
Fixed my problem
Authored by: progers@alumni.u on Jun 17, '02 08:29:48PM

Ok, I fixed my own problem. The first thing I should have done is learn how to read. I completely ignored the previous posters advice about quoting my user name which did contain an '@'.

My real problem was that ps doesn't show double quoted arguments with the quotes - just the space. All of the connect options are supposed to reference "an executable shell command ... to set up the serial line". This command is /usr/libexec/CCLEngine. The weird options I was seing weren't being passed to pppd, but CCLEngine. So if you try this (and I know you want to) remember to double quote everything from CCLEngine to the next ppd option. It should look something like this:

#!/bin/sh

sudo pppd serviceid 0 logfile /tmp/ppp.log /dev/cu.modem 115200 connect "/usr/libexec/CCLEngine -l 0 -f '/Library/Modem Scripts/Apple Internal 56K Modem (v.34)' -T '4165555555' -E -S 150 -s 0
-e 1 -c 1 -p 0 -d 0 -C 'Cancel' -I 'Internet Connect' -i 'file://localhost/System/Library/SystemConfiguration/PPPController.bundle/Contents/Resources/NetworkConnect.icns'" redialalternate altco
nnect "/usr/libexec/CCLEngine -l 0 -f '/Library/Modem Scripts/Apple Internal 56K Modem (v.34)' -T '4165555555' -E -S 150 -s 0 -e 1 -c 1 -p 0 -d 0 -C 'Cancel' -I 'Internet Connect' -i 'file
://localhost/System/Library/SystemConfiguration/PPPController.bundle/Contents/Resources/NetworkConnect.icns' -T '4165555555'" busycode 122 redialcount 1 redialtimer 30 disconnect "/usr/libexec/CCL
Engine -m 1 -l 0 -f '/Library/Modem Scripts/Apple Internal 56K Modem (v.34)' -E -S 150 -C 'Cancel' -I 'Internet Connect' -i 'file://localhost/System/Library/SystemConfiguration/PPPController.bun
dle/Contents/Resources/NetworkConnect.icns'" remoteaddress 4165555555 cancelcode 136 idle 900 lcp-echo-interval 10 lcp-echo-failure 3 mru 1500 mtu 1500 receive-all ipparam 10.0.1.2 0:0 noipdefault
ipcp-accept-local ipcp-accept-remote usepeerdns noauth user 'username' password <very-secret> forcedetach noccp plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIn
s/PPPDialogs.ppp noaskpassword call Provider

Hope this helps somebody. Now I have to figure out how to get my airport to broadcast through the aluminum siding on my house...

- Pat



[ Reply to This | # ]
/etc/ppp/options works as it should
Authored by: capmikee on Aug 08, '04 01:48:59PM
of course this configuration will only work if you stop starting and configuring pppd with the OSX supplied tools.

It seems to work fine with starting pppd from Aqua.

As for configuration, does anyone know if there's a way of extracting the pppd options from the Preferences file, either with official APIs or with hacks? The Perl script listed above looked good, but my passwords in /var/db/SystemConfiguration/preferences.xml are encrypted.



[ Reply to This | # ]