Тестовый стенд: FreeBSD 8.4 i386 Release, модем Novatel U720, mpd-5.7
При этом данный канал используется как вторичный, поэтому строки для шлюза по дефолту, получение DNS от пиров – закоментированы.
И так, вносим такой код в /usr/local/etc/mpd5/mpd.conf (отступы обязательны!):
startup: set user admin admin admin # configure the console set console self 127.0.0.1 5005 set console open # configure the web server set web self 10.5.0.1 5006 set web open default: load inet3g inet3g: create bundle static G1 # set iface up-script /usr/local/etc/mpd5/3g.up-script.sh # set iface down-script /usr/local/etc/mpd5/3g.down-script.sh # set iface addrs 0.0.0.0 !1.2.3.4 # set ipcp ranges 0.0.0.0/0 0.0.0.0/0 # set iface route default # set ipcp enable req-pri-dns req-sec-dns set iface name itc0 set iface enable tcpmssfix set ipcp disable vjcomp log +auth +bund +ccp +chat +echo +iface +ipcp +lcp +phys create link static L1 modem set modem device /dev/cuaU0.0 # set modem speed 115200 set modem watch -cd set modem watch -dsr set modem var $DialPrefix "DT" set modem var $Telephone "#777" # set modem var $InitString "+CGDCONT=1,\"IP\",\"internet.beeline.ru\"" set modem script DialPeer set modem idle-script Ringback set link disable chap set link keep-alive 6 60 set link max-redial 0 set link accept pap set auth authname "IT" set auth password "IT" set link action bundle G1 open
Внимание.
Интертелеком использует протокол PAP для аутентификации, а не CHAP. Будьте внимательны!
При этом в логах при успешном подключении увидим такое:
Dec 24 14:27:22 gate mpd: process 2642 started, version 5.7 (root@gate.domain.ua 18:22 21-Dec-2012) Dec 24 14:27:22 gate mpd: CONSOLE: listening on 127.0.0.1 5005 Dec 24 14:27:22 gate mpd: web: listening on 10.5.0.1 5006 Dec 24 14:27:22 gate mpd: [G1] Bundle: Interface ng0 created Dec 24 14:27:22 gate mpd: [L1] Link: OPEN event Dec 24 14:27:22 gate mpd: [L1] LCP: Open event Dec 24 14:27:22 gate mpd: [L1] LCP: state change Initial --> Starting Dec 24 14:27:22 gate mpd: [L1] LCP: LayerStart Dec 24 14:27:22 gate mpd: [L1] CHAT: Detected Hayes compatible modem. Dec 24 14:27:22 gate mpd: [L1] CHAT: Dialing server at #777... Dec 24 14:27:22 gate mpd: [L1] CHAT: Connected at an unknown speed. Dec 24 14:27:22 gate mpd: [L1] MODEM: chat script succeeded Dec 24 14:27:22 gate mpd: [L1] Link: UP event Dec 24 14:27:22 gate mpd: [L1] LCP: Up event Dec 24 14:27:22 gate mpd: [L1] LCP: state change Starting --> Req-Sent Dec 24 14:27:22 gate mpd: [L1] LCP: SendConfigReq #1 Dec 24 14:27:22 gate mpd: [L1] ACFCOMP Dec 24 14:27:22 gate mpd: [L1] PROTOCOMP Dec 24 14:27:22 gate mpd: [L1] ACCMAP 0x000a0000 Dec 24 14:27:22 gate mpd: [L1] MRU 1500 Dec 24 14:27:22 gate mpd: [L1] MAGICNUM 3966e61a Dec 24 14:27:22 gate mpd: [L1] LCP: rec'd Configure Ack #1 (Req-Sent) Dec 24 14:27:22 gate mpd: [L1] ACFCOMP Dec 24 14:27:22 gate mpd: [L1] PROTOCOMP Dec 24 14:27:22 gate mpd: [L1] ACCMAP 0x000a0000 Dec 24 14:27:22 gate mpd: [L1] MRU 1500 Dec 24 14:27:22 gate mpd: [L1] MAGICNUM 3966e61a Dec 24 14:27:22 gate mpd: [L1] LCP: state change Req-Sent --> Ack-Rcvd Dec 24 14:27:24 gate mpd: [L1] LCP: state change Ack-Rcvd --> Req-Sent Dec 24 14:27:24 gate mpd: [L1] LCP: SendConfigReq #2 Dec 24 14:27:24 gate mpd: [L1] ACFCOMP Dec 24 14:27:24 gate mpd: [L1] PROTOCOMP Dec 24 14:27:24 gate mpd: [L1] ACCMAP 0x000a0000 Dec 24 14:27:24 gate mpd: [L1] MRU 1500 Dec 24 14:27:24 gate mpd: [L1] MAGICNUM 3966e61a Dec 24 14:27:24 gate mpd: [L1] LCP: rec'd Configure Request #2 (Req-Sent) Dec 24 14:27:24 gate mpd: [L1] ACCMAP 0x00000000 Dec 24 14:27:24 gate mpd: [L1] AUTHPROTO PAP Dec 24 14:27:24 gate mpd: [L1] MAGICNUM dc9387f6 Dec 24 14:27:24 gate mpd: [L1] PROTOCOMP Dec 24 14:27:24 gate mpd: [L1] ACFCOMP Dec 24 14:27:24 gate mpd: [L1] LCP: SendConfigAck #2 Dec 24 14:27:24 gate mpd: [L1] ACCMAP 0x00000000 Dec 24 14:27:24 gate mpd: [L1] AUTHPROTO PAP Dec 24 14:27:24 gate mpd: [L1] MAGICNUM dc9387f6 Dec 24 14:27:24 gate mpd: [L1] PROTOCOMP Dec 24 14:27:24 gate mpd: [L1] ACFCOMP Dec 24 14:27:24 gate mpd: [L1] LCP: state change Req-Sent --> Ack-Sent Dec 24 14:27:24 gate mpd: [L1] LCP: rec'd Configure Ack #2 (Ack-Sent) Dec 24 14:27:24 gate mpd: [L1] ACFCOMP Dec 24 14:27:24 gate mpd: [L1] PROTOCOMP Dec 24 14:27:24 gate mpd: [L1] ACCMAP 0x000a0000 Dec 24 14:27:25 gate mpd: [L1] MRU 1500 Dec 24 14:27:25 gate mpd: [L1] MAGICNUM 3966e61a Dec 24 14:27:25 gate mpd: [L1] LCP: state change Ack-Sent --> Opened Dec 24 14:27:25 gate mpd: [L1] LCP: auth: peer wants PAP, I want nothing Dec 24 14:27:25 gate mpd: [L1] PAP: using authname "IT" Dec 24 14:27:25 gate mpd: [L1] PAP: sending REQUEST #1 len: 10 Dec 24 14:27:25 gate mpd: [L1] LCP: LayerUp Dec 24 14:27:25 gate mpd: [L1] PAP: rec'd ACK #1 len: 5 Dec 24 14:27:25 gate mpd: [L1] LCP: authorization successful Dec 24 14:27:25 gate mpd: [L1] Link: Matched action 'bundle "G1" ""' Dec 24 14:27:25 gate mpd: [L1] Link: Join bundle "G1" Dec 24 14:27:25 gate mpd: [G1] Bundle: Status update: up 1 link, total bandwidth 28800 bps Dec 24 14:27:25 gate mpd: [G1] IPCP: Open event Dec 24 14:27:25 gate mpd: [G1] IPCP: state change Initial --> Starting Dec 24 14:27:25 gate mpd: [G1] IPCP: LayerStart Dec 24 14:27:25 gate mpd: [G1] IPCP: Up event Dec 24 14:27:25 gate mpd: [G1] IPCP: state change Starting --> Req-Sent Dec 24 14:27:25 gate mpd: [G1] IPCP: SendConfigReq #1 Dec 24 14:27:25 gate mpd: [G1] IPADDR 192.168.5.6 Dec 24 14:27:25 gate mpd: [G1] IPCP: rec'd Configure Request #1 (Req-Sent) Dec 24 14:27:25 gate mpd: [G1] IPADDR 10.10.20.22 Dec 24 14:27:25 gate mpd: [G1] 10.10.20.22 is OK Dec 24 14:27:25 gate mpd: [G1] IPCP: SendConfigAck #1 Dec 24 14:27:25 gate mpd: [G1] IPADDR 10.10.20.22 Dec 24 14:27:25 gate mpd: [G1] IPCP: state change Req-Sent --> Ack-Sent Dec 24 14:27:25 gate mpd: [G1] IPCP: rec'd Configure Nak #1 (Ack-Sent) Dec 24 14:27:25 gate mpd: [G1] IPADDR XX.XX.XX.XX Dec 24 14:27:25 gate mpd: [G1] XX.XX.XX.XX is OK Dec 24 14:27:25 gate mpd: [G1] IPCP: SendConfigReq #2 Dec 24 14:27:25 gate mpd: [G1] IPADDR XX.XX.XX.XX Dec 24 14:27:25 gate mpd: [G1] IPCP: rec'd Configure Ack #2 (Ack-Sent) Dec 24 14:27:25 gate mpd: [G1] IPADDR XX.XX.XX.XX Dec 24 14:27:25 gate mpd: [G1] IPCP: state change Ack-Sent --> Opened Dec 24 14:27:25 gate mpd: [G1] IPCP: LayerUp Dec 24 14:27:25 gate mpd: [G1] XX.XX.XX.XX -> 10.10.20.22 Dec 24 14:27:25 gate mpd: [G1] IFACE: Up event
$ ifconfig itc0 itc0: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1500 inet XX.XX.XX.XX -> 10.10.20.22 netmask 0xffffffff
Где XX.XX.XX.XX – полученный IP-адрес.