Multi Host Alias & NAT



  • When a firewall alias with multiple hosts is used as the NAT IP (LAN target) in a NAT port forward rule what determines which host IP is forwarded too?

    Have a machine that is sometimes on LAN and sometimes on WLAN (WiFI).  So alias is configured with both.  How does the NAT select which one to forward too?

    Thanks


  • Rebel Alliance Developer Netgate

    I was thinking that pf would do a round-robin forwarding in that case. Each connection would go to the next IP in the list.

    The pf.conf man page seems to agree.

    RDR ROUND ROBIN

    # Translate incoming web server connections to a group of web servers on
        # the internal network.
        rdr on $ext_if proto tcp from any to any port 80
              -> { 10.1.2.155, 10.1.2.160, 10.1.2.161 } round-robin

    But that has the round-robin keyword (which may also be an assumed default in that case)



  • What about when one of the hosts is down?  Would the round-robin skip it?

    Have been using this (multi host alias) with RDP NAT/Firewall rule to a machine that has both LAN and WLAN connection.  But only one active at any given time.  Seems that it should fail to connect every other time unless intelligent enough to skip the offline host.


  • Rebel Alliance Developer Netgate

    I don't think rdr is smart enough to do that. You'd need relayd involved if you want to stop using a down host.



  • @jimp:

    I don't think rdr is smart enough to do that. You'd need relayd involved if you want to stop using a down host.

    That's not what I meant (rdr being smart enough).  Meant pfSense round-robin being smart enough to detect and skip NATing to an offline host that is a member of a multi-host alias.

    UPDATE:
    Just did some quick crude testing and does seem to round-robin and not smart enough to detect and skip an offline host.


  • Rebel Alliance Developer Netgate

    Those two are the same thing. round-robin in an rdr is all pf. It's not smart enough to detect a down host and we don't actively check that.

    That's what relayd is for :-)



  • Oh my bad.  Read rdr as rdp.  :-[


Locked