I am setting up OpenVPN on my server and can successfully connect from my Mac. If I use whatismyip.com it correct reports the IP address on my server. However, I am running a database on this server and want to be able to connect to it when connected to the VPN (just like any other client on the server's local network). Right now I am getting "connection refused" when testing the connection with telnet.
Here are parts of my iptables file:
*nat :PREROUTING ACCEPT [72:6526] :POSTROUTING ACCEPT [27:1428] :OUTPUT ACCEPT [27:1428] -A POSTROUTING -s 10.8.0.0/255.255.255.0 -o eth0 -j MASQUERADE -A POSTROUTING -s 10.8.0.0/255.255.255.0 -o tun+ -j MASQUERADE COMMIT *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [200142:256360469] -A INPUT -i lo -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type any -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # Allow all stuff via the VPN -A INPUT -s 10.8.0.0/24 -j ACCEPT -A FORWARD -s 10.8.0.0/24 -j ACCEPT # Accept all packets from local IP addresses -A INPUT -s 217.70.0/24 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT
I don't really understanding the POSTROUTING/MASQUERADE bits, but I suppose I am missing some rule giving the client unlimited access to services on the server?
Update - here is my client openvpn config:
client dev tun proto udp remote sture 1194 resolv-retry infinite nobind persist-key persist-tun ns-cert-type server comp-lzo verb 3