openvpn 無法存取任何server以外的IP - Linux

Table of Contents

最近試著設定openvpn卻無法得到預期的效果,

測試結果是無法存取主機以外的任何位置(包含使用IP而非domain name),

主機的部分則是正確的連上並可以使用像ssh/ftp之類的服務,

因為希望使用openvpn的時候也能瀏覽網頁,

所以想要麻煩有類似設定經驗的版友幫忙看看設定檔有什麼地方寫錯了,

麻煩大家了(若是需要額外資訊也請告知 我會盡快補上)


#iptables of server (partial)
iptables -A INPUT -p UDP --dport 7752 -j ACCEPT
iptables -A INPUT -i tun+ -j ACCEPT
iptables -A OUTPUT -o tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -o eth0 -j ACCEPT
iptables -A FORWARD -o tun+ -i eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to [static IP]

#server.conf
port 7752
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth ta.key 0
comp-lzo
max-clients 3
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 4

#client.conf
client
dev tun
proto udp
remote [static ip] 7752
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca "C:\\Program Files (x86)\\OpenVPN\\config\\[...].crt"
cert "C:\\Program Files (x86)\\OpenVPN\\config\\[...].crt"
key "C:\\Program Files (x86)\\OpenVPN\\config\\[...].key"
ns-cert-type server
tls-auth [...].key 1
comp-lzo
verb 4

--

All Comments

Joe avatarJoe2014-10-05
net.ipv4.ip_forward 有開嗎?