xref: /freebsd/share/examples/ppp/ppp.conf.span-isp.working (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1c6f660d1SBrian Somers
2c6f660d1SBrian Somers# This is a working example of ppp.conf.span-isp that uses ppp connections
3c6f660d1SBrian Somers# to the same machine through 3 null-modem serial cables.
4c6f660d1SBrian Somers#
5c6f660d1SBrian Somers#    cuaD03  <-> cuaD04
6c6f660d1SBrian Somers#    cuaD01  <-> cuaD06
7c6f660d1SBrian Somers#    cuaD00  <-> cuaD07
8c6f660d1SBrian Somers#
9c6f660d1SBrian Somers# with gettys running on cuaD04, cuaD06 and cuaD07.  The gettytab entry
10c6f660d1SBrian Somers# for these devices has a pp= capability that references a script that
11c6f660d1SBrian Somers# says:
12c6f660d1SBrian Somers#
13c6f660d1SBrian Somers#    #! /bin/sh
14c6f660d1SBrian Somers#    tty=$(tty)
15c6f660d1SBrian Somers#    exec /usr/sbin/pppin -direct isp-in-${tty#${tty%?}}
16c6f660d1SBrian Somers#
17c6f660d1SBrian Somers# The whole thing is brought up with these commands:
18c6f660d1SBrian Somers#
19c6f660d1SBrian Somers#    ppp -b isp1
20c6f660d1SBrian Somers#    ppp -b isp2
21c6f660d1SBrian Somers#    ppp -b isp3
22c6f660d1SBrian Somers#
23c6f660d1SBrian Somers# Something rather strange happens here.
24c6f660d1SBrian Somers# If you connect to the vpn-in diagnostic socket with ``pppctl
25fab8f273SCrist J. Clark# /var/run/ppp/vpn-in'' and do a ``show links'', only a single link shows up.
26c6f660d1SBrian Somers# If you connect to the vpn diagnostic socket (which is created in
27c6f660d1SBrian Somers# ppp.linkup.span-isp.working, you see three links.  This is because inetd
28c6f660d1SBrian Somers# is told to ``wait'' for ppp to finish and the receiving ppp gets to
29c6f660d1SBrian Somers# handle all incoming packets on the first descriptor.
30c6f660d1SBrian Somers#
31c6f660d1SBrian Somers# This is why enabling LQR won't work - VPN-IN has magic number problems,
32c6f660d1SBrian Somers# fails to reply to LQRs and the VPN invocations end up shutting down.
33c6f660d1SBrian Somers#
34c6f660d1SBrian Somers# If anyone can come up with a better way of doing PPP over UDP I'd be
35c6f660d1SBrian Somers# interrested to hear it.  Currently, the server doesn't connect() or
36c6f660d1SBrian Somers# bind().... but the client connect()s.  Is there any other way ?
37c6f660d1SBrian Somers#
38c6f660d1SBrian Somers#          Answers on a postcard please ! (to brian@Awfulhak.org)
39c6f660d1SBrian Somers#
40c6f660d1SBrian Somers
41c6f660d1SBrian Somersdefault:
42c6f660d1SBrian Somers  set speed 115200
43c6f660d1SBrian Somers  set device /dev/cuaD00 /dev/cuaD01 /dev/cuaD03
44c6f660d1SBrian Somers  set dial
45c6f660d1SBrian Somers  set login
46c6f660d1SBrian Somers  set redial 3 5
47c6f660d1SBrian Somers  set timeout 0
481f82daa5SBrian Somers  enable lqr echo
49c6f660d1SBrian Somers  set lqrperiod 15
50c6f660d1SBrian Somers
51c6f660d1SBrian Somersisp1:
52e40db2c4SGiorgos Keramidas  set authname "isp1name"
53e40db2c4SGiorgos Keramidas  set authkey "isp1key"
54c6f660d1SBrian Somers
55c6f660d1SBrian Somersisp2:
56e40db2c4SGiorgos Keramidas  set authname "isp2name"
57e40db2c4SGiorgos Keramidas  set authkey "isp2key"
58c6f660d1SBrian Somers
59c6f660d1SBrian Somersisp3:
60e40db2c4SGiorgos Keramidas  set authname "isp3name"
61e40db2c4SGiorgos Keramidas  set authkey "isp3key"
62c6f660d1SBrian Somers
63c6f660d1SBrian Somers
64c6f660d1SBrian Somersvpn:
65c6f660d1SBrian Somers  set enddisc LABEL
66c6f660d1SBrian Somers  set speed sync
67c6f660d1SBrian Somers  set mrru 1500
685e57afbeSBrian Somers  set mru 1504			# Room for the MP header
69e40db2c4SGiorgos Keramidas  set authname "vpnname"
70e40db2c4SGiorgos Keramidas  set authkey "vpnkey"
71c6f660d1SBrian Somers  add! default HISADDR
72c6f660d1SBrian Somers  disable deflate pred1 lqr
73c6f660d1SBrian Somers  deny deflate pred1
74c6f660d1SBrian Somers
75c6f660d1SBrian Somersvpn1:
76c6f660d1SBrian Somers  rename 1
77c6f660d1SBrian Somers  set device 127.0.2.7:ppp/udp
78c6f660d1SBrian Somers
79c6f660d1SBrian Somersvpn2:
80c6f660d1SBrian Somers  rename 2
81c6f660d1SBrian Somers  set device 127.0.2.6:ppp/udp
82c6f660d1SBrian Somers
83c6f660d1SBrian Somersvpn3:
84c6f660d1SBrian Somers  rename 3
85c6f660d1SBrian Somers  set device 127.0.2.4:ppp/udp
86c6f660d1SBrian Somers
87c6f660d1SBrian Somers
88c6f660d1SBrian Somersvpn-in:
89c6f660d1SBrian Somers  set enddisc label
90c6f660d1SBrian Somers  set speed sync
91c6f660d1SBrian Somers  set mrru 1500
925e57afbeSBrian Somers  set mru 1504			# Room for the MP header
93c6f660d1SBrian Somers  enable chap
94c6f660d1SBrian Somers  disable lqr
95c6f660d1SBrian Somers  set ifaddr 127.0.0.2 127.0.0.3
967558c91fSCrist J. Clark  set server /var/run/ppp/vpn-in "" 0177
97c6f660d1SBrian Somers
98c6f660d1SBrian Somers
99c6f660d1SBrian Somersisp-in-7:
100c6f660d1SBrian Somers  set ifaddr 127.0.2.7 127.0.3.7
101c6f660d1SBrian Somers
102c6f660d1SBrian Somersisp-in-6:
103c6f660d1SBrian Somers  set ifaddr 127.0.2.6 127.0.3.6
104c6f660d1SBrian Somers
105c6f660d1SBrian Somersisp-in-4:
106c6f660d1SBrian Somers  set ifaddr 127.0.2.4 127.0.3.4
107