xref: /dflybsd-src/share/examples/ppp/ppp.conf.span-isp.working (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino# $FreeBSD: src/share/examples/ppp/ppp.conf.span-isp.working,v 1.2.2.4 2003/05/03 21:35:06 keramida Exp $
286d7f5d3SJohn Marino# $DragonFly: src/share/examples/ppp/ppp.conf.span-isp.working,v 1.2 2003/06/17 04:36:57 dillon Exp $
386d7f5d3SJohn Marino
486d7f5d3SJohn Marino# This is a working example of ppp.conf.span-isp that uses ppp connections
586d7f5d3SJohn Marino# to the same machine through 3 null-modem serial cables.
686d7f5d3SJohn Marino#
786d7f5d3SJohn Marino#    cuaD03  <-> cuaD04
886d7f5d3SJohn Marino#    cuaD01  <-> cuaD06
986d7f5d3SJohn Marino#    cuaD00  <-> cuaD07
1086d7f5d3SJohn Marino#
1186d7f5d3SJohn Marino# with gettys running on cuaD04, cuaD06 and cuaD07.  The gettytab entry
1286d7f5d3SJohn Marino# for these devices has a pp= capability that references a script that
1386d7f5d3SJohn Marino# says:
1486d7f5d3SJohn Marino#
1586d7f5d3SJohn Marino#    #! /bin/sh
1686d7f5d3SJohn Marino#    tty=$(tty)
1786d7f5d3SJohn Marino#    exec /usr/sbin/pppin -direct isp-in-${tty#${tty%?}}
1886d7f5d3SJohn Marino#
1986d7f5d3SJohn Marino# The whole thing is brought up with these commands:
2086d7f5d3SJohn Marino#
2186d7f5d3SJohn Marino#    ppp -b isp1
2286d7f5d3SJohn Marino#    ppp -b isp2
2386d7f5d3SJohn Marino#    ppp -b isp3
2486d7f5d3SJohn Marino#
2586d7f5d3SJohn Marino# Something rather strange happens here.
2686d7f5d3SJohn Marino# If you connect to the vpn-in diagnostic socket with ``pppctl
2786d7f5d3SJohn Marino# /var/run/ppp/vpn-in'' and do a ``show links'', only a single link shows up.
2886d7f5d3SJohn Marino# If you connect to the vpn diagnostic socket (which is created in
2986d7f5d3SJohn Marino# ppp.linkup.span-isp.working, you see three links.  This is because inetd
3086d7f5d3SJohn Marino# is told to ``wait'' for ppp to finish and the receiving ppp gets to
3186d7f5d3SJohn Marino# handle all incoming packets on the first descriptor.
3286d7f5d3SJohn Marino#
3386d7f5d3SJohn Marino# This is why enabling LQR won't work - VPN-IN has magic number problems,
3486d7f5d3SJohn Marino# fails to reply to LQRs and the VPN invocations end up shutting down.
3586d7f5d3SJohn Marino#
3686d7f5d3SJohn Marino# If anyone can come up with a better way of doing PPP over UDP I'd be
3786d7f5d3SJohn Marino# interrested to hear it.  Currently, the server doesn't connect() or
3886d7f5d3SJohn Marino# bind().... but the client connect()s.  Is there any other way ?
3986d7f5d3SJohn Marino#
4086d7f5d3SJohn Marino#          Answers on a postcard please ! (to brian@Awfulhak.org)
4186d7f5d3SJohn Marino#
4286d7f5d3SJohn Marino
4386d7f5d3SJohn Marinodefault:
4486d7f5d3SJohn Marino  set speed 115200
4586d7f5d3SJohn Marino  set device /dev/cuaD00 /dev/cuaD01 /dev/cuaD03
4686d7f5d3SJohn Marino  set dial
4786d7f5d3SJohn Marino  set login
4886d7f5d3SJohn Marino  set redial 3 5
4986d7f5d3SJohn Marino  set timeout 0
5086d7f5d3SJohn Marino  enable lqr
5186d7f5d3SJohn Marino  set lqrperiod 15
5286d7f5d3SJohn Marino
5386d7f5d3SJohn Marinoisp1:
5486d7f5d3SJohn Marino  set authname "isp1name"
5586d7f5d3SJohn Marino  set authkey "isp1key"
5686d7f5d3SJohn Marino
5786d7f5d3SJohn Marinoisp2:
5886d7f5d3SJohn Marino  set authname "isp2name"
5986d7f5d3SJohn Marino  set authkey "isp2key"
6086d7f5d3SJohn Marino
6186d7f5d3SJohn Marinoisp3:
6286d7f5d3SJohn Marino  set authname "isp3name"
6386d7f5d3SJohn Marino  set authkey "isp3key"
6486d7f5d3SJohn Marino
6586d7f5d3SJohn Marino
6686d7f5d3SJohn Marinovpn:
6786d7f5d3SJohn Marino  set enddisc LABEL
6886d7f5d3SJohn Marino  set speed sync
6986d7f5d3SJohn Marino  set mrru 1500
7086d7f5d3SJohn Marino  set mru 1504			# Room for the MP header
7186d7f5d3SJohn Marino  set authname "vpnname"
7286d7f5d3SJohn Marino  set authkey "vpnkey"
7386d7f5d3SJohn Marino  add! default HISADDR
7486d7f5d3SJohn Marino  disable deflate pred1 lqr
7586d7f5d3SJohn Marino  deny deflate pred1
7686d7f5d3SJohn Marino
7786d7f5d3SJohn Marinovpn1:
7886d7f5d3SJohn Marino  rename 1
7986d7f5d3SJohn Marino  set device 127.0.2.7:ppp/udp
8086d7f5d3SJohn Marino
8186d7f5d3SJohn Marinovpn2:
8286d7f5d3SJohn Marino  rename 2
8386d7f5d3SJohn Marino  set device 127.0.2.6:ppp/udp
8486d7f5d3SJohn Marino
8586d7f5d3SJohn Marinovpn3:
8686d7f5d3SJohn Marino  rename 3
8786d7f5d3SJohn Marino  set device 127.0.2.4:ppp/udp
8886d7f5d3SJohn Marino
8986d7f5d3SJohn Marino
9086d7f5d3SJohn Marinovpn-in:
9186d7f5d3SJohn Marino  set enddisc label
9286d7f5d3SJohn Marino  set speed sync
9386d7f5d3SJohn Marino  set mrru 1500
9486d7f5d3SJohn Marino  set mru 1504			# Room for the MP header
9586d7f5d3SJohn Marino  enable chap
9686d7f5d3SJohn Marino  disable lqr
9786d7f5d3SJohn Marino  set ifaddr 127.0.0.2 127.0.0.3
9886d7f5d3SJohn Marino  set server /var/run/ppp/vpn-in "" 0177
9986d7f5d3SJohn Marino
10086d7f5d3SJohn Marino
10186d7f5d3SJohn Marinoisp-in-7:
10286d7f5d3SJohn Marino  set ifaddr 127.0.2.7 127.0.3.7
10386d7f5d3SJohn Marino
10486d7f5d3SJohn Marinoisp-in-6:
10586d7f5d3SJohn Marino  set ifaddr 127.0.2.6 127.0.3.6
10686d7f5d3SJohn Marino
10786d7f5d3SJohn Marinoisp-in-4:
10886d7f5d3SJohn Marino  set ifaddr 127.0.2.4 127.0.3.4
109