D
Deleted member 9563
Guest
I just set up an OpenVPN server on a VPS and the only thing I can't get to work is DNS. I'll post my
It would seem that OpenVPN is intended for DHCP only, but I could be wrong. I'm hoping that I either got something wrong, or that there is a creative solution using iptables.
This script runs at boot time:
Edit: perhaps I should add that I'm running Debian 7 32bit on the server and FreeBSD 10.1-RELEASE on the client.
iptables script and server.conf in the hopes that someone can show me a solution. This is a single client setup and I'm not using TLS (so the update-resolv-conf script won't work). I am also using static IP everywhere so DHCP solutions are not immediately available.It would seem that OpenVPN is intended for DHCP only, but I could be wrong. I'm hoping that I either got something wrong, or that there is a creative solution using iptables.
Code:
#server.conf
dev tun
proto tcp-server
secret static.key
port 443
comp-lzo
ifconfig 10.x.x.1 10.x.x.2
#neither of below works:
#push "redirect-gateway def1"
#push "redirect-gateway local def1"
This script runs at boot time:
Code:
#!/bin/sh
iptables -A INPUT -i venet0 -m state --state NEW -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -o venet0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i venet0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.x.x/255.255.255.0 -j SNAT
iptables -A OUTPUT -o tun+ -j ACCEPT
Edit: perhaps I should add that I'm running Debian 7 32bit on the server and FreeBSD 10.1-RELEASE on the client.