UFW blocking upnp port mapping

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite
1












I'm attempting to use portmapper-2.1.1 (https://github.com/kaklakariada/portmapper) to get a upnp mapping to my ubuntu 16.04LTS machine.



I've got UFW configured to allow all outgoing and block incoming (aside from a few specific ports).



I thought this would work because I'm running portmapper on the ubuntu box (eg. outgoing), but isn't. I think this is due to the way upnp is setup to find clients. To be clear, with UFW disabled, portmapper works as expected.



My first thought was to just allow the port that the upnp service 'replies' on, but that seems to be random. Ex (from my UFW log):



Apr 26 19:07:34 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=41927 LEN=391



Apr 26 19:33:32 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=60212 LEN=391



(192.168.1.1 is my router, 192.168.1.161 is the ubuntu box)



I don't want to just open most/all ports to incoming udp packets for this, so the question is: Is there a UFW/iptables rule that will allow this to work that isn't just 'allow everything'?







share|improve this question
























    up vote
    1
    down vote

    favorite
    1












    I'm attempting to use portmapper-2.1.1 (https://github.com/kaklakariada/portmapper) to get a upnp mapping to my ubuntu 16.04LTS machine.



    I've got UFW configured to allow all outgoing and block incoming (aside from a few specific ports).



    I thought this would work because I'm running portmapper on the ubuntu box (eg. outgoing), but isn't. I think this is due to the way upnp is setup to find clients. To be clear, with UFW disabled, portmapper works as expected.



    My first thought was to just allow the port that the upnp service 'replies' on, but that seems to be random. Ex (from my UFW log):



    Apr 26 19:07:34 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=41927 LEN=391



    Apr 26 19:33:32 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=60212 LEN=391



    (192.168.1.1 is my router, 192.168.1.161 is the ubuntu box)



    I don't want to just open most/all ports to incoming udp packets for this, so the question is: Is there a UFW/iptables rule that will allow this to work that isn't just 'allow everything'?







    share|improve this question






















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I'm attempting to use portmapper-2.1.1 (https://github.com/kaklakariada/portmapper) to get a upnp mapping to my ubuntu 16.04LTS machine.



      I've got UFW configured to allow all outgoing and block incoming (aside from a few specific ports).



      I thought this would work because I'm running portmapper on the ubuntu box (eg. outgoing), but isn't. I think this is due to the way upnp is setup to find clients. To be clear, with UFW disabled, portmapper works as expected.



      My first thought was to just allow the port that the upnp service 'replies' on, but that seems to be random. Ex (from my UFW log):



      Apr 26 19:07:34 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=41927 LEN=391



      Apr 26 19:33:32 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=60212 LEN=391



      (192.168.1.1 is my router, 192.168.1.161 is the ubuntu box)



      I don't want to just open most/all ports to incoming udp packets for this, so the question is: Is there a UFW/iptables rule that will allow this to work that isn't just 'allow everything'?







      share|improve this question












      I'm attempting to use portmapper-2.1.1 (https://github.com/kaklakariada/portmapper) to get a upnp mapping to my ubuntu 16.04LTS machine.



      I've got UFW configured to allow all outgoing and block incoming (aside from a few specific ports).



      I thought this would work because I'm running portmapper on the ubuntu box (eg. outgoing), but isn't. I think this is due to the way upnp is setup to find clients. To be clear, with UFW disabled, portmapper works as expected.



      My first thought was to just allow the port that the upnp service 'replies' on, but that seems to be random. Ex (from my UFW log):



      Apr 26 19:07:34 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=41927 LEN=391



      Apr 26 19:33:32 [UFW BLOCK] IN=enp2s0 OUT= SRC=192.168.1.1 DST=192.168.1.161 LEN=411 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1900 DPT=60212 LEN=391



      (192.168.1.1 is my router, 192.168.1.161 is the ubuntu box)



      I don't want to just open most/all ports to incoming udp packets for this, so the question is: Is there a UFW/iptables rule that will allow this to work that isn't just 'allow everything'?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 26 at 23:41









      aaa

      62




      62




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          It looks like the packets you need to allow have these characteristics:



          • They are incoming on interface enp2s0

          • They have a source IP address of 192.168.1.1

          • They have a source UDP port of 1900

          So what you need is to allow all incoming UDP packets from 192.168.1.1 port 1900.



          Use this command to add the rule:



          sudo ufw allow from 192.168.1.1 port 1900 to any proto udp


          Check out the added rule:



          me@ubuntu:~$ sudo ufw status
          Status: active

          To Action From
          -- ------ ----
          Anywhere ALLOW 192.168.1.1 1900/udp


          Hope this helps!






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028570%2fufw-blocking-upnp-port-mapping%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            It looks like the packets you need to allow have these characteristics:



            • They are incoming on interface enp2s0

            • They have a source IP address of 192.168.1.1

            • They have a source UDP port of 1900

            So what you need is to allow all incoming UDP packets from 192.168.1.1 port 1900.



            Use this command to add the rule:



            sudo ufw allow from 192.168.1.1 port 1900 to any proto udp


            Check out the added rule:



            me@ubuntu:~$ sudo ufw status
            Status: active

            To Action From
            -- ------ ----
            Anywhere ALLOW 192.168.1.1 1900/udp


            Hope this helps!






            share|improve this answer
























              up vote
              1
              down vote













              It looks like the packets you need to allow have these characteristics:



              • They are incoming on interface enp2s0

              • They have a source IP address of 192.168.1.1

              • They have a source UDP port of 1900

              So what you need is to allow all incoming UDP packets from 192.168.1.1 port 1900.



              Use this command to add the rule:



              sudo ufw allow from 192.168.1.1 port 1900 to any proto udp


              Check out the added rule:



              me@ubuntu:~$ sudo ufw status
              Status: active

              To Action From
              -- ------ ----
              Anywhere ALLOW 192.168.1.1 1900/udp


              Hope this helps!






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                It looks like the packets you need to allow have these characteristics:



                • They are incoming on interface enp2s0

                • They have a source IP address of 192.168.1.1

                • They have a source UDP port of 1900

                So what you need is to allow all incoming UDP packets from 192.168.1.1 port 1900.



                Use this command to add the rule:



                sudo ufw allow from 192.168.1.1 port 1900 to any proto udp


                Check out the added rule:



                me@ubuntu:~$ sudo ufw status
                Status: active

                To Action From
                -- ------ ----
                Anywhere ALLOW 192.168.1.1 1900/udp


                Hope this helps!






                share|improve this answer












                It looks like the packets you need to allow have these characteristics:



                • They are incoming on interface enp2s0

                • They have a source IP address of 192.168.1.1

                • They have a source UDP port of 1900

                So what you need is to allow all incoming UDP packets from 192.168.1.1 port 1900.



                Use this command to add the rule:



                sudo ufw allow from 192.168.1.1 port 1900 to any proto udp


                Check out the added rule:



                me@ubuntu:~$ sudo ufw status
                Status: active

                To Action From
                -- ------ ----
                Anywhere ALLOW 192.168.1.1 1900/udp


                Hope this helps!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 3 at 16:56







                user822833


































                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028570%2fufw-blocking-upnp-port-mapping%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491