Redirect Gateway not working (no internet on client)

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
DerOl
OpenVpn Newbie
Posts: 3
Joined: Mon Dec 23, 2019 9:33 pm

Redirect Gateway not working (no internet on client)

Post by DerOl » Mon Dec 23, 2019 9:47 pm

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.

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Mon Dec 23, 2019 11:28 pm

And ip_forwarding ?

DerOl
OpenVpn Newbie
Posts: 3
Joined: Mon Dec 23, 2019 9:33 pm

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

Post by DerOl » Tue Dec 24, 2019 2:15 am

Oh yes, I set ip_forwarding using sysctl -w net.ipv4.ip_forward=1
But the issue remains...

Lazao
OpenVpn Newbie
Posts: 9
Joined: Fri Dec 27, 2019 3:06 pm

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

Post by Lazao » Fri Dec 27, 2019 3:11 pm

deleted, sorry.
Last edited by Lazao on Fri Dec 27, 2019 4:22 pm, edited 1 time in total.

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Fri Dec 27, 2019 3:27 pm

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

Lazao
OpenVpn Newbie
Posts: 9
Joined: Fri Dec 27, 2019 3:06 pm

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

Post by Lazao » Fri Dec 27, 2019 3:53 pm

my bad, sorry.
I thought I had a similar issue.

Post Reply