OpenVPN tun 如何連線到內部私有網段

啟用forward功能
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

讓vpn的虛擬網卡在server開放input/​output
iptables -A INPUT -i tun+ -j ACCEPT
iptables -A OUTPUT -o tun+ -j ACCEPT

開放server端的vpn與實體網路進出FORW​ARD eth->vpn
iptables -A FORWARD -i eth* -o tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -o eth* -j ACCEPT

server.conf
push “192.168.128.0 255.255.255.0″

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s