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

    Going from DHCP to Static IP

    General pfSense Questions
    static ip
    3
    10
    1.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.
    • D
      DKentoy
      last edited by

      Hi.
      I had some issues with port forwarding in pfSense, I mean pfSense did what it should and if I tested it within pfSense nothing was wrong. So the problem was that I didn't had a static IP, that was what my ISP said, so now I have a static IP from my ISP and I would like to have a little help to set it up.

      IP is: a.b.c.154
      GW is: a.b.c.129
      NM is: 255.255.255.192
      DNS1 is: a.b.130.1
      DNS2 is: a.b.131.1

      I tried to set it up, but I get these errors:

      The following input errors were detected:
      The gateway address a.b.c.129 does not lie within one of the chosen interface's subnets.
      The gateway IP address "a.b.c.129" already exists.

      I tried to use 30 as my interface's subnet

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

        @valnurat said in Going from DHCP to Static IP:

        255.255.255.192

        That is /26. If you use that the .129 will be inside your subnet.

        Steve

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by johnpoz

          @valnurat said in Going from DHCP to Static IP:

          a.b.c.129
          255.255.255.192

          Yeah that is a /26 and the network would be
          x.x.x.128/26

          So yeah a .129 would be the first IP in that range.

          You sure you set your mask right when setting static - Why would you use /30 if they told you /26? (255.255.255.192)

          BTW you do not need a static public IP to do port forwarding.. Not sure where you would of gotten that idea?

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

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

            @johnpoz said in Going from DHCP to Static IP:

            BTW you do not need a static public IP to do port forwarding

            It doesn't hurt though. 😉

            Avoids using DynDNS with potential update failures/delays.

            Steve

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by johnpoz

              Sure it doesn't hurt.. I feel for some of these users with isp that change their IPs when the wind blows. I have had same public IP for years at a time, via dhcp.. Since why should it ever change if your connection is never off for longer than the lease time, etc.

              But it for sure is not a requirement by any means to have a static to do a port forward.. If he thinks is problem with port forward was related to no having static public IP.. He is prob going to run be a bit ticked when he has static and still runs into the same issue he was having before ;)

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 1
              • D
                DKentoy @johnpoz
                last edited by

                @johnpoz

                @johnpoz said in Going from DHCP to Static IP:

                @valnurat said in Going from DHCP to Static IP:

                a.b.c.129
                255.255.255.192

                Yeah that is a /26 and the network would be
                x.x.x.128/26

                So yeah a .129 would be the first IP in that range.

                You sure you set your mask right when setting static - Why would you use /30 if they told you /26? (255.255.255.192)

                BTW you do not need a static public IP to do port forwarding.. Not sure where you would of gotten that idea?

                How did you came to 26? How did they told me that it is 26? Sorry for asking. :)

                I talked to my ISP and the reason is that I'm behind a firewall they have. When I get my own they will open for all ports that's available. I saw it to on my webpage on the ISP.

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  Because 255.255.255.192 is /26 that is how

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    DKentoy @johnpoz
                    last edited by

                    @johnpoz

                    So I just count all the 1's in subnet?

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

                      Yup, that's how it works:
                      Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000

                      https://en.wikipedia.org/wiki/Subnetwork#Subnetting

                      Steve

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator
                        last edited by johnpoz

                        Yeah you could do that - or you could do this for living and just now that .192 is /26

                        Just like
                        .248 is /29
                        and
                        255.255.255.252 is /30
                        etc. etc.

                        ☺

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

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