OpenVPN使用多个端口

Openvpn本身不能设置多个端口,使用iptables可以解决这个问题 (假设openvpn本来56788端口):

for port in {56780..56787}
do 
    iptables -t nat -A PREROUTING -p tcp -d <your_external_ip> --dport $port -j REDIRECT --to-port 56788
done

在Ubuntu上配置L2TP,PPTP和OpenVPN服务

Overview MacOS, Windows, iOS都内置支持PPTP,L2TP;OpenVPN需要安装客户端,手机上一般不支持。 先打开内核的IP转发,修改 /etc/sysctl.conf net.ipv4.ip_forward=1 执行下面命令以生效 sudo sysctl -p PPTP 安装pptpd apt-get install pptpd 编辑 /etc/pptpd.conf,下面两行取消注释 localip 192.168.0.1 remoteip 192.168.0.234-238,192.168.0.245 这行注释掉 #logwtmp 从文件 /etc/pptpd.conf 中找到配置选项文件,如下为:/etc/ppp/pptpd-options grep options /etc/pptpd.conf # Specifies the location of the PPP options file. # By default PPP looks in '/etc/ppp/options' option /etc/ppp/pptpd-options # option in the pppd options file, or run bcrelay. 编辑 /etc/ppp/pptpd-options,增加以下内容,最后两项为推给VPN客户端的DNS服务器IP mtu 1492 name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd ms-dns 8. [Read More]
VPN