Author

Christopher Marshall (christopherlmarshall@yahoo.com)

Raw Notes on PPP

# common speeds 
19200
38400
57600
115200

# experiments
# nodetach helps with testing by not detaching the pppd process from the controlling
# terminal, allowing you to cntl-c to kill it when something goes wrong, and also
# causing error messages to be printed to stdout instead of just to the syslog.
# local means "don't use modem control lines"
# pty lets you specify an arbitrary command to run to receive packets from
# which is great for VPN's

   # general advice: remove /etc/ppp/options before trying experiments because you never
   # know what other options you might be relying on that are in /etc/ppp/options unless
   # you zero them out first.

   # pty/tty pair
   pppd /dev/ptyp0 nodetach local 10.5.0.1:10.5.0.2
   pppd /dev/ttyp0 nodetach local

   # using pty argument
   pppd nodetach pty "pppd notty 10.0.3.1:10.0.3.2"
   pppd nodetach 10.0.3.1:10.0.3.2 pty "pppd notty"

   # ssh/ppp VPN
   pppd nodetach 10.1.0.2:10.1.0.1 pty "ssh -l root remotehost pppd notty"

# how to check the speed of the serial port once pppd takes it over
stty -F /dev/ttyS0

# important files
options in /etc/ppp/options

# procedure for hooking up two machines,  A and B
# on A
pppd /dev/ttyS0 115200 crtscts 10.3.0.1:10.3.0.2
# on B
pppd /dev/ttyS0 115200 crtscts

# from within a minicom login-prompt of A to B
minicom
login
su
pppd 115200 crtscts
cntl-AZ from minicom
pppd /dev/ttyS0 115200 crtscts 10.3.0.1:10.3.0.2

# for a dial-in server (this is clever!).  This is even easier than 
# getting mgetty to work.
pppd /dev/ttyS0 115200 modem crtscts init "chat '' ATZ OK ATS0=1 OK"

# another route
adduser dialin
edit shell in /etc/passwd for user dialin from /bin/bash to /usr/sbin/pppd
remove home directory for security reasons
chmod u+s /usr/sbin/pppd
edit /etc/ppp/options
        115200
        10.3.0.1:10.3.0.2
minicom from another host
log in as user dialin
cntl-AQ from minicom
pppd /dev/ttyS0 115200 crtscts
you're in!

# two modems are connected and you want to bring up a ppp link
# I illustrate the procedure for directly connected modems (long haul cable)
# I was setting the speed too low which prevented this from working
# Would this work if I didn't set a speed?  What does pppd do with the speed?
# "nodetach debug" are life savers!
# If you don't assign IP addresses or some other protocol, like IPX, the link fails.
# Why can't I talk to a modem by echoing commands to /dev/ttyS0?
A:
minicom; atm0; atx3; atd; cntl-A-Q
stty -F /dev/ttyS0
   38400 baud
pppd /dev/ttyS0 38400 nodetach debug 10.3.0.1:10.3.0.2
B:
minicom; atm0; atx3; ata; cntl-A-Q
stty -F /dev/ttyS0
   38400 baud
pppd /dev/ttyS0 38400 nodetach debug

hopeless_linux: RawNotes/ppp (last modified 2007-07-01 16:01:00)