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

    PfSense in HA Wan multipla, LAN multipla e IP pubblici

    Scheduled Pinned Locked Moved Italiano
    17 Posts 4 Posters 1.2k 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
      Milord
      last edited by Milord

      Buongiorno a tutti
      Vorrei sottoporre a chi ha pazienza un quesito.
      Attualmente ho configurato un PfSense con doppia WAN, e due LAN, su due ISP diversi, una con 32 indirizzi pubblici e l'altra con 16 ip pubblici. Tutti questi IP sono gestiti direttamente dal PfSense (i router degli ISP sono trasparenti), e sono tutti usati per vari servizi sia in ingresso che in uscita.
      Attualmente gli IP pubblici sono tutti inseriti in VirtualIPs e vengono correttamente gestiti, sia per i servizi in ingresso che per i servizi in uscita e il fault tollerance in uscita
      Vorrei trasformare il sistema in HA ma, mentre mi è chiaro come configurare e gestire il lato con le due LAN, non mi è chiaro come configurare il lato con le due WAN e tutti gli IP pubblici.
      Mi viene da pensare che se configuro un indirizzo CARP su ogni scheda WAN, mi perdo l'informazione dell'IP pubblico dal quale entra un eventuale servizio.
      Esempio:

      WAN1 1.2.3.4/27
      WAN2 5.6.7.8/28
      Sull'IP pubblico 1.2.3.9 ho in entrata SSH
      Sull'IP pubblico 5.6.7.11 ho un entrata HTTPS
      Come si configura il NAT se ho un solo CARP per ogni WAN?
      (Sul PfSense sono configurati anche OpenVPN e IPSEC)

      In uscita ho invece un server di posta che ha un Outbound configurato su uno specifico IP pubblico della WAN2 non modificabile, a meno di cambiare record MX pubblico, DMARC, SPF e compagnia bella.

      Non so se sono riuscito a spiegare quale è il problema, spero di si.

      Grazie

      1 Reply Last reply Reply Quote 0
      • kiokomanK
        kiokoman LAYER 8
        last edited by kiokoman

        credo di aver capito il problema e lo scchema da seguire dovrebbe essere questa qui
        https://docs.netgate.com/pfsense/en/latest/recipes/high-availability-multi-wan.html#nat-configuration
        ma effettivamente non è approfondita la parte NAT, parla di Ensure that only CARP VIPs are used for inbound traffic or routing
        e quindi mi sta venendo il tuo stesso quesito
        forse @fabio-vigano ne sa qualcosa ma è un po che non si collega
        ma sicuramente nella sezione inglese ti sapranno spiegare meglio

        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
        Please do not use chat/PM to ask for help
        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

        1 Reply Last reply Reply Quote 0
        • kiokomanK
          kiokoman LAYER 8
          last edited by kiokoman

          @johnpoz
          we have a pfsense with 2 wan
          both modem in bridge and public ips directly on pfsense
          WAN1 1.2.3.4/27
          WAN2 5.6.7.8/28
          all IPs are added as virtual IPs
          also, there are some services running on some IP that need to go out with a specific IP
          as it is now all is working but

          he wants to implement HA

          it's not clear how to configure the wan side of HA for nat to work..? does he need to add a carp address for each public IP and then associate a nat to them? or what?
          I can't understand the docs, I don't understand how nat work with all this public IP if it says that I need to nat everything on a single carp IP address

          ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
          Please do not use chat/PM to ask for help
          we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
          Don't forget to Upvote with the 👍 button for any post you find to be helpful.

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

            well if he is setup as HA already then assume all those IPs are already the carp addresses.

            As to how to do outbound to specific VIP, just do that in outbound nat.

            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
            • kiokomanK
              kiokoman LAYER 8
              last edited by kiokoman

              I think IPs are added as IP alias, does it mean that he needs to add it as carp IP instead?

              just to be clear
              he now has this situation
              multiwan-on-pfsense-23-pfsense-hangout-march-2016-11-638.jpg

              and he wants to do this I think
              diagrams-example-multi-wan-carp (1).jpg

              ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
              Please do not use chat/PM to ask for help
              we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
              Don't forget to Upvote with the 👍 button for any post you find to be helpful.

              M 1 Reply Last reply Reply Quote 1
              • M
                Milord @kiokoman
                last edited by

                @kiokoman said in PfSense in HA Wan multipla, LAN multipla e IP pubblici:

                he now has this situatio

                Hai centrato perfettamente la situazione, e grazie per il supporto inglese, (io sono negato)

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

                  Vediamo così:
                  definisco tutti gli IP delle subnet WAN come indirizzi CARP nella definizione dei VIPs, tranne il primo, assegno alle schede WAN (fisiche) IP in una subnet diversa da quella delle WAN e le metto in CARP sul primo IP delle sottoreti WAN.
                  Il dubbio: si potrà definire un indirizzo CARP su due NIC che hanno subnet diversa?

                  1 Reply Last reply Reply Quote 0
                  • kiokomanK
                    kiokoman LAYER 8
                    last edited by

                    sinceramente non ci ho capito granchè e credo che neanche lui lo sappia di preciso o non ha capito la domanda
                    a guardare lo schema li sopra sull'immagine sono specificati indirizzi ip con subnet diverse su due nic diverse alla fine. ma poi se si utilizzano ip pubblici presumo che anche l'isp debba supportare/permettere il protocollo carp in qualche modo
                    vediamo se ci risponde ancora altrimenti chiedo direttamente nella sezione inglese

                    ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                    Please do not use chat/PM to ask for help
                    we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                    Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                    1 Reply Last reply Reply Quote 1
                    • M
                      Milord
                      last edited by

                      Grazie.
                      Intanto, per le necessarie prove devo ancora recuperare due schede di rete che mi mancano; nelle peggiori delle ipotesi provo ad inventare un paio di proxy/reverse proxy con Nginx da mettere tra Modem e PfSense, ma la vedo lunga, sempre che si possa fare.

                      1 Reply Last reply Reply Quote 0
                      • kiokomanK
                        kiokoman LAYER 8
                        last edited by kiokoman

                        mi hanno risposto sull'altra discussione in inglese

                        https://forum.netgate.com/topic/157770/pfsense-high-availability-exapand-existing-firewall-with-multi-wan-and-multi-ip/3?_=1603298501202

                        in pratica da quello che ho capito usi i tre ip per il carp (wan1 wan2 e shared carp), il nat verso il carp è solo per i servizi direttamente configurati sul pfsense o subito dopo ma per il resto continui ad usare ip alias e a nattare su quelli

                        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                        Please do not use chat/PM to ask for help
                        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                        1 Reply Last reply Reply Quote 1
                        • M
                          Milord
                          last edited by

                          Dopo una pausa, dovuta ad altre attività, riprendo le prove su un ambiente virtuale.
                          Un pezzo alla volta, magari riuscirò a mettere in piedi questo sistema.

                          fabio.viganoF 1 Reply Last reply Reply Quote 0
                          • fabio.viganoF
                            fabio.vigano @Milord
                            last edited by

                            Ciao @Milord,
                            La gestione è simile ad un singolo firewall.
                            L'unica vera differenza è che di base ti servono 3 ip per ogni subnet: Uno per ogni firewall ed uno virtuale di tipo carp che diventa l'IP con cui le altre macchine dialogano con il cluster.
                            Gli ip assegnati fisicamente al firewall servono solo per gestione, in outbound sengestiti male precludono l'aggiornamento di firmware e packages della macchina slave.
                            Tutti gli ip aggiuntivi continui a registrarli come ip virtuali di tipo Alias
                            Fai attenzione che ora avendo un ip virtuale di tipo carp che identifica il tuo cluster, in tutte le regole di Nat inbound ed outbound Devi far riferimento a quello e non all'interfaccia.
                            Il Nat outbound è da impostare necessariamente in manual

                            Ciao Fabio

                            ===============================
                            pfSenseItaly.com
                            La risorsa italiana per pfSense

                            Se il post o la risposta ti sono stati utili clicca su 👍

                            M 1 Reply Last reply Reply Quote 1
                            • M
                              Milord @fabio.vigano
                              last edited by Milord

                              @fabio-vigano
                              Grazie per il "chiaro charimento".
                              Era quello che temevo, in questo modo credo, se ho capito bene, che dovrò ridefinire alcuni record DNS pubblici e spostare gli accessi ad alcuni servizi su altri IP delle subnet. Nella gestione dell'outbound, al momento impostato "ibrido" ho solo il server di posta, ma quello non mi preoccupa.

                              fabio.viganoF 1 Reply Last reply Reply Quote 0
                              • fabio.viganoF
                                fabio.vigano @Milord
                                last edited by

                                @Milord
                                Di solito in caso di migrazione da fw singolo a cluster noi manteniamo il vecchio IP asssegnato ad ogni subnet come IP CARP ed assegnamo alle interfacce fisiche IP nuovi.
                                E' un lavoro lungo e meticoloso da fare in ambiente non di produzione e quando hai finito ti porti la config in produzione senza troppi problemi. In alcuni casi effettuiamo le modifiche direttamente sul file di config XML e quando siamo pronti facciamo un restore della config in produzione.
                                Di queste migrazioni ne ho fatte parecchie, sono onerose in termini di tempo se hai configurazioni complesse.

                                Ciao

                                ===============================
                                pfSenseItaly.com
                                La risorsa italiana per pfSense

                                Se il post o la risposta ti sono stati utili clicca su 👍

                                M 1 Reply Last reply Reply Quote 1
                                • M
                                  Milord @fabio.vigano
                                  last edited by

                                  @fabio-vigano
                                  Ricapitolando con un esempio.
                                  Subnet con indirizzi da 1 a 16
                                  L'indirizzo 1 definito come CARP
                                  L'indirizzo 2 fisso sul primo firewall svincolato da record DNS pubblici
                                  L'indirizzo 3 fisso sul secondo firewall svincolato da record DNS pubblici
                                  Gli indirizzi da 4 a 16 definiti come alias entrambi i firewall.
                                  Corretto?

                                  1 Reply Last reply Reply Quote 0
                                  • fabio.viganoF
                                    fabio.vigano
                                    last edited by

                                    Esatto

                                    ===============================
                                    pfSenseItaly.com
                                    La risorsa italiana per pfSense

                                    Se il post o la risposta ti sono stati utili clicca su 👍

                                    M 1 Reply Last reply Reply Quote 1
                                    • M
                                      Milord @fabio.vigano
                                      last edited by

                                      @fabio-vigano
                                      Grazie. Non mi resta altro da fare che augurarmi buon lavoro. :-)

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