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

    Interface with DHCP - purpose of "Alias IP Address" field?

    2.0-RC Snapshot Feedback and Problems - RETIRED
    5
    11
    12.1k
    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.
    • F
      Fr3d
      last edited by

      When configuring an interface to use DHCP, I've been unable to work out what the "Alias IP address" field is for.
      Its description is "The value in this field is used as a fixed alias IP address by the DHCP client.", but this doesn't mean a lot to me.

      Could someone explain what the field is for? (Comparing it to my current main installation doesn't help as 1.2.3 doesn't ask for this)

      Cheers :)

      Wasn't sure if this was the right forum, but it is about a 2.0-only field…

      1 Reply Last reply Reply Quote 0
      • V
        Velociraptor
        last edited by

        perhabs an alternativ static ip if the dhcp does not work?

        1 Reply Last reply Reply Quote 0
        • F
          Fr3d
          last edited by

          After going through some source code and finding this in /etc/inc/interfaces.inc: ($wancfg['alias-address'] is the IP Alias variable):

          if(is_ipaddr($wancfg['alias-address'])) {
          	$subnetmask = gen_subnet_mask($wancfg['alias-subnet']);
          	$dhclientconf .= <<<eod<br>alias {
          	interface  "{$wanif}";
          	fixed-address {$wancfg['alias-address']};
          	option subnet-mask {$subnetmask};
          }
          
          EOD;
          }</eod<br>
          

          I looked up what "fixed-address" actually does in dhclient.conf:

          fixed-address ip-address;
          The fixed-address statement is used to set the ip address of a particular lease. This is required for all lease statements. The IP address must be specified as a dotted quad (e.g., 12.34.56.78).

          That doesn't tell me what you're supposed to write in that field.

          (Also, on a network where you're asking a DHCP server for an IP address, subnet mask, gateway and other such information, why would you have to specify an IP address… that defeats the purpose of DHCP... doesn't it? ???)

          1 Reply Last reply Reply Quote 0
          • F
            focalguy
            last edited by

            My "guess" is that this could be used when using a CARP setup where you have a cluster of boxes running pfSense. The alias would be the Virtual IP of the cluster and not just the actual IP of the specific box that you are configuring. I've no idea if that's the reason but that's my guess. Don't have a 2.0 box to test yet so I can't look.

            1 Reply Last reply Reply Quote 0
            • C
              cmb
              last edited by

              Don't put anything there. Sometimes you need an IP alias in addition to a DHCP lease, that's its purpose, it should virtually always be left blank.

              1 Reply Last reply Reply Quote 0
              • F
                Fr3d
                last edited by

                Aha, thanks cmb :)

                Perhaps the text should be made non-bold? - I had assumed the field was required as it is bold ;)

                1 Reply Last reply Reply Quote 0
                • C
                  cmb
                  last edited by

                  @Fr3d:

                  Perhaps the text should be made non-bold? - I had assumed the field was required as it is bold ;)

                  Ah yes, I had overlooked that. I just fixed it.

                  1 Reply Last reply Reply Quote 0
                  • F
                    focalguy
                    last edited by

                    Ah, I misread that this was for the DHCP client and that led me to the erroneous guess.

                    So is Velociraptor correct?
                    @Velociraptor:

                    perhabs an alternativ static ip if the dhcp does not work?

                    1 Reply Last reply Reply Quote 0
                    • F
                      Fr3d
                      last edited by

                      @focalguy:

                      So is Velociraptor correct?
                      @Velociraptor:

                      perhabs an alternativ static ip if the dhcp does not work?

                      After further Googling, it would appear that that field is indeed for assigning a static IP in the event a DHCP server cannot be contacted.

                      The manpage for dhclient.conf says that a value is required, however I assume that if you don't provide a value, it will simply not assign any IP address to the interface in the event it cannot contact a DHCP server.

                      Windows' DHCP client does a similar thing; it assigns an IP in the 169.254.0.0/16 range if it cannot contact a DHCP server, unless you've used the "alternate configuration" tab to specify one yourself.

                      1 Reply Last reply Reply Quote 0
                      • _
                        _igor_
                        last edited by

                        nice info. thanks much!

                        1 Reply Last reply Reply Quote 0
                        • F
                          focalguy
                          last edited by

                          Yes, thanks for the info Fr3d! Learn something new every day. Who knows, maybe that will come in useful for me someday!

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