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

How do I VPN only 1 host device?

Scheduled Pinned Locked Moved OpenVPN
29 Posts 4 Posters 4.2k 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.
  • K
    kejianshi
    last edited by Oct 30, 2014, 11:19 PM

    Usually those vpn guides have a firewall rull that passes the entire lan (usually a /24)
    If you change that one rule to the ip address of the client you want to be VPNed (a /32) you should be golden.

    So basically…  what Derelict said....

    1 Reply Last reply Reply Quote 0
    • S
      seitys
      last edited by Oct 31, 2014, 1:57 AM

      It doesn't work for me. Here are my firewall rules in order from top to bottom.

      1. Protocol: IPv4, Source: Desktop (alias for 192.168.1.2, Destination: blank, Gateway: VPN
      2. Protocol: IPv4, Source: LAN net, Destination: blank, Gateway: DHCP WAN
      3. Protocol: IPv4, Source: blank, Destination: blank, Gateway: default
      4. Protocol: IPv6, Source: blank, Destination: blank, Gateway: default ipv6

      Rules 3 and 4 are there by default but I left them as is because the firewall reads the rules from top to bottom so rules 1 and 2 should take care of traffic for the entire LAN net.

      Yet, when I turn on VPN, every since device on my network passes through the vpn, not just my desktop.

      1 Reply Last reply Reply Quote 0
      • K
        kejianshi
        last edited by Oct 31, 2014, 2:02 AM

        Using manual outbound NAT?

        1 Reply Last reply Reply Quote 0
        • S
          seitys
          last edited by Oct 31, 2014, 2:29 AM Oct 31, 2014, 2:18 AM

          Yes manual outbound NAT although I haven't added any additional outbound NAT rules.

          Currently I have 4 outbound NAT rules.

          1. Interface: WAN, Source:L 127.0.0.0/8, Destination: blank, Destination Port: 500, NAT Address: (my ISP WAN address here), NAT Port: Blank, Static Port: Yes
          2. Interface: WAN, Source: 127.0.0.0/8, Destination: blank, Destination Port: blank, NAT Address: (my ISP WAN address here), NAT Port: Blank, Static Port: No
          3. Interface: WAN, Source: 192.168.1.1/24, Destination: blank, Destination Port: 500, NAT Address: (my ISP WAN address here), NAT Port: Blank, Static Port: Yes
          4. Interface: WAN, Source: 192.168.1.1/24, Destination: blank, Destination Port: blank, NAT Address: (my ISP WAN address here), NAT Port: Blank, Static Port: No

          These are the 4 default settings.

          Edit: partially deleted because I wasn't being accurate. I've staring at this too long, all day, and its making me delirious.

          1 Reply Last reply Reply Quote 0
          • K
            kejianshi
            last edited by Oct 31, 2014, 2:27 AM Oct 31, 2014, 2:22 AM

            The one you had before…

            Interface: OpenVPN, Source: Desktop (my alias for 192,168.1.1), Destination:blank, Destination Port: Blank, NAT Address: (my VPN address here), NAT Port: (VPN port), Static Port: Yes

            Remake that one and put it at the top of the list.

            BTW - If 192.168.1.1 is your desktop IP, then what is the LAN IP of pfsense?

            Did you mean to type 192.168.1.2 as IP of desktop?

            1 Reply Last reply Reply Quote 0
            • S
              seitys
              last edited by Oct 31, 2014, 2:37 AM Oct 31, 2014, 2:31 AM

              Yeah ignore what I wrote for that because the source for NAT outbound only has "any," "This Firewall (self)," and "Network" so I wasn't sure what to put there. If I put 192.168.1.0 then my entire subnet would be redirected to the VPN which is not what I want. I thought of creating a separate subnet but I was hoping I didn't have to because I think that could get messy when changing configurations.

              Edit: I'm going to try

              Interface: OpenVPN, Source: any, Translation: Desktop () and leaving everything else blank.

              Edit 2: Okay but I just thought about it. Even if I added that outbound NAT rule, it wouldn't fix anything because it translates everything from my VPN to my 1 host and then it should go down the list, where it should translate everything else to my ISP WAN IP but it doesn't do that.

              1 Reply Last reply Reply Quote 0
              • K
                kejianshi
                last edited by Oct 31, 2014, 2:40 AM Oct 31, 2014, 2:37 AM

                No - you need to have the ip of the desktop in there with a /32 behind it.  And it needs to be top of list.

                Interface: VPN, Source: 192.168.1.2/32, Destination: blank, Destination Port: blank

                1 Reply Last reply Reply Quote 0
                • S
                  seitys
                  last edited by Oct 31, 2014, 2:38 AM

                  Why 32? My entire subnet range is only 192.168.1.1 to 192.168.1.254.

                  1 Reply Last reply Reply Quote 0
                  • K
                    kejianshi
                    last edited by Oct 31, 2014, 2:45 AM Oct 31, 2014, 2:41 AM

                    OK - here is the thing.

                    There is actually no need to create firewall rules actually if you are using manual outbound NAT.

                    You can just do it on manual outbound NAT.

                    Seems like you have mixed together a couple of how-to docs…

                    The reason you enter a /32 behind the desktop IP is because a /32 is one IP where as a /24 is 255.  256 if you count 0.

                    1 Reply Last reply Reply Quote 0
                    • S
                      seitys
                      last edited by Oct 31, 2014, 2:48 AM

                      Interface: VPN, Source: 192.168.1.2/32, Destination: blank, Destination Port: blank, NAT Address: (my VPN address) NAT Port: blank

                      I just added that rule and my entire network still defaults to the VPN instead of just my desktop.

                      1 Reply Last reply Reply Quote 0
                      • K
                        kejianshi
                        last edited by Oct 31, 2014, 2:52 AM

                        Can you post a pic of your outbound NAT and a pic of your LAN firewall rule?

                        1 Reply Last reply Reply Quote 0
                        • S
                          seitys
                          last edited by Oct 31, 2014, 3:26 AM Oct 31, 2014, 3:21 AM

                          http://i.imgur.com/pQFlQy0.png

                          http://i.imgur.com/6UHhYfz.png

                          How do you post images? I'm a newb at forum stuff.

                          1 Reply Last reply Reply Quote 0
                          • K
                            kejianshi
                            last edited by Oct 31, 2014, 3:33 AM

                            may I see you alias for desktop also please?

                            1 Reply Last reply Reply Quote 0
                            • S
                              seitys
                              last edited by Oct 31, 2014, 3:38 AM

                              http://i.imgur.com/F3ZnsdP.png

                              1 Reply Last reply Reply Quote 0
                              • K
                                kejianshi
                                last edited by Oct 31, 2014, 3:47 AM

                                In your outbound NAT, what is that 207 address?  Why doesn't that just say WAN?

                                1 Reply Last reply Reply Quote 0
                                • S
                                  seitys
                                  last edited by Oct 31, 2014, 3:51 AM

                                  its my WAN IP. It says the actual IP instead of WAN because that is the default setting. If I were to remove it and add it again, it would show up as WAN, not the actual IP in numerical form. The only 3 choices in the translation section are interface IP, host alias and other subnet.

                                  1 Reply Last reply Reply Quote 0
                                  • K
                                    kejianshi
                                    last edited by Oct 31, 2014, 3:54 AM

                                    I'd make it WAN.

                                    Then I would delete those first two firewall rules you added on the LAN where you modified the gateway.

                                    Then try it.

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      seitys
                                      last edited by Oct 31, 2014, 4:00 AM

                                      Still the same result.

                                      Why are the firewall rules and NAT outbound rules redundant?

                                      From my understanding:

                                      NAT rules translates my internal IP to an externally registered IP.

                                      Firewall rules dictate what traffic can be allowed into my network.

                                      Aren't those 2 different functions?

                                      1 Reply Last reply Reply Quote 0
                                      • K
                                        kejianshi
                                        last edited by Oct 31, 2014, 4:02 AM

                                        perhaps this is a 2.2 weirdness.

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          seitys
                                          last edited by Oct 31, 2014, 4:19 AM

                                          okay here is something.

                                          Before, every how-to guide mentioned the VPN as another gateway but with the settings in how-to stickied above, the gateway was always offline. BUT, if I remove "redirect-gateway def1" from the advanced setting when configuring vpn, the gateway now shows as online.

                                          Now that I've done that, the opposite thing happens. Only some of the traffic is going through the VPN but my desktop IP is not showing the VPN IP. And I'm not sure what traffic is going through the VPN but its much less than before.

                                          1 Reply Last reply Reply Quote 0
                                          12 out of 29
                                          • First post
                                            22/29
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received