How to allow access to a localhost tcp port to one specific external IP address?
![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
0
down vote
favorite
Say we have a reddis server on localhost
. We need to connect it from some other IPs. We know public IP of a node that we want to connect to our localhost
port
and have sudo
. How to allow access to a localhost tcp port to one specific external IP address? And how to disable that access when we want?
networking server proxy
add a comment |Â
up vote
0
down vote
favorite
Say we have a reddis server on localhost
. We need to connect it from some other IPs. We know public IP of a node that we want to connect to our localhost
port
and have sudo
. How to allow access to a localhost tcp port to one specific external IP address? And how to disable that access when we want?
networking server proxy
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Say we have a reddis server on localhost
. We need to connect it from some other IPs. We know public IP of a node that we want to connect to our localhost
port
and have sudo
. How to allow access to a localhost tcp port to one specific external IP address? And how to disable that access when we want?
networking server proxy
Say we have a reddis server on localhost
. We need to connect it from some other IPs. We know public IP of a node that we want to connect to our localhost
port
and have sudo
. How to allow access to a localhost tcp port to one specific external IP address? And how to disable that access when we want?
networking server proxy
networking server proxy
asked Feb 7 at 20:07
Blender
513
513
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
ufw
can be used for this.
sudo ufw default deny incoming
sudo ufw allow from 192.168.1.10 to any port 80
sudo ufw enable
will deny all traffic unless allowed, and then add a rule to allow traffic from 192.168.1.10 to port 80 on local machine. Note that this will block new ssh connections, unless you do a
sudo ufw allow ssh
which will open port 22 for incoming from any address.
man ufw
in a terminal will bring up the manual page, describing all available options.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
ufw
can be used for this.
sudo ufw default deny incoming
sudo ufw allow from 192.168.1.10 to any port 80
sudo ufw enable
will deny all traffic unless allowed, and then add a rule to allow traffic from 192.168.1.10 to port 80 on local machine. Note that this will block new ssh connections, unless you do a
sudo ufw allow ssh
which will open port 22 for incoming from any address.
man ufw
in a terminal will bring up the manual page, describing all available options.
add a comment |Â
up vote
0
down vote
ufw
can be used for this.
sudo ufw default deny incoming
sudo ufw allow from 192.168.1.10 to any port 80
sudo ufw enable
will deny all traffic unless allowed, and then add a rule to allow traffic from 192.168.1.10 to port 80 on local machine. Note that this will block new ssh connections, unless you do a
sudo ufw allow ssh
which will open port 22 for incoming from any address.
man ufw
in a terminal will bring up the manual page, describing all available options.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
ufw
can be used for this.
sudo ufw default deny incoming
sudo ufw allow from 192.168.1.10 to any port 80
sudo ufw enable
will deny all traffic unless allowed, and then add a rule to allow traffic from 192.168.1.10 to port 80 on local machine. Note that this will block new ssh connections, unless you do a
sudo ufw allow ssh
which will open port 22 for incoming from any address.
man ufw
in a terminal will bring up the manual page, describing all available options.
ufw
can be used for this.
sudo ufw default deny incoming
sudo ufw allow from 192.168.1.10 to any port 80
sudo ufw enable
will deny all traffic unless allowed, and then add a rule to allow traffic from 192.168.1.10 to port 80 on local machine. Note that this will block new ssh connections, unless you do a
sudo ufw allow ssh
which will open port 22 for incoming from any address.
man ufw
in a terminal will bring up the manual page, describing all available options.
answered Feb 7 at 20:25
![](https://i.stack.imgur.com/AKwUL.png?s=32&g=1)
![](https://i.stack.imgur.com/AKwUL.png?s=32&g=1)
vidarlo
7,25642140
7,25642140
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%2f1004001%2fhow-to-allow-access-to-a-localhost-tcp-port-to-one-specific-external-ip-address%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