• Apparati e reti
  • Non posso connettermi con IP pubblico quando sono connesso alla rete locale

Come da titolo non riesco a connettermi alla mia rete locale con l'IP pubblico quando sono connesso alla rete locale stessa, mentre se sono connesso a una rete diversa accedo tranquillamente.

Non ho un IP fisso quindi tutte le prove le ho eseguite (oltre che con l'IP attuale anche con un DNS dinamico, ma il risultato non cambia).

Nella sostanza il problema si verifica usando un'app che accede a un server per la domotica.
Ho due possibilità di settaggio:
1) indicare l'IP locale del server nella rete (in questo caso accedo al server se collegato al wifi locale e ovviamente non ci accedo se sono collegato ad un'altra rete)

2) indicare l'IP fisso o un dns dinamico e aprire due porte nel router (in questo caso riesco ad accedere se collegato con la rete dati o ad un altro wifi, ma non da dentro la rete)

Ho un router dlink DVA-9952 senza aver fatto altri settaggi particolari, se non aver inserito i dns google al posto di quelli fastweb...

Grazie a chiunque potrà essermi d'aiuto

    Hybrego sei il tuo ISP è Fastweb, Fastweb non fornisce ip pubblici di default, ma solo su richiesta.
    Quindi il tuo problema si risolve facedone richiesta, tieni conto che ti verrà fornito un ip statico.

    Anche se la soluzione migliore sarebbe non esporre la domotica direttamente su internet, ma dietro una VPN, così da ridurre drasticamente eventuali problemi di sicurezza

    • Hybrego ha risposto a questo messaggio

      handymenny
      Ma io da fuori della rete mi connetto senza problemi, non è un problema di IP pubblico (mi sono sbagliato, non ho fastweb, che era il vecchio gestore, ma wind). Ho già attivo un servizio di dns dinamico per quello al posto del ip pubblico.

      Il problema è solo quando mi connetto da dentro alla mia stessa rete.

        Hybrego ah, scusa. Allora il problema forse dipende dal firewall del tuo router che fa confusione, prova a disattivarlo temporaneamente

        Appena sono a casa provo a vedere se c'è un firewall.

        Cercando il problema, ma capendone poco, avevo visto che in situazioni analoghe parlavano di NAT reflection.
        In particolare questo post (anche se in inglese).

        If you have a server sat inside your LAN and you want to connect to it via www.server.com you've probably got your DNS outside your LAN containing that record and referring to your WAN IP, whilst doing port-forwarding of ports 80 and 443 to the server's LAN IP.

        That's all fine and dandy until you want to connect to www.server.com from inside your LAN. Your PC will look up that address and come up with the WAN IP's address, and the traffic route from your PC (when on the LAN) to that address will essentially send it out to your WAN through the default route. The thing is there's no U-turns on that traffic so your PC can't connect to it.

        There are 2 ways to fix this scenario. The first is running split DNS, where the DNS you're served whilst inside the LAN has different IPs than the DNS you're served from outside the LAN.

        The second is NAT Reflection, which means that any request for a service from within the LAN that refers to the WAN IP is then processed by pfsense and sent back into the LAN as though your traffic was coming from the WAN.

          Hybrego The second is NAT Reflection, which means that any request for a service from within the LAN that refers to the WAN IP is then processed by pfsense and sent back into the LAN as though your traffic was coming from the WAN.

          Questo è quello che molti router fanno in automatico, ma sembra che il tuo non lo faccia o abbia problemi a farlo.

          Hybrego The first is running split DNS, where the DNS you're served whilst inside the LAN has different IPs than the DNS you're served from outside the LAN.

          Questa è una buona soluzione, non so se il dlink consente l'aggiunta di domini al suo file host (lo zyxel lo consente da gui), in caso non lo consenta ti serve un server dns locale diverso da far girare magari su un raspberry

            handymenny Sì ho scoperto che è un bug conosciuto del mio router (DVA-9952).
            😐

            Grazie dei consigli

            Informativa privacy - Informativa cookie - Termini e condizioni - Regolamento - Disclaimer - 🏳️‍🌈
            P.I. IT16712091004 - info@fibraclick.it

            ♻️ Il server di questo sito è alimentato al 100% con energia rinnovabile