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

    [Solved] Unable to access LAN network using OpenVPN

    Scheduled Pinned Locked Moved OpenVPN
    6 Posts 4 Posters 1.8k 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.
    • A
      azkerm
      last edited by

      Hi There,

      I've just set-up OpenVPN and I can connect to it but not been able to access the LAN network.

      I've given same IP to pfsense as LAN. as seen below;
      pfsense IP: 10.100.1.20/24

      LAN network
      –--------------
      network & mask bit: 10.100.1.0/24
      LAN network gateway: 10.100.1.254

      ovpn-config.png
      ovpn-config.png_thumb
      lan-rules.png
      lan-rules.png_thumb
      ovpn-rules.png
      ovpn-rules.png_thumb

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        pfsense IP: 10.100.1.20/24
        LAN network gateway: 10.100.1.254

        so your lan interface on pfsense is 10.100.1.20, what is the gateway???  lan interfaces do not have gateways set.. If the gateway for your lan devices are not pfsense then no how would vpn clients talk to you lan because lan clients would be going to their gateway to talk to the remove client IP vs going back to pfsense to go down the vpn tunnel to get to the vpn client.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • A
          azkerm
          last edited by

          Hi,

          As you said, there is no gateway on pfsense lan. And I've used a direct cable for wan.

          Do I have to add a route or just if I add a gateway to lan, will work?

          1 Reply Last reply Reply Quote 0
          • C
            chris4916
            last edited by

            Look at client setting (in openvpn tab) and set the "IPv4 Remote Network/s" with remote network (here you LAN) you want to access. (you can do it in the overrides section too)
            Then let us know ;-)

            Jah Olela Wembo: Les mots se muent en maux quand ils indisposent, agressent ou blessent.

            1 Reply Last reply Reply Quote 0
            • V
              viragomann
              last edited by

              Hi,

              since your LAN hosts use another default gateway than the pfSense LAN IP they send response packets to request from OpenVPn not to pfSense, but rather to their known gateway. However, there is the destination IP unknown and the packets will be dropped.

              You can resolve this by three ways:

              • If the other gateway is able to route between the hosts you want to access and pfSense add a static route to this gateway to route traffic to your tunnel network over pfSense.

              • If not add the route to your hosts.

              • If these hosts are plenty and you are lazy add an outbound NAT rule to pfSense to translate the OpenVPN client IP to LAN-IP at LAN interface. Consider that this way any client packets arrive with source = pfSense LAN at your hosts.

              1 Reply Last reply Reply Quote 0
              • A
                azkerm
                last edited by

                Hi There,

                I've resolved this by changing the gateway from existing to pfsense IP which then will clients to communicate pfsense as the gateway.

                Now, I'm able to access the said network.

                Thanks!

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