<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="用 FON ( DD-WRT ) 設定 site to site VPN ( PPTP )">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2009-08-25 09:07<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
用 FON ( DD-WRT ) 設定 site to site VPN ( PPTP )



FON 就是要刷 DDWRT  才好玩, DD-WRT 多了很多原本  FON 沒有的功能, 其中 site to site VPN 是最大買點 , 當然可以作


 一般的 VPN 撥接 , 譬如說,把家裡的網路撥接進公司的 VPN.


設定畫面 , MPPE 那邊要填 mppe required,no40,no56,stateless (因為對方是 Microsoft 2003 Server 的 PPTP server)





進 DD-WRT 後, 下 ps  指令 , 看到 PPTPD 有啟動





下 route 看 routing





有時 ddwrt 的 pptp vpn 不會自動連上, 或者連了但是 routing 錯誤 , 這時要下
/bin/sh /tmp/pptpd_client/vpn stop
/bin/sh /tmp/pptpd_client/vpn start
讓他重連一次


/tmp/pptpd_client 目錄下的 ip-up


#!/bin/sh
REMOTESUB=$(/usr/sbin/nvram get pptpd_client_srvsub)
REMOTENET=$(/usr/sbin/nvram get pptpd_client_srvsubmsk)
case &quot;$6&quot; in
 kelokepptpd)
  /sbin/route add -net $REMOTESUB netmask $REMOTENET dev $1
  /usr/sbin/iptables --insert OUTPUT --source 0.0.0.0/0.0.0.0 --destination $REMOTESUB/$REMOTENET --jump ACCEPT --out-interface $1
  /usr/sbin/iptables --insert INPUT --source $REMOTESUB/$REMOTENET --destination 0.0.0.0/0.0.0.0 --jump ACCEPT --in-interface $1
  /usr/sbin/iptables --insert FORWARD --source 0.0.0.0/0.0.0.0 --destination $REMOTESUB/$REMOTENET --jump ACCEPT --out-interface $1
  /usr/sbin/iptables --insert FORWARD --source $REMOTESUB/$REMOTENET --destination 0.0.0.0/0.0.0.0 --jump ACCEPT --in-interface $1
  /usr/sbin/iptables --insert FORWARD --protocol tcp --tcp-flags SYN,RST SYN --jump TCPMSS --clamp-mss-to-pmtu
  if [ &quot;$(/usr/sbin/nvram get pptpd_client_nat)&quot; = &quot;1&quot; ]; then
      /usr/sbin/iptables --table nat --append POSTROUTING --out-interface $1 --jump MASQUERADE
  fi
  ;;
 *)
esac
exit 0options.vpn


defaultroute
lock
noauth
nodetach
refuse-eap
lcp-echo-failure 3
lcp-echo-interval 2
persist
usepeerdns
idle 0
ip-up-script /tmp/pptpd_client/ip-up
ip-down-script /tmp/pptpd_client/ip-down
ipparam kelokepptpd
mppe required,no40,no56,stateless
mtu 1450
mru 1450
name rimmon
password xxxxx


LAB 架構





其他路由刷ddwrt也有这个 一样的设置


ddwrt官方设置说明    PPTP Tunneling   （双路由组网）


  


 


</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
