Start, Inspect and Stop PPP Connections with pon and poff
pon dials a named PPP peer by handing it straight to pppd, and it will not tell you a thing if it works. You will bring up one configured peer, check what actually happened, and stop the right connection with poff. The examples follow the installed Debian PPP scripts from package ppp 2.4.9-1+1.1ubuntu4. Allow about fifteen minutes, plus whatever your modem, chat script or provider needs.
The route
Jump straight to the step you need, or tick off Done means at the end.
You need ppp installed, a peer file under /etc/ppp/peers/, and permission to use it. Do not put passwords in commands or paste secrets into a support transcript.
1. Check the available peer and command
- Confirm the binaries exist. Run
command -v pon poff plogand expect all three to resolve. - Check the peer file is there. Replace
PEER_NAMEwith the basename of the peer file you were given, such asproviderorhome-vpn, and list it withls -l /etc/ppp/peers/PEER_NAME. - Read the usage line.
pon --helpprintsUsage: pon [OPTIONS] [provider] [arguments].
$ command -v pon poff plog
/usr/bin/pon
/usr/bin/poff
/usr/bin/plog
$ ls -l /etc/ppp/peers/PEER_NAME
$ pon --help
Usage: pon [OPTIONS] [provider] [arguments]
The peer name is not an arbitrary label: pon PEER_NAME selects /etc/ppp/peers/PEER_NAME directly. That file can hold a chat script, credentials and device settings, so inspect it through your normal privileged review process rather than editing a working file on a whim.
Checkpoint
Continue only when the peer file exists and you know which account is allowed to start it. If ls or pon reports permission denied, fix access with the system administrator; do not make the peer file world-readable. On this machine an ordinary user without the right group membership gets an access error and needs adding to the system's PPP access group.
2. Start one named PPP peer
Starting a connection changes network state and may trigger calls or charges. Confirm the peer name before you run anything:
$ pon PEER_NAME
- Expect silence.
ponnormally produces no success message; it just passes the peer name topppd. - Watch extra arguments. Anything after the peer name is passed on as additional
pppdarguments, so do not copy options from a different provider's instructions without checking that provider's peer configuration. - Know the fallback. With no argument,
ponfirst runs/etc/ppp/ppp_on_bootif that file exists and is executable, otherwise it falls back to/etc/ppp/peers/provider. That default can catch you out on a host with several peers, so name the peer explicitly.
Verify the process and inspect the latest log lines:
$ pgrep -a pppd
$ plog
plog shows the tail of /var/log/ppp.log when that file is non-empty. If it is absent or empty, it filters the tail of /var/log/syslog for pppd and chat messages instead. It needs root or membership of the adm group. For more lines, pass an option tail understands, for example plog -n 50.
3. Diagnose a failed start without repeating it blindly
If pon names a missing peer, it reports that /etc/ppp/peers/PEER_NAME does not exist. Check the exact spelling and list the directory with the access needed to do so:
$ ls -l /etc/ppp/peers/
$ plog -n 50
If a connection process exists but the link never became usable, read the chat and PPP messages before retrying. A second pon can create another simultaneous connection: the manual explicitly permits multiple connections, so check first rather than assume:
$ pgrep -a pppd
$ ps -o pid,args -C pppd
Do not treat an empty plog result as proof the start failed. Logging may be going to the system log, access may be restricted, or the process may have exited quickly. Use the exit status straight after the command you are testing:
$ pon PEER_NAME
$ printf 'pon exit status: %s\n' "$?"
A zero status means the start script accepted the request. It does not prove authentication, carrier detection or IP configuration succeeded; that needs the process and log checks above.
4. Stop exactly one connection
Stopping PPP is service-disrupting, so know what you are about to hit before you hit it.
- One connection running.
poffwith no argument stops or signals it. - More than one connection running. An argument-free
poffrefuses to choose and exits with status 1, so name the peer:poff PEER_NAME. - Wrong peer name. The script reports it could not find a matching
pppd call PEER_NAMEprocess, a useful safeguard: stop and check the name rather than sending signals to unrelated processes.
$ poff
$ printf 'poff exit status: %s\n' "$?"
$ pgrep -a pppd || true
$ poff PEER_NAME
Warning
poff -a stops every running PPP connection and ignores a provider argument. Use it only when taking down every PPP link is intentional. There is no automatic undo for a stop; reconnect with pon PEER_NAME once you know why the link was stopped.
5. Use the signalling options deliberately
poff accepts one option at a time:
-raskspppdto drop the line and redial.-dtoggles its debug state.-casks it to renegotiate compression.
$ poff -r PEER_NAME
$ poff -d PEER_NAME
$ poff -c PEER_NAME
These signal a live connection, so use them only when the peer's operational procedure calls for that particular action. For a normal shutdown, plain poff PEER_NAME is enough. poff -h prints help, and the installed script reports its own version with poff -v:
$ poff -v
/usr/bin/poff: 1.8
Done means
- Peer file confirmed. The intended peer file exists under
/etc/ppp/peers/and access is correctly scoped. - Start verified, not assumed.
pon PEER_NAMEwas followed by a process and log check, not just a silent return to the prompt. - Log source known. You know whether
plogread/var/log/ppp.logor the filtered system log, and have administrator access if needed. - Stop targeted correctly. You stopped only the intended peer, or consciously used
poff -afor every PPP connection.