Alias to the WAN ip

  • Sorry if its been covered before, I did search the forums,

    But was wondering if its possible to create a dynamic alias for my wan IP or is the WAN description field already an alias or something like that?

    I have manually created an IP alias called WAN_IP that I have manually set with my wan IP, but when my WAN ip changes, I still have to update the alias to the new IP so all my rules update.

    my pfsense WAN is set to PPPoE to control my ADSL which is fairly stable, but after a power cut or something it will reconnect and I will get a new WAN ip and have to manually update my alias to the new IP, just wondering if I could do better and be more automated.


  • LAYER 8 Netgate

    Most people just use "WAN address"

  • Thanks,
    I tried that but it didn't work.

    I previously created a NAT port forward rule, and I see that has "WAN Address" in the destination address, but that was selected from a drop down menu when configuring the rule. Thats why I was wondering if there was already a system alias for the WAN ip or something.

    Im trying to set up a load balanced virtual server, I would like the virtual server to listen on the WAN ip, at the moment that is where I put my WAN_IP alias, that is manually updated, but I tried to change that to "WAN Address" so that it will always listen on the WAN ip even after a system reboot and new IP getting assigned, but when you save the rule you get:

    "The following input errors were detected:
    WAN address is not a valid IP address, IPv4 subnet, or alias."

    So not quite what I was after.

  • LAYER 8 Netgate

    If it's not in the pull down in the particular context, you can't use it.  You can't just type it in as an alias.

  • Thanks, that what I thought too.

    So is there any way to have a dynamically updating alias that is your WAN ip?

    The drop down menu must reference something, does that reference code that looks up the WAN ip? or is there a system variable that can reference the WAN ip that can be used as an alias / in rules without hard coding the WAN ip each time?


  • LAYER 8 Netgate

    I don't think so.

    A roundabout way might be to set an alias to an FQDN and set the FQDN to a hostname dynamically updated by dyndns on WAN.  That probably won't reflect changes fast enough.

    Are you configuring Services > Load Balancer > Virtual Servers?  I can't think of an effective way to use a dynamic address there.  Depends on how quickly you need it to update.

    I looked in /tmp/rules.debug and everywhere that references WAN address has been replaced by the actual IP address, not an alias to it.

Log in to reply