Page 1 of 1

Redirect Gateway not working (no internet on client)

Posted: Mon Dec 23, 2019 9:47 pm
by DerOl
Hello, I'm trying to use my OpenVpn Server to proxy my internet request. But when connecting I do not get internet access at all...

My configurations:
Server Config

port 1194
proto udp
dev tun
ca ./easy-rsa2/keys/ca.crt
cert ./easy-rsa2/keys/server.crt
key ./easy-rsa2/keys/server.key # This file should be kept secret
dh ./easy-rsa2/keys/dh4096.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.178.0 255.255.255.0"
client-config-dir ccd
route 10.9.0.0 255.255.255.0
push "dhcp-option DNS 192.168.178.2"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 4.4.4.4"
keepalive 10 120
tls-auth ./easy-rsa2/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log-append /var/log/openvpn.log
verb 3
explicit-exit-notify 1


Client Config

client
dev tun
proto udp
remote anonymized 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
verb 3
redirect-gateway def1 bypass-dhcp


I did use
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o wlan0 -j MASQUERADE
to enable Nat on the server but it is still not working.

Re: Redirect Gateway not working (no internet on client)

Posted: Mon Dec 23, 2019 11:28 pm
by TinCanTech
And ip_forwarding ?

Re: Redirect Gateway not working (no internet on client)

Posted: Tue Dec 24, 2019 2:15 am
by DerOl
Oh yes, I set ip_forwarding using sysctl -w net.ipv4.ip_forward=1
But the issue remains...

Re: Redirect Gateway not working (no internet on client)

Posted: Fri Dec 27, 2019 3:11 pm
by Lazao
deleted, sorry.

Re: Redirect Gateway not working (no internet on client)

Posted: Fri Dec 27, 2019 3:27 pm
by TinCanTech
Lazao wrote:
Fri Dec 27, 2019 3:11 pm
I'm facing the exact same thing with a similar configuration.
No you are not.

Please do not hijack other peoples threads. Instead, create your own thread.
Lazao wrote:
Fri Dec 27, 2019 3:11 pm
I have no clue why I can't forward all traffic
Because your iptables rule is completely wrong.

Please see
https://community.openvpn.net/openvpn/wiki/HOWTO

For further help please see:
viewtopic.php?f=30&t=22603

Re: Redirect Gateway not working (no internet on client)

Posted: Fri Dec 27, 2019 3:53 pm
by Lazao
my bad, sorry.
I thought I had a similar issue.