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

    How to handle dynamic public ip when configuring 1:1 nat?

    Scheduled Pinned Locked Moved NAT
    6 Posts 3 Posters 727 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.
    • M
      maus
      last edited by

      My ISP supports up to 5 PPPOE connections in the same time and I could get 5 public ip addresses. My network is like this:

      pfSense
      –--Wan1:PPPoe,public ip1;
      ----Wan2:PPPoe,public ip2;
      ----Wan3:PPPoe,public ip3;
      ----Wan4:PPPoe,public ip4;
      ----Wan5:PPPoe,public ip5;

      ----Lan (10.0.0.1/24)---- Switch----other devices.

      Now I'd like to set 1:1 nat between PC1(10.0.0.21/24) and public ip2 so my PC1 could get FullCone nat type. I have almost got it work except one thing: The public ip addresses got by PPPoe is DYNAMIC   ??? ,which change periodically. And in the 1:1 nat setting page, the External subnet IP could only be static which means it has to be reconfigured whenever the public ip changed. Any workaround about this ?  :'(

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

        You cannot use 1:1 NAT with dynamic addresses.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • M
          maus
          last edited by

          @jimp:

          You cannot use 1:1 NAT with dynamic addresses.

          Thanks for reply jimp.I'm reading "pfSense: The Definitive Guide" these days and now I know 1:1 NAT only works with static address .But what if we think in a different way ? Like running a cron script to detect the public ip addresses of wan ports to see if they changed and auto fresh the NAT rules . The problem is that pfSense has always stressed that all the configuration could be done in webui and very few documents about cli config is touched .  Any docs about it ?    :P

          1 Reply Last reply Reply Quote 0
          • D
            dwasifar
            last edited by

            @maus:

            @jimp:

            You cannot use 1:1 NAT with dynamic addresses.

            But what if we think in a different way ? Like running a cron script to detect the public ip addresses of wan ports to see if they changed and auto fresh the NAT rules . The problem is that pfSense has always stressed that all the configuration could be done in webui and very few documents about cli config is touched .  Any docs about it ?    :P

            You couldn't run that cron job frequently enough.  Even if you set the script to run every five minutes, your connections would still be down an average of 2.5 minutes if the dynamic IP changed.  And who knows what would happen to existing user sessions when that script changed the config on the fly.

            Can't your ISP provide static IPs?

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

              Or use specific port forwards and outbound NAT.

              1:1 NAT is just a shortcut that makes port forwards for all ports and outbound NAT for the address internally in pf.

              Ignore 1:1 NAT for dynamics. It's not possible and more trouble than it's worth.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • M
                maus
                last edited by

                @dwasifar:

                @maus:

                @jimp:

                You cannot use 1:1 NAT with dynamic addresses.

                But what if we think in a different way ? Like running a cron script to detect the public ip addresses of wan ports to see if they changed and auto fresh the NAT rules . The problem is that pfSense has always stressed that all the configuration could be done in webui and very few documents about cli config is touched .  Any docs about it ?    :P

                You couldn't run that cron job frequently enough.  Even if you set the script to run every five minutes, your connections would still be down an average of 2.5 minutes if the dynamic IP changed.  And who knows what would happen to existing user sessions when that script changed the config on the fly.

                Can't your ISP provide static IPs?

                My ISP only provides static IPs in expensive enterprise plan which is not a good deal for my family use .  On the other side, my IPs  refresh exactly every 96 hours ,long enough to treat it as "static" if we could auto fresh the NAT rules wisely and minimize the impact from temporary down connections ,that's why I'm seeking for a work around here  ;)

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