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

    Replacing old router with a new instance of pfsense + BGP protocol to configure a dual link to the ISP

    Scheduled Pinned Locked Moved General pfSense Questions
    28 Posts 4 Posters 2.3k 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.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      We did a hangout on configuring FRR: https://youtu.be/4IlKcB17rWk?t=2389

      We also have the docs here: https://docs.netgate.com/pfsense/en/latest/packages/frr/bgp/example.html

      It's really quite specific to your setup though. How is the current router setup? What is your ISP telling you to configure?

      Steve

      M 1 Reply Last reply Reply Quote 2
      • M
        mauro.tridici @stephenw10
        last edited by

        @stephenw10

        Wow! Thanks, the hangout is very interesting, thank you.
        Also the official netgate docs are so useful.

        My ISP gave me one IP address on a /30 subnet for the point to point link with the upstream gateway and a range of public IPs on a /25 subnet.
        The IPS provided also the ASN for the BGP configuration.

        I already simulated the future scenario in GNS3 and it works, but before going in the "real world" I would like to know if, in order to configure pfSense as a simple router with BGP, I should activate (or deactivate) some particular pfSense feature.

        I read that, to reach my target configuration, I should do something like that:

        https://blog.matrixpost.net/convert-pfsense-into-a-routing-only-platform/

        (adding some other changes for the BGP).

        In you opinion, is it really the right procedure to run pfSense as a router only?
        I'm doing this kind of question because it is not an official netgate page.

        Thank you in advance.
        Have a great day,
        Mauro

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by stephenw10

          You would want to disable outbound NAT for that /25 subnet on the WAN since it's a public subnet.

          You probably don't want to disable pf entirely because that disables the firewall and you would still want to be able to filter traffic.

          Steve

          M 1 Reply Last reply Reply Quote 1
          • M
            mauro.tridici @stephenw10
            last edited by

            @stephenw10

            Thank you, Steve :) your suggestions are always useful.

            Have a great day.
            Mauro

            1 Reply Last reply Reply Quote 0
            • M
              mauro.tridici
              last edited by

              Hello Steve,

              I was able to do the work mentioned above in a real scenario.
              Outbound NAT has been disabled.

              In this pfsense/router instance I have 4 interfaces:

              WAN1 (/30 primary link to ISP)
              WAN2 (/30 backup link to ISP)
              PUBLIC (/25 public subnet behind the router
              LAN (for the management of the pfsense instance itself).

              Do you think that I should enable the NAT only for the LAN?
              And if yes, how can I do it?

              Thank you,
              Mauro

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Yes, you will need outbound NAT for the LAN.

                You can do that do that either by setting outbound NAT in manual mode and only adding rules for the LAN subnet via each WAN. And possibly localhost too.
                Or by setting oubound NAT in hybrid mode and then adding do-not-NAT rules for the public subnet.

                You will probably want to setup both WANs in a gateway group and use that to provide failover or load-balancing for connections from LAN.

                Steve

                M 1 Reply Last reply Reply Quote 1
                • M
                  mauro.tridici @stephenw10
                  last edited by mauro.tridici

                  @stephenw10

                  Hello Steve,

                  a short description of the current pfsense router configuration running in GNS3:

                  • WAN1 (192.168.1.2/30 primary link to ISP)
                  • WAN2 (192.168.2.2/30 backup link to ISP)
                  • PUBLIC (192.168.99.1/25 public subnet behind the router)
                  • LAN (for the management of the pfsense instance itself). 192.168.10.1/24

                  I decided to use HYBRID OUTBOUND NAT adding the do-not-NAT rules for the public subnet.
                  Could you please check if the NAT rules in the OUTBOUND NAT section are the right ones?

                  Screenshot 2022-11-23 at 14.25.30.png

                  So, if everything is ok, LAN should be NATted and PUBLIC should not be NATted. Both the hosts on LAN subnet and the hosts on PUBLIC subnet are able to reach internet.

                  But how can I verify that NAT is actually disabled between PUBLIC and WAN1/WAN2 interface? Is there a way to do it using "packet capture" feature of GNS3?

                  The following lines have been added after reading carefully the official documentation

                  I think that I made a mistake in the previous configuration. I'm not sure, but I think that the INTERFACE field in the MAPPING section should be WAN1 and WAN2. Please correct me if I'm wrong again.

                  Screenshot 2022-11-23 at 17.32.37.png

                  In this case, the hosts in the LAN subnet are still able to reach internet (thanks to the enabled NAT), but the hosts in the PUBLIC subnet are not.

                  What should I do to fix this problem?

                  Thank you in advance,
                  Mauro

                  Cool_CoronaC 1 Reply Last reply Reply Quote 0
                  • Cool_CoronaC
                    Cool_Corona @mauro.tridici
                    last edited by

                    @mauro-tridici How do you map a NAT rule from WAN to LAN?

                    Its like everything is backwards....?

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      mauro.tridici @Cool_Corona
                      last edited by mauro.tridici

                      @cool_corona sorry, but I'm still a newbie, I'm at beginning. Could you please explain where is my error and the right solution to my problem?

                      Is It the first one I proposed (first screenshot) or the second one?

                      In addition, how can I check that NAT is working as expected ( maybe using the pf sense packet capture)?

                      Thank you.

                      Cool_CoronaC 1 Reply Last reply Reply Quote 0
                      • Cool_CoronaC
                        Cool_Corona @mauro.tridici
                        last edited by

                        @mauro-tridici No I an a newbie too in BGP but I dont get the NAT in regards to the public /25 that imho is the one that gets routed from WAN to LAN

                        1 Reply Last reply Reply Quote 0
                        • M
                          mauro.tridici
                          last edited by

                          @cool_corona ok, so let's see what @stephenw10 will say about that 😊

                          1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by

                            No, the 'do-not-nat' rules should be on WAN1 and WAN2 for the PUBLIC subnet. You do not want to NAT traffic from PUBLIC as it leaves WAN1 or WAN2.

                            You can confirm that by runnig a pcap on WAN1 or WAN2 and you should see traffic from the PUBLIC subnet there.

                            I assume that you are using 192.168.99.0/24 just as an example here? The real subnet is actually public?

                            Steve

                            M 1 Reply Last reply Reply Quote 1
                            • M
                              mauro.tridici @stephenw10
                              last edited by mauro.tridici

                              @stephenw10 thank you Steve, you helped me again :)
                              Yes 192.168.99.0/24 is just an example and the real subnet is a public subnet.

                              Setting outbound NAT as in the second screenshot I was able to make it working.
                              Before it didn't work because I forgot to route the traffic from the ISP router to the public customer subnet (192.168.99.0/24).

                              After adding, on each ISP upstream gateway, the following routes everything started working as expected:

                              on primary ISP upstream gateway
                              ip route 192.168.99.0 255.255.255.0 192.168.1.2

                              on backup ISP upstream gateway
                              ip route 192.168.99.0 255.255.255.0 192.168.2.2

                              This is the final GNS3 schema

                              Screenshot 2022-11-24 at 10.21.41.png

                              1 Reply Last reply Reply Quote 0
                              • Cool_CoronaC
                                Cool_Corona
                                last edited by

                                Public is internet.... pc is on LAN.

                                The /25 IP's are on WAN and not LAN. Unless you run a hotspot or internetcafe.

                                Otherwise I dont get the setup...

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  mauro.tridici @Cool_Corona
                                  last edited by

                                  In my particular case, pfsense is acting as a "customer border router".
                                  It is connected to the WAN (ISP AS) using em0 and em1 ports with two redundant PTP links.
                                  Watching the schema, 192.168.1.2/30 and 192.168.2.2/30 are the IPs for the PTP links.

                                  ISP is routing the public subnet (192.168.99.0/24) to the pfsense router.
                                  For this reason I need to disable NAT on pfsense.

                                  In the real scenario, the "PC on public subnet" will be replaced by a physical firewall. So, at the end, you will see something like that:

                                  ISP RC1 + ISP RC2 <-> PFSENSE ROUTER <-> FIREWALL <-> LANs

                                  Cool_CoronaC 1 Reply Last reply Reply Quote 0
                                  • Cool_CoronaC
                                    Cool_Corona @mauro.tridici
                                    last edited by

                                    @mauro-tridici Cant pfsense act as both router and firewall for the clients?

                                    M 1 Reply Last reply Reply Quote 0
                                    • M
                                      mauro.tridici @Cool_Corona
                                      last edited by

                                      @cool_corona Sure, it can. But in our case, we prefer this kind of deployment.

                                      1 Reply Last reply Reply Quote 1
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Yes, I would expect that to work.

                                        1 Reply Last reply Reply Quote 0
                                        • P Patch referenced this topic on
                                        • P Patch referenced this topic on
                                        • First post
                                          Last post
                                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.