BigWave My goal is to use OpenVPN to access internet through my home internet router and access my network (files and resources). I can connect to the VPN and see my mapped folders in the network, but am unable to access the internet internally or externally from my network. My Server Configuration File is: push "route 192.168.1.0 255.255.255.0" push "dhcp-option DNS 8.8.8.8" push "dhcp-option WINS 192.168.66.1" server 192.168.66.0 255.255.255.0 ifconfig-pool-persist ipp.txt tls-auth /tmp/openvpn/ta.key 0 float verb 5 dev tun proto tcp keepalive 10 120 dh /tmp/openvpn/dh.pem ca /tmp/openvpn/ca.crt cert /tmp/openvpn/cert.pem key /tmp/openvpn/key.pem management localhost 5001 My router firewall rules: iptables -I INPUT 1 -p tcp --dport 1194 -j ACCEPT iptables -I FORWARD 1 --source 192.168.66.0/24 -j ACCEPT iptables -I FORWARD -i br0 -o tun0 -j ACCEPT iptables -I FORWARD -i tun0 -o br0 -j ACCEPT iptables -t nat -A POSTROUTING -s 192.168.66.0/24 -j MASQUERADE My Client config file is: client dev tun0 proto tcp remote xxx.xxx.xxx 1194 redirect-gateway resolv-retry infinite nobind persist-key persist-tun remote-cert-tls server tls-auth ta.key 1 float ca ca.crt cert cyLaptop.crt key cyLaptop.key auth SHA1 cipher AES-256-CBC sndbuf 0 rcvbuf 0 verb 4
TinCanTech BigWave wroteunable to access the internetSee HOWTO: Routing all client traffic (including web-traffic) through the VPN Also,BigWave wrotepush "route 192.168.1.0 255.255.255.0" NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet. :arrow: Never use 192.168.0.0/24 or 192.168.1.0/24 (or other common subnets) for your OpenVPN Server LAN :!: You are advised to change your server LAN to a more unique RFC1918 compliant subnet. For example: 192.168.143.0/24
BigWave Thank you TinCanTech. I When you say server LAN, do you mean the router local IP address, right now my local router IP address is 192.168.1.1. Should I change this to 192.168.143.0 and update the push route instruction to this address.
BigWave I'm following up --- changed my router IP to 192.168.143.1 and updated the server config to the following: push "route 192.168.143.1 255.255.255.0" push "dhcp-option DNS 8.8.8.8" push "dhcp-option WINS 192.168.66.1" server 192.168.66.0 255.255.255.0 ifconfig-pool-persist ipp.txt tls-auth /tmp/openvpn/ta.key 0 float verb 5 dev tun proto tcp keepalive 10 120 dh /tmp/openvpn/dh.pem ca /tmp/openvpn/ca.crt cert /tmp/openvpn/cert.pem key /tmp/openvpn/key.pem management localhost 5001 I can connect and see my resources on the LAN but am still unable to access the internet. I'm running OpenVPN on my dd wrt router in Server mode and have 1) redirect default gateway enabled and 2) client to client enabled. Additionally, I'm currently testing this while at home on the LAN.
TinCanTech BigWave wroteiptables -t nat -A POSTROUTING -s 192.168.66.0/24 -j MASQUERADEThat is usually:iptables -t nat -A POSTROUTING -s 192.168.66.0/24 -o eth0 -j MASQUERADEwhere eth0 is the name of your server WAN side interface.