UFW blocking upnp port mapping
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
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'?
16.04 networking server ufw upnp
add a comment |Â
up vote
1
down vote
favorite
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'?
16.04 networking server ufw upnp
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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'?
16.04 networking server ufw upnp
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'?
16.04 networking server ufw upnp
asked Apr 26 at 23:41
aaa
62
62
add a comment |Â
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
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!
answered May 3 at 16:56
user822833
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password