爱意满满的作品展示区。
Eyon

自己DIY了一个稳定的、基于Cisco ipsec 的 dd-wrt 路由器cw方案

  •  
  •   Eyon · Mar 21, 2013 · 6992 views
    This topic created in 4832 days ago, the information mentioned may be changed or developed.
    可能有好多人在用基于pptp的,这种一个最大的问题就是不够稳定,而 cisco ipsec 就没有这个问题。

    方法很简单,拷贝下面的代码,直接贴到dd-wrt的 administration-commands 中,然后 save startup,重启路由器即可(请自行替换xxx)。

    #!/bin/sh
    vpn_concentrator="xxx.xxx.xxx.xxx" ##enter ip or hostname of your Ipsec vpn concentrator
    vpn_groupname="xxx" ##enter the group name here
    vpn_grouppasswd="xxxxx" ##enter the group password here
    vpn_username="xxxxxxx" ##enter your username here
    vpn_password="xxxxx" ##enter your password here

    #--do not edit this--
    #Written by Alain R. (alainr /A*T/ gmx. de) 27.Sep.2007
    vpnc-disconnect
    rm -f /tmp/etc/vpnc/vpn.conf
    mkdir /tmp/etc/vpnc
    echo "
    IPSec gateway $vpn_concentrator
    IPSec ID $vpn_groupname
    IPSec secret $vpn_grouppasswd
    Xauth username $vpn_username
    Xauth password $vpn_password
    " >> /tmp/etc/vpnc/vpn.conf
    sleep 5
    vpnc /tmp/etc/vpnc/vpn.conf
    sleep 10
    iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

    目前还没有实现指定网站cw的功能,对iptables 命令完全不懂,还在研究。如果你懂的话不妨告诉我。

    P.S.,我用的dd版本是v24-sp2 mega(15943)
    1 replies    2014-11-12 22:42:47 +08:00
    dgxyzj
        1
    dgxyzj  
       Nov 12, 2014
    谢谢,我的ddwrt 使用pptp客户端一直挂不上vpn,用了你的代码后成功通过ipsec翻出墙外了。想问下是否有让指定设备走vpn,其他设备走普通网络的方法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2800 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:13 · PVG 20:13 · LAX 05:13 · JFK 08:13
    ♥ Do have faith in what you're doing.