

5 PPP-Link with MS-CHAP Callback
5.1 'PPPD' Dialscript
The 'pppd'-dialscript, which is commented in this paragraph, is an example dial script.
#!/bin/bash
# Let us call the Windows NT 4.0 Server
/usr/sbin/pppd /dev/modem 38400 file "/etc/ppp/options.nt" callback 555111
# Wait for a callback from the Windows NT 4.0 server
/usr/sbin/pppd /dev/modem 38400 file "/etc/ppp/options.callback"
File: dial_winnt
The first PPPD call in this script is the same as in chapter 4. Except
for the callback parameter. It is obvious what this parameter means. The
second PPPD call will be described in detail here.
5.2 Configuration File /etc/ppp/options.callback
Because the /dev/modem, 38400 and file parameters are described in chapter
4 the file /etc/ppp/options.callback will be described.
Only the new parameters will be described in detail.
connect '/usr/sbin/chat -v -f /etc/ppp/nt-callback.chat'
crtscts
bsdcomp 15
lock
debug
lcp-echo-interval 20
lcp-echo-failure 2
192.168.0.3:0.0.0.0
name "domain\\my_login"
remotename "inbelnt"
-detach
receive-all
file : /etc/ppp/options.callback
Parameter explanation file /etc/ppp/options.callback :
|
connect '....'
|
: The modem connection is made with the program 'chat'. The for chat
needed information is stored in the file nt_callback.chat (That is what
-f means). The file nt_callback.chat is explained below. The parameter
-v means that all log messages are stored via syslogd in
/var/log/messages.
|
|
crtscts
|
: Use hardware flow control
|
|
bsdcomp 15
|
: Use bsd-style compression
|
|
lock
|
: Lock the modem
|
|
debug
|
: Activates the debug mode. All messages are stored in /var/log/messages
|
|
lcp-echo-interval 20
|
: see 'man pppd'
|
|
lcp-echo-failure 2
|
: see 'man pppd'
|
|
192.168.0.3:0.0.0.0
|
: Definition of the remote and local ip addresses
from <local_ip_addr>:<remote_ip_addr>
|
|
name "domain\\my_login"
|
: Your NT user name. This has to be the same as in chap secrets.
The safest way is to use domain\\user form.
|
|
remotename "inbelnt"
|
: The name of your NT server. PPPD uses this for the chap secrets file.
|
|
-detach
|
: Detach from the controlling terminal. PPPD will fork to become
a background process.
|
|
receive-all
|
: This is for buggy OS's, like MS that handle the asyncmap not very well
|
Parameter explanation file /etc/ppp/nt_callback.chat :
|
TIMEOUT 120
|
: Disconnect after 60 seconds if there is no response
|
|
ABORT "NO CARRIER"
|
: Abort if the modem report no carrier
|
|
ABORT "BUSY"
|
: Abort if the modem is busy
|
|
ABORT "NO DIALTONE"
|
: Abort if you have no dial tone
|
|
ABORT "ERROR"
|
: Abort when the modem reports error
|
|
"" +++ATZ
|
: Initialize the modem
|
|
OK ATE1Q0&C1&S0
|
: Initialize the modem
|
|
RING ATA
|
: Wait for a call
|
|
CONNECT ""
|
: Wait for the modem reports a connect
|
5.3 Protocol PPP/MSCHAP Link with 'User Defined Callback' Function
Your log should be like this one :
Jan 23 19:48:55 dijklinux pppd[501]: pppd 2.3.5 started by root, uid 0
Jan 23 19:48:57 dijklinux chat[502]: timeout set to 60 seconds
Jan 23 19:48:57 dijklinux chat[502]: abort on (BUSY)
Jan 23 19:48:57 dijklinux chat[502]: abort on (NO DIALTONE)
Jan 23 19:48:57 dijklinux chat[502]: abort on (ERROR)
Jan 23 19:48:57 dijklinux chat[502]: abort on (NO CARRIER)
Jan 23 19:48:57 dijklinux chat[502]: send (+++ATZ^M)
Jan 23 19:48:57 dijklinux chat[502]: expect (OK)
Jan 23 19:48:58 dijklinux chat[502]: +++ATZ^M^M
Jan 23 19:48:58 dijklinux chat[502]: OK
Jan 23 19:48:58 dijklinux chat[502]: -- got it
Jan 23 19:48:58 dijklinux chat[502]: send (ATE1Q0&C1&S0DT555222^M)
Jan 23 19:48:58 dijklinux chat[502]: expect (CONNECT)
Jan 23 19:48:58 dijklinux chat[502]: ^M
Jan 23 19:49:20 dijklinux chat[502]: ATE1Q0&C1&S0DT555222^M^M
Jan 23 19:49:20 dijklinux pppd[501]: Serial connection established.
Jan 23 19:49:20 dijklinux chat[502]: CONNECT
Jan 23 19:49:20 dijklinux chat[502]: -- got it
Jan 23 19:49:20 dijklinux chat[502]: send (^M)
Jan 23 19:49:21 dijklinux pppd[501]: Using interface ppp0
Jan 23 19:49:21 dijklinux pppd[501]: Connect: ppp0 <--> /dev/modem
Jan 23 19:49:21 dijklinux pppd[501]: sent [LCP ConfReq id=0x1 <callback 0x605> 06 b6 ce 7a f2 07 02 08 02 00]
Jan 23 19:49:24 dijklinux pppd[501]: sent [LCP ConfReq id=0x1 <callback 0x605> 06 b6 ce 7a f2 07 02 08 02 00]
Jan 23 19:49:25 dijklinux pppd[501]: rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap 80> <magic 0x5b1e> <pcomp> <accomp>]
Jan 23 19:49:25 dijklinux pppd[501]: sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap 80> <magic 0x5b1e> <pcomp> <accomp>]
Jan 23 19:49:25 dijklinux pppd[501]: rcvd [LCP ConfAck id=0x1 <callback 0x605> 06 b6 ce 7a f2 07 02 08 02 00]
Jan 23 19:49:25 dijklinux pppd[501]: cbcp_lowerup
Jan 23 19:49:25 dijklinux pppd[501]: want: 14
Jan 23 19:49:25 dijklinux pppd[501]: rcvd [CHAP Challenge id=0x10 <e7be164ac369627f>, name = ""]
Jan 23 19:49:25 dijklinux pppd[501]: sent [CHAP Response id=0x10 <00000000000000000000000000000000000000000000000016d6060f4e66b90c961d5e382ba5b77fc7b8a1c59de9668401>, name = "my_login"]
Jan 23 19:49:26 dijklinux pppd[501]: rcvd [CHAP Success id=0x10 ""]
Jan 23 19:49:26 dijklinux pppd[501]: cbcp_open
Jan 23 19:49:26 dijklinux pppd[501]: rcvd [CBCP Request id=0x1 < NoCallback> 02 05 00 01 00]
Jan 23 19:49:26 dijklinux pppd[501]: length: 7
Jan 23 19:49:26 dijklinux pppd[501]: no callback allowed
Jan 23 19:49:26 dijklinux pppd[501]: length: 5
Jan 23 19:49:26 dijklinux pppd[501]: user callback allowed
Jan 23 19:49:26 dijklinux pppd[501]: cbcp_resp cb_type=6
Jan 23 19:49:26 dijklinux pppd[501]: cbcp_resp CONF_USER
Jan 23 19:49:26 dijklinux pppd[501]: sent [CBCP Response id=0x1 < UserDefined delay = 5 number = 555111>] 35 35 35 31 31 31 00
Jan 23 19:49:26 dijklinux pppd[501]: rcvd [CBCP Ack id=0x1 < UserDefined delay = 5 number = 555111>] 35 35 35 31 31 31 00
Jan 23 19:49:26 dijklinux pppd[501]: peer will call: 555111
Jan 23 19:49:26 dijklinux pppd[501]: sent [LCP TermReq id=0x2 "Call me back, please"]
Jan 23 19:49:26 dijklinux pppd[501]: rcvd [LCP TermAck id=0x2]
Jan 23 19:49:26 dijklinux pppd[501]: Connection terminated.
Jan 23 19:49:27 dijklinux pppd[501]: Exit.
Jan 23 19:49:27 dijklinux pppd[503]: pppd 2.3.5 started by root, uid 0
Jan 23 19:49:28 dijklinux chat[504]: timeout set to 120 seconds
Jan 23 19:49:28 dijklinux chat[504]: abort on (NO CARRIER)
Jan 23 19:49:28 dijklinux chat[504]: abort on (BUSY)
Jan 23 19:49:28 dijklinux chat[504]: abort on (NO DIALTONE)
Jan 23 19:49:28 dijklinux chat[504]: abort on (ERROR)
Jan 23 19:49:28 dijklinux chat[504]: send (+++ATZ^M)
Jan 23 19:49:29 dijklinux chat[504]: expect (OK)
Jan 23 19:49:30 dijklinux chat[504]: +++ATZ^M^M
Jan 23 19:49:30 dijklinux chat[504]: OK
Jan 23 19:49:30 dijklinux chat[504]: -- got it
Jan 23 19:49:30 dijklinux chat[504]: send (ATE1Q0&C1&S0^M)
Jan 23 19:49:30 dijklinux chat[504]: expect (RING)
Jan 23 19:49:30 dijklinux chat[504]: ^M
Jan 23 19:49:30 dijklinux chat[504]: ATE1Q0&C1&S0^M^M
Jan 23 19:49:30 dijklinux chat[504]: OK^M
Jan 23 19:49:39 dijklinux chat[504]: ^M
Jan 23 19:49:39 dijklinux chat[504]: RING
Jan 23 19:49:39 dijklinux chat[504]: -- got it
Jan 23 19:49:39 dijklinux chat[504]: send (ATA^M)
Jan 23 19:49:39 dijklinux chat[504]: expect (CONNECT)
Jan 23 19:49:39 dijklinux chat[504]: ^M
Jan 23 19:49:54 dijklinux chat[504]: ATA^M^M
Jan 23 19:49:54 dijklinux chat[504]: CONNECT
Jan 23 19:49:54 dijklinux chat[504]: -- got it
Jan 23 19:49:54 dijklinux chat[504]: send (^M)
Jan 23 19:49:54 dijklinux pppd[503]: Serial connection established.
Jan 23 19:49:55 dijklinux pppd[503]: Using interface ppp0
Jan 23 19:49:55 dijklinux pppd[503]: Connect: ppp0 <--> /dev/modem
Jan 23 19:49:55 dijklinux pppd[503]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4fb63e1d> <pcomp> <accomp>]
Jan 23 19:49:56 dijklinux pppd[503]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x4fb63e1d> <pcomp> <accomp>]
Jan 23 19:49:57 dijklinux pppd[503]: rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap 80> <magic 0x5f94> <pcomp> <accomp>]
Jan 23 19:49:57 dijklinux pppd[503]: sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap 80> <magic 0x5f94> <pcomp> <accomp>]
Jan 23 19:49:57 dijklinux pppd[503]: sent [LCP EchoReq id=0x0 magic=0x4fb63e1d]
Jan 23 19:49:57 dijklinux pppd[503]: rcvd [CHAP Challenge id=0x11 <cc8d9bf4225a5ac1>, name = ""]
Jan 23 19:49:57 dijklinux pppd[503]: sent [CHAP Response id=0x11 <000000000000000000000000000000000000000000000000cd1caf3d911f89510bcb79d1790c591a0dbd26c1f638aa6201>, name = "my_login"]
Jan 23 19:49:57 dijklinux pppd[503]: rcvd [LCP EchoRep id=0x0 magic=0x5f94]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [CHAP Success id=0x11 ""]
Jan 23 19:49:58 dijklinux pppd[503]: sent [IPCP ConfReq id=0x1 <addr 192.168.0.3> <compress VJ 0f 01>]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [CCP ConfReq id=0x1 < 12 06 00 00 00 01>]
Jan 23 19:49:58 dijklinux pppd[503]: sent [CCP ConfReq id=0x1]
Jan 23 19:49:58 dijklinux pppd[503]: sent [CCP ConfRej id=0x1 < 12 06 00 00 00 01>]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 192.168.0.1>]
Jan 23 19:49:58 dijklinux pppd[503]: sent [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 192.168.0.1>]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [IPXCP ConfReq id=0x3 <network 4b484d98> <node 000000000001>]
Jan 23 19:49:58 dijklinux pppd[503]: Unsupported protocol (0x802b) received ; This is IPX
Jan 23 19:49:58 dijklinux pppd[503]: sent [LCP ProtRej id=0x2 80 2b 01 03 00 12 01 06 4b 48 4d 98 02 08 00 00 00 00 00 01]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [IPCP ConfAck id=0x1 <addr 192.168.0.3> <compress VJ 0f 01>]
Jan 23 19:49:58 dijklinux pppd[503]: local IP address 192.168.0.3
Jan 23 19:49:58 dijklinux pppd[503]: remote IP address 192.168.0.1
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [CCP ConfAck id=0x1]
Jan 23 19:49:58 dijklinux pppd[503]: rcvd [CCP TermReq id=0x4 00 00 02 dc]
Jan 23 19:49:58 dijklinux pppd[503]: sent [CCP TermAck id=0x4]
Jan 23 19:50:01 dijklinux pppd[503]: sent [CCP ConfReq id=0x1]
Jan 23 19:50:01 dijklinux pppd[503]: rcvd [CCP TermAck id=0x1]
Jan 23 19:50:01 dijklinux pppd[503]: sent [CCP TermReq id=0x2"No compression negotiated"]
Jan 23 19:50:01 dijklinux pppd[503]: rcvd [CCP TermAck id=0x2]
Jan 23 19:50:17 dijklinux pppd[503]: sent [LCP EchoReq id=0x1 magic=0x4fb63e1d]
Jan 23 19:50:17 dijklinux pppd[503]: rcvd [LCP EchoRep id=0x1 magic=0x5f94]
Jan 23 19:50:37 dijklinux pppd[503]: sent [LCP EchoReq id=0x2 magic=0x4fb63e1d]
Jan 23 19:50:37 dijklinux pppd[503]: rcvd [LCP EchoRep id=0x2 magic=0x5f94]
Jan 23 19:50:41 dijklinux pppd[503]: Terminating on signal 2.
Jan 23 19:50:41 dijklinux pppd[503]: sent [LCP TermReq id=0x3 "User request"]
Jan 23 19:50:41 dijklinux pppd[503]: rcvd [LCP TermAck id=0x3]
Jan 23 19:50:41 dijklinux pppd[503]: Connection terminated.
Jan 23 19:50:42 dijklinux pppd[503]: Exit.
Part of file /var/log/messages


MODIFIED LINUX PPP/NT HOWTO V2.1