快捷搜索:   服务器  安全  linux 安全  MYSQL  dedecms

Linux下pptp做nat,持久连接到另一网络

    由于PPTP协议在穿过NAT的时候有些小问题,造成不能多个client在nat下同时拨通一个vpn server,于是就想了这个办法,拨通一条链路,然后做nat

    分别安装pptp和pptpconfig

    rpm -ivh http://pptpclient.sourceforge.net/yum/stable/rhel5/i386/pptp-release-4-2.rhel5.noarch.rpm

    yum --enablerepo=pptp-stable install pptpconfig

    建立拨号
    pptpsetup --create myvpn --server 202.96.69.40 --username myvpnuser --password mypasswd --encrypt --start

    增加到VPN网络的路由
    route add -net 192.168.0.0/24 gw 192.168.0.206

    打开IP转发
    sysctl -w net.ipv4.ip_forward=1

    打开NAT
    iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

    这样,就直接把公司网络和远程私网持久连接在一起了,你可以在防火墙上做策略,只让特定的client通过。

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论