I have created VPN with the topology below. Client will connect to VPN server and wanna access internet.
VPN server uses Ubuntu 12.04 and client uses Windows 7 32bit.
Server.conf
local 192.168.1.5
port 1194
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 "route 192.168.1.0 255.255.255.0"
push "route 192.168.10.0 255.255.255.0"
push "route 192.168.1.0 10.8.0.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option 8.8.8.8"
push "dhcp-option 10.8.0.1"
client-to-client
keepalive 10 120
comp-lzo
max-clients 100
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 3
mute 20
Client.ovpn
client
dev tun
proto udp
remote 36.7x.x.x 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ns-cert-type server
ca ca.crt
cert client1.crt
key client1.key
route-method exe
route-delay 2
comp-lzo
verb 3
Client can ping to LAN IP and tun0 VPN server. VPN server can ping tun0 client, but client cannot access internet. I have already setup iptables and port forwarding (1194) on my modem Speedy 1Mbps.
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A INPUT -i eth1 -p udp -m --dport 1194 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth1 -j SNAT --to my_public_ip
So, why my client still cannot access internet?