PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/share/examples/ppp/ppp.conf.span-isp.working

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