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

    PT_BR:A meses enfrento um problema com NAT e o PPPoE Server / EN_US:For months I have been facing a problem with NAT and PPPoE Server

    Scheduled Pinned Locked Moved NAT
    4 Posts 1 Posters 314 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.
    • R
      rootsys
      last edited by rootsys

      PT-BR:
      Tem alguns meses já que estou tendo esse problema, não consigo entender se é simplesmente por burrice, mas simplesmente não consigo enxergar o que se passa...

      A minha configuração atual é:
      1 PfSense virtualizado em Proxmox

      1 Placa de rede com 4 portas 2.5Gbps:
      porta 1 - link de internet conectado em bride com uma ONU do ISP (ip fixo; a interface WAN está recebendo um ip público.)
      porta 2 - segundo link de internet configurado em Alta Disponibilidade (link 1: tier 1, link 2: tier 2)
      porta 3 - interface DMZ que conecta um switch (10/100/1000) - meu computador está conectado no mesmo switch, juntamente com os 2 clusters do proxmox (em ambos os clusters a conexão da máquina é feita através de outra interface que não vou listar pois acredito não haver necessidade técnica)
      porta 4 - interface PPPoE; aonde tem um pppoe server do pfsense rodando (conectado a OUTRO switch que conecta alguns roteadores proximos)

      cluster 1 - 1 placa de rede com 4 portas de rede + 1 porta da placa mãe (sendo essa conectada ao switch da interface DMZ) que conecta internet no cluster:
      pfsense (controla 4 portas)
      pihole (LXC Ubuntu 24.04)
      2 servidores com bind9 (LXC ubuntu 24.04) (esses são vinculados como servidores custom no pihole)

      cluster 2 - 1 porta de rede da placa mãe que recebe internet do switch conectado na interface DMZ:
      1 servidor bind9 (LXC ubuntu 24.04) (esse é adicionado (juntamente com pihole) tanto em System>General Setup> DNS Server Settings; quanto no servidor pppoe do pfsense (o pihole também))
      1 openmediavault (irrelevante)
      1 ubuntu 24.04 que tem o docker+portainer e também um Nginx Proxy Manager
      1 servidor de emails (mailcow dockerized)

      Tudo descrito acima funciona perfeitamente!

      Agora vamos aos problemas:
      Não tive maiores problemas para configurar alguns NAT Port Forward, as portas 443 e 80 são redirecionadas para o NPM(Nginx Proxy Manager) enquanto outras vão para o mailcow <- (acesso feito via proxy reverso (NPM)), quando tento acessar a WebGUI do mailcow pela DMZ; funciona adequadamente (o mailcow reconhece a conexão como feita pelo pfsense no gateway da dmz (10.0.0.1 (é um /8))), quando a conexão é feita por uma máquina fora da minha infra; também funciona perfeitamente!! O real problema surge quando tento me conectar (em qualquer redirect do NPM) através de algum cliente da interface pppoe server (4a porta do pfsense); simplesmente não funciona através do dominio publico (SIM! Foi configurado o NAT Reflection <- (PURE NAT) e também foi tentado o DNS Split (no pihole que é meu servidor DNS principal e também desativei o pihole para tentar com o próprio DNS Resolver&Forwarder) que não funcionou adequadamente), quando tentei o DNS Split; tentei fazer o apontamento do DNS Record tanto para o ip local do NPM quanto para o ip local do mailcow: que também não funcionou. O NAT Reflection parece funcionar adequadamente, quando desativado também não consigo acessar pela DMZ (mas consigo acessar externamente) e também não é acessivel pelos clientes do servidor pppoe.
      Se alguém se perguntar: Também tentei usar servidores de DNS publico (google e cloudflare)

      System>Advanced>Firewall & NAT>Network Address Translation
      imagem¹ b4f19b24-32a3-496d-9a92-e1e1dc8f9dd9-image.png
      edit¹: foi testado com NAT + Proxy o que resultou na mesma coisa.

      Firewall>NAT>Port Forward
      imagem² f6c76a71-550e-4334-821b-4aa8e342035f-image.png

      Firewal>NAT>Outbound
      imagem³ eba594b1-c356-45c9-991d-f26be3235b8b-image.png
      Pode ignorar a regra criada manual, foi uma tentativa fútil já que a regra automatica também cobre ela

      Firewall>Rules>0WAN (0WAN = porta 1)
      imagem4 71f3a273-7656-4c73-9d4a-8124d631bbba-image.png

      Firewall>Rules>2DMZ
      imagem5 e5185880-3a1d-4b05-b2a0-b4303ea5e5b4-image.png
      Para fins de teste foi criada uma regra permitido todo e qualquer tráfego (adivinha?! não funcionou)

      Firewall>Rules>3PPPOE
      imagem6 3388e728-77ea-4847-84aa-17a7db69cdbc-image.png
      Pelos meus testes, as regras da interface em si não interferem no PPPoE Server, mas...
      Para fins de teste foi criada uma regra permitido todo e qualquer tráfego (adivinha?! não funcionou)

      Firewall>Rules>PPPoE Server
      imagem7 e2e9ff57-f258-4fe3-a785-803056beb806-image.png
      Associado a 4a regra de cima para baixo
      imagem8 64c94c1b-b2a6-4c48-a00b-9ba74cf6d22b-image.png
      Embora seja mostrado ACTION->PASS, acredito que não esteja funcionando adequadamente, visto que esse destination sendo o meu PUB_IP:80 (acessando o dominio publico do mailcow + force ssl do NPM deveria ser redirecionado para a 443; quando não é, provando que não funciona) -> Quando acessado externamente ou pela DMZ através do protocolo HTTP, é automaticamente feito um redirect para HTTPS graças ao NPM (o que não acontece quando acessado via cliente do servidor pppoe)

      O firewall do proxmox não está ativo para o pfsense, mas está 100% funcional para todas as outras VMs em ambos os nós (Para fins de teste todas as regras de firewall das VMs envolvidas foram desativadas (adivinha?! não funcionou))

      Em Firewall>Rules>PPPoE Server na 4a regra de cima para baixo eu também tentei alterar o gateway de saida para o 2o link de internet (adivinha?! pois é, acredita que também não funcionou?) (obs¹: obtive as mesmas logs de firewall mostradas na imagem8 logo acima)

      nota¹: consigo acessar o mailcow mas apenas com o ip_local da máquina + port
      nota²: consigo pingar o dominio publico do mailcow através de um cliente do servidor pppoe (o que mostra que o dominio é traduzido corretamente), mas não consigo acessar a WebGUI do mailcow através do dominio.

      EN_US:
      I've been having this problem for a few months now, I can't understand if it's just stupidity, but I just can't see what's going on...

      My current configuration is:
      1 PfSense virtualized in Proxmox

      1 Network card with 4 2.5Gbps ports:
      port 1 - internet link connected in bride with an ONU from the ISP (fixed IP; the WAN interface is receiving a public IP.)
      port 2 - second internet link configured in High Availability (link 1: tier 1, link 2: tier 2)
      port 3 - DMZ interface that connects a switch (10/100/1000) - my computer is connected to the same switch, along with the 2 proxmox clusters (in both clusters the machine's connection is made through another interface that I won't list because I believe there is no technical need)
      port 4 - PPPoE interface; where there is a pfsense pppoe server running (connected to ANOTHER switch that connects some nearby routers)

      cluster 1 - 1 network card with 4 network ports + 1 port on the motherboard (this one connected to the DMZ interface switch) that connects the internet to the cluster:
      pfsense (controls 4 ports)
      pihole (LXC Ubuntu 24.04)
      2 servers with bind9 (LXC ubuntu 24.04) (these are linked as custom servers in pihole)

      cluster 2 - 1 network port on the motherboard that receives internet from the switch connected to the DMZ interface:
      1 bind9 server (LXC ubuntu 24.04) (this is added (along with pihole) both in System>General Setup>DNS Server Settings; and in the pfsense pppoe server (pihole too))
      1 openmediavault (irrelevant)
      1 ubuntu 24.04 that has docker+portainer and also an Nginx Proxy Manager
      1 email server (dockerized mailcow)

      Everything described above works perfectly!

      Now let's get to the problems:
      I had no major problems configuring some NAT Port Forward, ports 443 and 80 are redirected to NPM (Nginx Proxy Manager) while others go to mailcow <- (access made via reverse proxy (NPM)), when I try to access the mailcow WebGUI through the DMZ; it works properly (mailcow recognizes the connection as made by pfsense on the DMZ gateway (10.0.0.1 (it's a /8))), when the connection is made by a machine outside my infrastructure; it also works perfectly!! The real problem arises when I try to connect (in any NPM redirect) through some client of the pppoe server interface (4th port of pfsense); It simply does not work through the public domain (YES! NAT Reflection <- (PURE NAT) was configured and DNS Split was also tried (in pihole which is my main DNS server and I also disabled pihole to try with DNS Resolver&Forwarder itself) which did not work properly), when I tried DNS Split; I tried to point the DNS Record to both the local IP of NPM and the local IP of mailcow: which also did not work. NAT Reflection seems to work properly, when disabled I also cannot access through the DMZ (but I can access externally) and it is also not accessible by PPPoE server clients. If anyone is wondering: I also tried using public DNS servers (google and cloudflare)

      System>Advanced>Firewall & NAT>Network Address Translation
      image¹
      edit¹: tested with NAT + Proxy which resulted in the same thing.

      Firewall>NAT>Port Forward
      image²

      Firewall>NAT>Outbound
      image³
      You can ignore the manually created rule, it was a futile attempt since the automatic rule also covers it

      Firewall>Rules>0WAN (0WAN = port 1)
      image4

      Firewall>Rules>2DMZ
      image5
      For testing purposes, a rule was created allowing any and all traffic (guess what?! it didn't work)

      Firewall>Rules>3PPPOE
      image6
      According to my tests, the rules of the interface itself do not interfere with the PPPoE Server, but...
      For testing purposes, a rule was created allowing any and all traffic (guess what?! it didn't work)

      Firewall>Rules>PPPoE Server
      image7
      Associated with the 4th rule from top to bottom
      image8
      Although it shows ACTION->PASS, I believe it is not working properly, since this destination being my PUB_IP:80 (accessing the public domain of mailcow + force ssl of NPM should be redirected to 443; when it is not, proving that it does not work) -> When accessed externally or through the DMZ through the HTTP protocol, a redirect to HTTPS is automatically made thanks to NPM (which does not happen when accessed via the pppoe server client)

      The proxmox firewall is not active for pfsense, but it is 100% functional for all other VMs on both nodes (For testing purposes all firewall rules of the VMs involved were disabled (guess what?! it did not work))

      In Firewall>Rules>PPPoE Server in the 4th rule from top to bottom I also tried to change the outgoing gateway to the 2nd internet link (guess what?! yeah, can you believe that it did not work either?) (obs¹: I got the same firewall logs shown in image 8 above)

      note¹: I can access mailcow but only with the machine's local_ip + port
      note²: I can ping the mailcow public domain through a pppoe server client (which shows that the domain is translated correctly), but I can't access the mailcow WebGUI through the domain.

      R 1 Reply Last reply Reply Quote 0
      • R
        rootsys @rootsys
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • R
          rootsys
          last edited by rootsys

          PT_BR:
          Também tentei desativar Block private networks o que também não funcionou (Acredito que desativar essa opção só faça sentidos em casos aonde a interface WAN recebe um IP local ao invés de um publico que é o caso)
          imagem¹ 27f8f62c-aca2-4a71-a053-66eb1dfa34df-image.png

          Caso alguém se pergunte: Atualmente o meu pihole está configurado dessa seguinte fora
          imagem² a30aaa2a-e056-4a21-8114-069a8cf2d4f9-image.png

          Quando tentei o DNS Split pelo pihole, fiz assim em Local DNS Records [A/AAAA]:
          imagem³ 9bb9b770-570a-44dc-988c-cadf98392030-image.png
          nota¹: esse ip local é referente a máquina que contem o NPM.
          nota²: também tentei com o ip local do proprio mailcow (10.0.50.15)
          O mesmo também foi feito em Local CNAME Records:
          imagem4 e36a2988-6838-4532-91db-83ea6d1ac688-image.png
          nota¹: tentei com o ip local do mailcow também.

          Quando tentei o DNS Split pelo Pfsense, fiz assim em Services>DNS Resolver>Host Overrides:
          imagem5 4bc34682-c76b-4cef-af81-7ec1c2683660-image.png
          nota¹: também foi feito com o endereço local do mailcow e não funcionou.
          nota²: certifiquei-me de apontar tudo para utilizar o endereço ip do firewall como dns.
          nota³: fiz semelhante no Services>DNS Forwarder e também não funcionou.

          EN_US:
          I also tried disabling Block private networks, which also didn't work (I believe that disabling this option only makes sense in cases where the WAN interface receives a local IP instead of a public one, which is the case here)
          image¹

          In case anyone is wondering: My pihole is currently configured like this
          image²

          When I tried DNS Split through pihole, I did it like this in Local DNS Records [A/AAAA]:
          image³
          note¹: this local IP refers to the machine that contains NPM.
          note²: I also tried with the local IP of mailcow itself (10.0.50.15)
          The same was also done in Local CNAME Records:
          image4
          note¹: I tried with the local IP of mailcow as well.

          When I tried Split DNS through Pfsense, I did it like this in Services>DNS Resolver>Host Overrides:
          image5
          note¹: it was also done with the local mailcow address and it didn't work.
          note²: I made sure to point everything to use the firewall's IP address as DNS.
          note³: I did the same in Services>DNS Forwarder and it didn't work either.

          1 Reply Last reply Reply Quote 0
          • R
            rootsys
            last edited by

            PT_BR:
            Hoje (Exatamente agora para ser mais especifico), consegui resolver o problema que me assombrou por longos 8 meses, e vim compartilhar com vocês o que resolveu:

            imagem¹ 6b030714-f352-433c-8bbe-f5f714c7081c-image.png
            Criei 2 regras de NAT Port Forward escutando na interface PPPoE Server e simplesmente funcionou (era tão simples T-T).

            Me sinto tão burro...

            EN_US:
            Today (Right now to be more specific), I managed to solve the problem that haunted me for 8 long months, and I came to share with you what solved it:

            image¹

            I created 2 NAT Port Forward rules listening on the PPPoE Server interface and it simply worked (it was so simple T-T).

            I feel so dumb...

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