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