Letting client access greater internet over vpn

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
User avatar
polarbub
OpenVpn Newbie
Posts: 2
Joined: Tue Dec 07, 2021 12:19 am

Letting client access greater internet over vpn

Post by polarbub » Tue Dec 07, 2021 2:08 am

I want my client to be able to access the internet outside of the vpn subnet.

I have this server config file https://pastebin.com/9RVWrCKE

And this client one https://pastebin.com/38NrZxBK The certificates and real IP address of the server have been removed.

I can ping at its local network IP address

Code: Select all

ping 10.1.1.4
via

Code: Select all

push "route 10.1.1.0 255.255.255.0"
and I believe that this also allows me to access anything else on that network. I don't have anything else on that network to test with though. I would like to be able to something similar for the whole internet but adding something like

Code: Select all

push "route 8.8.8.0 255.255.255.0"
to let me access 8.8.8.8 but it doesn't let me get though.

I have turned on IP forwarding though

Code: Select all

net.ipv4.ip_forward=1
in

Code: Select all

/etc/sysctl.conf
and reloaded it with

Code: Select all

sysctl -p
Looking at viewtopic.php?f=6&t=10923 I am at 'Is NAT enabled on the VPN subnet?' but there is no reference on how to check and enable it so I am stuck there.

Any help would be greatly appreciated, Thanks :)

User avatar
TinCanTech
Forum Team
Posts: 10191
Joined: Fri Jun 03, 2016 1:17 pm

Re: Letting client access greater internet over vpn

Post by TinCanTech » Tue Dec 07, 2021 3:09 am

polarbub wrote:
Tue Dec 07, 2021 2:08 am
I would like to be able to something similar for the whole internet but adding something like

Code: Select all

push "route 8.8.8.0 255.255.255.0"
to let me access 8.8.8.8 but it doesn't let me get though.
See --redirect-gateway in the manual.

There is also a section in the howto.

User avatar
polarbub
OpenVpn Newbie
Posts: 2
Joined: Tue Dec 07, 2021 12:19 am

Re: Letting client access greater internet over vpn

Post by polarbub » Sat Dec 18, 2021 2:31 am

I already have

Code: Select all

push "redirect-gateway def1 bypass-dhcp"
in my server config. Do I need to use something different? Also can I have a link to the specific howto page please?

Post Reply