Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    open VPN with server internet

    Scheduled Pinned Locked Moved OpenVPN
    2 Posts 2 Posters 302 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      isaaclondo09
      last edited by

      I have my Open VPN server, but I need them to connect to the VPN from home to access the internet using the server's or the location where I have the firewall.
      Because when I check the public browsing IP, it shows the home IP, not the location.

      1 Reply Last reply Reply Quote 0
      • J
        Jarester
        last edited by

        It sounds like your VPN is successfully connecting, but it’s only routing traffic for internal access—not tunneling all internet traffic through the VPN server. To make sure all traffic, including public browsing, uses the VPN’s location/IP, you need to enable full tunnel routing.

        Here’s what you should check and configure:

        Server Configuration (server.conf or openvpn.conf)
        Add this line:

        push "redirect-gateway def1 bypass-dhcp"

        This tells the client to route all internet traffic through the VPN.

        Enable IP Forwarding on the VPN Server
        On Linux:

        echo 1 > /proc/sys/net/ipv4/ip_forward

        Or permanently in /etc/sysctl.conf:

        net.ipv4.ip_forward = 1

        Configure NAT on the Server (iptables example)

        iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

        Replace 10.8.0.0/24 with your VPN subnet and eth0 with your actual network interface.

        Client Configuration
        Make sure the client doesn’t override the redirect:

        Remove any pull-filter ignore "redirect-gateway" line

        Allow the server-pushed route

        If you're planning to serve multiple clients or rotate egress IPs, consider integrating proxy rotation on the VPN server side. This can be done with tools like a rotating outbound proxy pool or IPtables-based policy routing, especially useful for web scraping, testing, or anonymization scenarios.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.