赞
踩
~ # ~ # pppd -v pppd: unrecognized option '-v' pppd version 2.4.7 Usage: pppd [ options ], where options are: <device> Communicate over the named device <speed> Set the baud rate to <speed> <loc>:<rem> Set the local and/or remote interface IP addresses. Either one may be omitted. asyncmap <n> Set the desired async map to hex <n> auth Require authentication from peer connect <p> Invoke shell command <p> to set up the serial line crtscts Use hardware RTS/CTS flow control defaultroute Add default route through interface file <f> Take options from file <f> modem Use modem control lines mru <n> Set MRU value to <n> for negotiation See pppd(8) for more options. ~ # ~ # xl2tpd -v xl2tpd version: xl2tpd-1.3.12 ~ # ~ # uname -an Linux (tozedap-p59) 3.3.8 #1 Thu Aug 16 08:56:34 CST 2018 mips GNU/Linux ~ #
1)xl2tpd的调试信息如下:
~ # xl2tpd -c /tmp/xl2tpd/xl2tpd.conf -D xl2tpd[3173]: setsockopt recvref[30]: Protocol not available xl2tpd[3173]: Using l2tp kernel support. xl2tpd[3173]: xl2tpd version xl2tpd-1.3.7 started on (tozedap-p59) PID:3173 xl2tpd[3173]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc. xl2tpd[3173]: Forked by Scott Balmos and David Stipp, (C) 2001 xl2tpd[3173]: Inherited by Jeff McAdams, (C) 2002 xl2tpd[3173]: Forked again by Xelerance (www.xelerance.com) (C) 2006-2016 xl2tpd[3173]: Listening on IP address 0.0.0.0, port 1701 xl2tpd[3173]: Connecting to host 113.98.195.201, port 1701 xl2tpd[3173]: Connection established to 113.98.195.201, 1701. Local: 41329, Remote: 12670 (ref=0/0). xl2tpd[3173]: Calling on tunnel 41329 xl2tpd[3173]: Call established with 113.98.195.201, Local: 64329, Remote: 40433, Serial: 1 (ref=0/0) xl2tpd[3173]: start_pppd: I'm running: xl2tpd[3173]: "/usr/sbin/pppd" xl2tpd[3173]: "plugin" xl2tpd[3173]: "pppol2tp.so" xl2tpd[3173]: "pppol2tp" xl2tpd[3173]: "7" xl2tpd[3173]: "passive" xl2tpd[3173]: "nodetach" xl2tpd[3173]: ":" xl2tpd[3173]: "file" xl2tpd[3173]: "/tmp/xl2tpd/options.l2tpd.lac" xl2tpd[3173]: result_code_avp: avp is incorrect size. 8 < 10 xl2tpd[3173]: handle_avps: Bad exit status handling attribute 1 (Result Code) on mandatory packet. xl2tpd[3173]: call_close: Call 64329 to 113.98.195.201 disconnected ^Cxl2tpd[3173]: death_handler: Fatal signal 2 received xl2tpd[3173]: Terminating pppd: sending TERM signal to pid 3594 xl2tpd[3173]: Connection 12670 closed to 113.98.195.201, port 1701 (Server closing) ~ #
2)连接命令:
~ # echo "c lroute" > /var/run/xl2tpd/l2tp-control
3)配置文件:
~ # cat /tmp/xl2tpd/options.l2tpd.lac ipcp-accept-local ipcp-accept-remote refuse-eap noauth mtu 1410 mru 1410 debug name test password 11223344 lcp-echo-interval 0 lcp-echo-failure 0 ~ # ~ # ~ # ~ # cat /tmp/xl2tpd/xl2tpd.conf [lac lroute] lns = 113.98.195.201 pppoptfile = /tmp/xl2tpd/options.l2tpd.lac redial = yes redial timeout = 15 ~ #
sean@sean:~/work/$ vi apps/ppp-2.4.7/pppd/ipcp.c /* * ip_check_options - check that any IP-related options are OK, * and assign appropriate defaults. */ static void ip_check_options() { struct hostent *hp; u_int32_t local; ipcp_options *wo = &ipcp_wantoptions[0]; /* * Default our local IP address based on our hostname. * If local IP address already given, don't bother. */ if (wo->ouraddr == 0 && !disable_defaultip) { /* * Look up our hostname (possibly with domain name appended) * and take the first IP address as our local IP address. * If there isn't an IP address for our hostname, too bad. */ wo->accept_local = 1; /* don't insist on this default value */ if ((hp = gethostbyname(hostname)) != NULL) { local = *(u_int32_t *)hp->h_addr; if (local != 0 && !bad_ip_adrs(local)) wo->ouraddr = local; } } ask_for_local = wo->ouraddr != 0 || !disable_defaultip; }
~ # cat /tmp/xl2tpd/options.l2tpd.lac ipcp-accept-local ipcp-accept-remote : refuse-eap noccp noauth mtu 1400 mru 1400 name tozed password 33445588 lcp-echo-interval 20 lcp-echo-failure 3 ifname l2tp usepeerdns noipdefault ~ # ~ # cat /tmp/xl2tpd/xl2tpd.conf [lac lroute] lns = 113.98.195.201 pppoptfile = /tmp/xl2tpd/options.l2tpd.lac redial = yes redial timeout = 15 ~ #
调试信息如下:
~ # xl2tpd -c /tmp/xl2tpd/xl2tpd.conf -D xl2tpd[31309]: Not looking for kernel SAref support. xl2tpd[31309]: Using l2tp kernel support. xl2tpd[31309]: xl2tpd version xl2tpd-1.3.12 started on (TOZED-P53) PID:31309 xl2tpd[31309]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc. xl2tpd[31309]: Forked by Scott Balmos and David Stipp, (C) 2001 xl2tpd[31309]: Inherited by Jeff McAdams, (C) 2002 xl2tpd[31309]: Forked again by Xelerance (www.xelerance.com) (C) 2006-2016 xl2tpd[31309]: Listening on IP address 0.0.0.0, port 1701 xl2tpd[31309]: Connecting to host 113.98.195.201, port 1701 xl2tpd[31309]: Connection established to 113.98.195.201, 1701. Local: 52610, Remote: 625 (ref=0/0). xl2tpd[31309]: Calling on tunnel 52610 xl2tpd[31309]: Call established with 113.98.195.201, Local: 39099, Remote: 6548, Serial: 1 (ref=0/0) xl2tpd[31309]: start_pppd: I'm running: xl2tpd[31309]: "/usr/sbin/pppd" xl2tpd[31309]: "plugin" xl2tpd[31309]: "pppol2tp.so" xl2tpd[31309]: "pppol2tp" xl2tpd[31309]: "7" xl2tpd[31309]: "passive" xl2tpd[31309]: "nodetach" xl2tpd[31309]: ":" xl2tpd[31309]: "file" xl2tpd[31309]: "/tmp/xl2tpd/options.l2tpd.lac" ~ # ~ # echo "c lroute" > /tmp/xl2tpd/l2tp-control ~ # ifconfig l2tp l2tp Link encap:Point-to-Point Protocol inet addr:172.1.1.100 P-t-P:172.1.1.199 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1400 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:46 (46.0 B) TX bytes:52 (52.0 B) ~ #
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。