台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()

ip route add table 2 10.10.10.0/24 dev ppp0 src 10.10.10.173
ip route add table 2 default via 10.10.10.1 dev ppp0
ip rule add table 2 from 10.10.10.173/32
ip rule add table 2 from 192.168.180.0/24
ip route add table 2 192.168.180.0/24 dev br1 src 192.168.180.1
ip route add table 2 255.255.255.255 dev br1

參考


台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()

參考


台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()


台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()

問題1

01:41:28 info pptp[23234]: Plugin pptp.so loaded.
01:41:28 info pptp[23234]: PPTP plugin version 2.4.2 compiled for pppd-2.4.2
01:41:28 notice pptp[23235]: pppd 2.4.2 started by admin, uid 0
01:41:28 warn pptp[23235]: PPTP: failed to setsockopt PPTP_SO_TIMEOUT (Operation not supported)
01:41:28 notice pptp[23236]: anon log[callmgr_main:pptp_callmgr.c:132]: IP: 178.162.193.233
01:41:28 notice pptp[23236]: anon log[callmgr_main:pptp_callmgr.c:136]: control connection
01:41:28 notice pptp[23236]: anon log[callmgr_main:pptp_callmgr.c:140]: unix_sock
01:41:28 notice pptp[23237]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
01:41:29 notice pptp[23237]: anon log[ctrlp_disp:pptp_ctrl.c:737]: Received Start Control Connection Reply
01:41:29 notice pptp[23237]: anon log[ctrlp_disp:pptp_ctrl.c:771]: Client connection established.
01:41:29 notice pptp[23237]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
01:41:30 notice pptp[23237]: anon log[ctrlp_disp:pptp_ctrl.c:856]: Received Outgoing Call Reply.
01:41:30 notice pptp[23237]: anon log[ctrlp_disp:pptp_ctrl.c:895]: Outgoing call established (call ID 6, peer's call ID 768).
01:41:30 info pptp[23235]: Using interface ppp0
01:41:30 notice pptp[23235]: Connect: ppp0 <--> pptp (178.162.193.233)
01:41:31 info pptp[23235]: LCP terminated by peer (MPPE required but peer negotiation failed)
01:41:31 notice pptp[23237]: anon log[pptp_read_some:pptp_ctrl.c:542]: read returned zero, peer has closed
01:41:31 notice pptp[23237]: anon log[callmgr_main:pptp_callmgr.c:269]: Closing connection (shutdown)
01:41:31 notice pptp[23237]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
01:41:31 notice pptp[23237]: anon log[pptp_read_some:pptp_ctrl.c:542]: read returned zero, peer has closed
01:41:31 notice pptp[23237]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
01:41:31 info pptp[23235]: Terminating on signal 15.
01:41:34 notice pptp[23235]: Connection terminated.
01:41:34 info pptp[23235]: Exit.

解法

# echo "require-mppe" >> /etc/options.pptp

問題2

02:27:13 info pptp[4381]: Plugin pptp.so loaded.
02:27:13 info pptp[4381]: PPTP plugin version 2.4.2 compiled for pppd-2.4.2
02:27:13 notice pptp[4382]: pppd 2.4.2 started by admin, uid 0
02:27:13 warn pptp[4382]: PPTP: failed to setsockopt PPTP_SO_TIMEOUT (Operation not supported)
02:27:13 notice pptp[4383]: anon log[callmgr_main:pptp_callmgr.c:132]: IP: 178.162.193.233
02:27:13 notice pptp[4383]: anon log[callmgr_main:pptp_callmgr.c:136]: control connection
02:27:13 notice pptp[4383]: anon log[callmgr_main:pptp_callmgr.c:140]: unix_sock
02:27:13 notice pptp[4384]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
02:27:13 notice pptp[4384]: anon log[ctrlp_disp:pptp_ctrl.c:737]: Received Start Control Connection Reply
02:27:13 notice pptp[4384]: anon log[ctrlp_disp:pptp_ctrl.c:771]: Client connection established.
02:27:14 notice pptp[4384]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
02:27:14 notice pptp[4384]: anon log[ctrlp_disp:pptp_ctrl.c:856]: Received Outgoing Call Reply.
02:27:14 notice pptp[4384]: anon log[ctrlp_disp:pptp_ctrl.c:895]: Outgoing call established (call ID 4, peer's call ID 34560).
02:27:14 info pptp[4382]: Using interface ppp0
02:27:14 notice pptp[4382]: Connect: ppp0 <--> pptp (178.162.193.233)
02:27:18 err pptp[4382]: MPPE required, but kernel has no support.
02:27:18 notice pptp[4382]: Connection terminated.
02:27:22 notice pptp[4384]: anon log[pptp_read_some:pptp_ctrl.c:542]: read returned zero, peer has closed
02:27:22 notice pptp[4384]: anon log[callmgr_main:pptp_callmgr.c:269]: Closing connection (shutdown)
02:27:22 notice pptp[4384]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
02:27:22 notice pptp[4384]: anon log[pptp_read_some:pptp_ctrl.c:542]: read returned zero, peer has closed
02:27:22 notice pptp[4384]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
02:27:22 info pptp[4382]: Terminating on signal 15.
02:27:22 info pptp[4382]: Exit.

解法

修改 source/user/ppp-2.4.2/pppd/ccp.c
static void
ccp_init(unit)
    int unit;
{
    fsm *f = &ccp_fsm[unit];

    f->unit = unit;
    f->protocol = PPP_CCP;
    f->callbacks = &ccp_callbacks;
    fsm_init(f);

    memset(&ccp_wantoptions[unit],  0, sizeof(ccp_options));
    memset(&ccp_gotoptions[unit],   0, sizeof(ccp_options));
    memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
    memset(&ccp_hisoptions[unit],   0, sizeof(ccp_options));

    ccp_wantoptions[0].deflate = 1;
    ccp_wantoptions[0].deflate_size = DEFLATE_MAX_SIZE;
    ccp_wantoptions[0].deflate_correct = 1;
    ccp_wantoptions[0].deflate_draft = 1;
    ccp_allowoptions[0].deflate = 1;
    ccp_allowoptions[0].deflate_size = DEFLATE_MAX_SIZE;
    ccp_allowoptions[0].deflate_correct = 1;
    ccp_allowoptions[0].deflate_draft = 1;

    ccp_wantoptions[0].bsd_compress = 1;
    ccp_wantoptions[0].bsd_bits = BSD_MAX_BITS;
    ccp_allowoptions[0].bsd_compress = 1;
    ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;

    ccp_allowoptions[0].predictor_1 = 1;

    ccp_wantoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
    ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ;
    ccp_wantoptions[0].lzs_hists = 1;
    ccp_allowoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
    ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ;
    ccp_allowoptions[0].lzs_hists = 1;

#ifdef MPPE
    /* by default allow and request MPPC... */
    ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1;

    /* ... and allow but don't request MPPE */
    ccp_allowoptions[0].mppe = 1;
    ccp_allowoptions[0].mppe_40 = 1;
    ccp_allowoptions[0].mppe_56 = 1;
    ccp_allowoptions[0].mppe_128 = 1;
    ccp_allowoptions[0].mppe_stateless = 1;
-    ccp_wantoptions[0].mppe = 0;
-    ccp_wantoptions[0].mppe_40 = 0;
-    ccp_wantoptions[0].mppe_56 = 0;
-    ccp_wantoptions[0].mppe_128 = 0;
-    ccp_wantoptions[0].mppe_stateless = 1;
+    ccp_wantoptions[0].mppe = 1;
+    ccp_wantoptions[0].mppe_40 = 1;
+    ccp_wantoptions[0].mppe_56 = 1;
+    ccp_wantoptions[0].mppe_128 = 1;
+    ccp_wantoptions[0].mppe_stateless = 1;
#endif /* MPPE */
}
結果是 router crash

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()