Navigation

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

    WireGuard overriding static routes

    WireGuard
    2
    4
    177
    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
      Aerowinder last edited by Aerowinder

      Greetings,

      This is in regards to this Redmine issue: https://redmine.pfsense.org/issues/11326.

      I have multiple sites, each behind a router. All of the routers are connected in a fiber loop, using OSPF to handle all of the site-site routing. On one of these sites, I have an internet connection. At that location, I have a pfSense system that connects my fiber loop to the internet.

      The pfSense setup is pretty simple, just WAN and LAN interfaces with very few rules, as I let my site routers handle all the site-site traffic. pfSense is only concerned with traffic going to and coming from the Internet.

      I ran into a problem when I was setting up the network, and I determined that while my site routers could find pfSense (via default gateways), pfSense did not know how to send packets back to these routers. After some reading, I learned that pfSense is only aware of the networks that it is directly connected to. Makes sense. So, the way I tell pfSense how to send packets to these site routers is via static routes. If a packet comes from router A, B, or C (site routers), send the return packet to the router that is connecting pfSense to the fiber loop, and then that router will know what to do. It's my understanding that this is the purpose of static routes, and I'm not sure how I could set up my network any other way.

      Now, in testing 2.5, I want to use WireGuard to make internal network resources available remotely. So in my WireGuard config, I set Allowed IPs to my local networks (the same networks as the pfSense static routes), as these networks are where my devices reside.

      When I do this, I lose connectivity to the firewall. WireGuard is hijacking my static routes, breaking connectivity from pfSense to my internal network. My static routes are now being redirected to the wg0 interface, instead of going out of my custom gateway as they normally would.

      This is happening with no peers connected to the tunnel. If this is normal WireGuard behavior, then is it even possible to use it on a network setup that requires static routes?

      On a separate pfSense network that does not require static routes, I am able to set WireGuard Allowed IPs to internal networks with no issue, though these networks are directly connected to pfSense.

      jimp 1 Reply Last reply Reply Quote 0
      • jimp
        jimp Rebel Alliance Developer Netgate @Aerowinder last edited by

        @aerowinder said in WireGuard overriding static routes:

        Now, in testing 2.5, I want to use WireGuard to make internal network resources available remotely. So in my WireGuard config, I set Allowed IPs to my local networks (the same networks as the pfSense static routes), as these networks are where my devices reside.

        You have the purpose of that field backwards.

        The networks in Allowed IPs are the networks on the peer side that the firewall can reach through that peer. It is not local networks.

        WireGuard doesn't have a way to tell peers what they should send to this end -- that's up to the peers themselves.

        So you'd set Allowed IPs in the remote peer/client configuration to use your local networks, not on the firewall.

        For each peer on the firewall, the Allowed IPs field should only contain the tunnel address of that specific peer/client.

        1 Reply Last reply Reply Quote 1
        • A
          Aerowinder last edited by

          Wow, I'm a dumb-dumb. Thanks, I really appreciate the help!

          1 Reply Last reply Reply Quote 0
          • jimp
            jimp Rebel Alliance Developer Netgate last edited by

            WireGuard is a learning experience for all of us!

            We're still refining the GUI labels and documentation to hopefully make all this more clear.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post

            Products

            • Platform Overview
            • TNSR
            • pfSense Plus
            • Appliances

            Services

            • Training
            • Professional Services

            Support

            • Subscription Plans
            • Contact Support
            • Product Lifecycle
            • Documentation

            News

            • Media Coverage
            • Press
            • Events

            Resources

            • Blog
            • FAQ
            • Find a Partner
            • Resource Library
            • Security Information

            Company

            • About Us
            • Careers
            • Partners
            • Contact Us
            • Legal
            Our Mission

            We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

            Subscribe to our Newsletter

            Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

            © 2021 Rubicon Communications, LLC | Privacy Policy