Hello,
I've tried for two weeks now to use OpenVPN as a gateway to redirect all internet traffic through a gateway.
I've used this config :
port 443
proto tcp
dev tun0
ca keys/ca.crt
cert keys/server.crt
key keys/server.key
dh keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 212.27.40.241"
push "dhcp-option DNS 212.27.40.240"
client-to-client
keepalive 10 120
cipher AES-128-CBC # AES
comp-lzo
max-clients 20
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3
It's a Debian Squeeze Server
To make the gateway redirection more efficient, I've also used these two commands :
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
sysctl net.netfilter.nf_conntrack_acct=1
and setted
/proc/sys/net/ipv4/ip_forward
to "1"
And on the client side, the config file looks like this (Windows 7) :
client
dev tap
dev-node MyTap
proto tcp
;remote my.internet.ip.address 443
remote 192.168.0.200 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
tls-auth ta.key 1
cipher AES-128-CBC
comp-lzo
verb 3
--tap-sleep 4
The NAT translation beetween WAN and LAN is done, works fine.
With all of this, I still have two problems :
1) I can't get a correct IP adress (I only get an APIPA adress) since two days on the client side, and I can't find out why. The firewall of my computer is disabled, and the GUI tells me that he gets an IP. A quick "cmd /k ipconfig /all" says the exact opposite.
2) Even with a software to redirect UDP broadcast, I can't use network client such as steam or else.
I really want to understand, so if you want more info or ask any question, I'll be happy to come up with answers !
By the way, I'm french so please appologize for my poor english.