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

How do you direct all traffic from a remote Wireguard peer through my pfsense SG5100

WireGuard
wireguard allowed ip
4
14
3.3k
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.
  • M
    munson
    last edited by Jun 22, 2022, 4:49 PM

    How do you direct all traffic from a remote Wireguard peer through my pFsense SG5100. With OpenVPN I set my remote clients to direct ALL traffic through my pFsense router, including those to external sites. Now that I have set up Wireguard, all traffic to the pFsense router goes via Wireguard. However traffic to external sites does not. I have added 0.0.0.0 as an allowed IP, still no luck. Any suggestions?

    J 1 Reply Last reply Jun 22, 2022, 4:54 PM Reply Quote 0
    • J
      Jarhead @munson
      last edited by Jun 22, 2022, 4:54 PM

      @munson You mean 0.0.0.0/0 as THE allowed IP, right? Should be the only one.

      M 2 Replies Last reply Jun 22, 2022, 6:04 PM Reply Quote 0
      • M
        munson @Jarhead
        last edited by Jun 22, 2022, 6:04 PM

        @jarhead Thanks for your reply. On th remote device I have set the allowed IPs to 0.0.0.0/0. while on the SG5100 the allowed IPs are 172.x.y.z (Wireguard interface),192.168.y.z and 192.168.y.z . Should I change the SG55100 allowed IPs to 0.0.0.0 instead?

        Thanks

        G 1 Reply Last reply Jun 22, 2022, 6:44 PM Reply Quote 0
        • G
          gabacho4 Rebel Alliance @munson
          last edited by Jun 22, 2022, 6:44 PM

          @munson you need to make sure you have an outbound NAT rule for the WireGuard subnet to exit via WAN interface.

          M 1 Reply Last reply Jun 22, 2022, 7:07 PM Reply Quote 0
          • M
            munson @Jarhead
            last edited by Jun 22, 2022, 6:59 PM

            @jarhead Yes for clarification the remote device allowed IP is 0.0.0.0/0, while on the SG5100 I have listed the three networks. I must be doing something wrong.

            1 Reply Last reply Reply Quote 0
            • G
              gabacho4 Rebel Alliance
              last edited by gabacho4 Jun 22, 2022, 7:05 PM Jun 22, 2022, 7:04 PM

              the allowed IPs is not the same thing as outbound NAT. If the remote device is an router, then 0.0.0.0/0 will enable you to send traffic for any IP address over the wireguard link. Assume you are using policy based rules to do that. On the 5100 end, you need to have allowed IPs set to the remote subnets. Also, you need to make sure you have the IP address of the remote wireguard interface as well. So it would be for example like 10.10.10.2/32. BUT on the the 5100, if the goal is to allow remote devices to access the internet, you need to have an outbound NAT rule allowing the remote subnets to exit via WAN.

              so if my remote subs were 192.168.10.0/24, 192.168.20.0/24, and 192.168.30.0/24, I would need an outbound NAT rule for each one of those subnets as the source with the WAN interface selected as the outbound one

              1 Reply Last reply Reply Quote 0
              • G
                gabacho4 Rebel Alliance
                last edited by gabacho4 Jun 22, 2022, 7:10 PM Jun 22, 2022, 7:07 PM

                Also, you need to make sure you set static routes on the 5100 so that the router knows where to send traffic to your remote subnets. You'd make a route destined for each subnet, with the wireguard interface as the gateway. If you have not already done so, you should read the Pfsense documentation on Wireguard. It is very clear and they even provide example configs.

                1 Reply Last reply Reply Quote 0
                • M
                  munson @gabacho4
                  last edited by Jun 22, 2022, 7:07 PM

                  @gabacho4

                  Thanks . Can you please provide an example, and what page in pFsense is this added.

                  G 1 Reply Last reply Jun 22, 2022, 7:09 PM Reply Quote 0
                  • G
                    gabacho4 Rebel Alliance @munson
                    last edited by Jun 22, 2022, 7:09 PM

                    @munson NAT is on the Firewall tab -> NAT -> Outbound. Then set your NAT to hybrid or manual (which I prefer personally) and add the rules I described.

                    For static routes, you need to go to System -> Routing -> Static Routes and then create the routes as I described them.

                    1 Reply Last reply Reply Quote 0
                    • M
                      munson
                      last edited by Aug 14, 2022, 6:33 PM

                      Thanks for your patience and expert advice. I just got back to this project. I still can not send all traffic from a peer through my SG51000

                      Here are some screenshots of my rules and configurations, any suggestions would be appreciated:
                      login-to-view

                      login-to-view

                      login-to-view

                      login-to-view

                      login-to-view

                      Here is the iphone configuration login-to-view
                      login-to-view
                      Any assistance would be appreciated.

                      G 3 Replies Last reply Aug 14, 2022, 6:38 PM Reply Quote 0
                      • G
                        gabacho4 Rebel Alliance @munson
                        last edited by Aug 14, 2022, 6:38 PM

                        @munson Your NAT rule is wrong. It's not the wireguard interface you are sending the traffic out to the world but WAN. Your network address (not sure why you blacked that out since they are private IPs and not public ones) should be the subnet that your client phone uses. So if the client IP is 192.168.100.2/32 then the network subject on your NAT outbound should be 192.168.100.0/24. I guess you could make it for just one IP but that seems unnecessary.

                        1 Reply Last reply Reply Quote 0
                        • G
                          gabacho4 Rebel Alliance @munson
                          last edited by gabacho4 Aug 14, 2022, 6:43 PM Aug 14, 2022, 6:40 PM

                          @munson Also, on the peers setting on the 5100, remove the 0.0.0.0/0 and just put the ip address of your phone. Looks like you're using a 172.16.x.x/24 structure so it should be 172.16.x.x/32 (whatever the specific IP for the phone is).

                          EDIT: sorry that wasn't very clear. On the 5100, the allowed IP address(es) is just the client IP. remove the 0.0.0.0/0.

                          1 Reply Last reply Reply Quote 0
                          • G
                            gabacho4 Rebel Alliance @munson
                            last edited by Aug 16, 2022, 4:16 AM

                            @munson any update?

                            R 1 Reply Last reply Aug 3, 2024, 2:28 AM Reply Quote 0
                            • R
                              Ryu945 @gabacho4
                              last edited by Aug 3, 2024, 2:28 AM

                              @gabacho4 Did you ever figure it out?

                              1 Reply Last reply Reply Quote 0
                              • K kevdog referenced this topic on Mar 19, 2025, 3:23 AM
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.