restrict vpn traffic only, currently all internet traffic routed

Need help configuring your VPN? Just post here and you'll get that help.

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
kashyap009
OpenVPN User
Posts: 26
Joined: Tue Jul 13, 2021 10:23 am

restrict vpn traffic only, currently all internet traffic routed

Post by kashyap009 » Tue Jul 20, 2021 7:03 am

i will like to only allow vpn traffic to be routed via the openvpn connection and NOT route all internet traffic. What steps do i need to take to achieve this?

Thanks!

spacexdragon
OpenVpn Newbie
Posts: 4
Joined: Wed Aug 30, 2017 9:27 am

Re: restrict vpn traffic only, currently all internet traffic routed

Post by spacexdragon » Fri Jul 23, 2021 7:45 am

check this line in you server.conf

push "redirect-gateway def1 bypass-dhcp"

kashyap009
OpenVPN User
Posts: 26
Joined: Tue Jul 13, 2021 10:23 am

Re: restrict vpn traffic only, currently all internet traffic routed

Post by kashyap009 » Fri Jul 23, 2021 12:42 pm

hi thanks for the reply...

this line push "redirect-gateway def1 bypass-dhcp" is added in server.conf file

spacexdragon
OpenVpn Newbie
Posts: 4
Joined: Wed Aug 30, 2017 9:27 am

Re: restrict vpn traffic only, currently all internet traffic routed

Post by spacexdragon » Fri Jul 23, 2021 5:49 pm

kashyap009 wrote:
Fri Jul 23, 2021 12:42 pm
hi thanks for the reply...

this line push "redirect-gateway def1 bypass-dhcp" is added in server.conf file
if you want all traffic,need add this : push "redirect-gateway def1 bypass-dhcp"
if you want part of traffic,comment this line like this : ; push "redirect-gateway def1 bypass-dhcp"
and add push "route xxx xxxx"

kashyap009
OpenVPN User
Posts: 26
Joined: Tue Jul 13, 2021 10:23 am

Re: restrict vpn traffic only, currently all internet traffic routed

Post by kashyap009 » Sat Jul 24, 2021 5:40 am

push route xxx.xxx will be my local internet gateway 192.168.xx.xxx?

kashyap009
OpenVPN User
Posts: 26
Joined: Tue Jul 13, 2021 10:23 am

Re: restrict vpn traffic only, currently all internet traffic routed

Post by kashyap009 » Sun Jul 25, 2021 11:27 am

could you pls elloborate more on push route.....

thanks in advance

Post Reply