Allow ufw rule to curl localhost for a specific port

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to allow curl -if localhost:54321 only with ufw. What rule can I apply from the command line?
I have tried ufw allow proto tcp from any to any port 54321 and ufw status shows the following:
To Action From
-- ------ ----
54321/tcp ALLOW Anywhere
54321/tcp (v6) ALLOW Anywhere (v6)
But still I'm unable to curl -if localhost:54321.
ufw
add a comment |Â
up vote
0
down vote
favorite
I want to allow curl -if localhost:54321 only with ufw. What rule can I apply from the command line?
I have tried ufw allow proto tcp from any to any port 54321 and ufw status shows the following:
To Action From
-- ------ ----
54321/tcp ALLOW Anywhere
54321/tcp (v6) ALLOW Anywhere (v6)
But still I'm unable to curl -if localhost:54321.
ufw
2
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to allow curl -if localhost:54321 only with ufw. What rule can I apply from the command line?
I have tried ufw allow proto tcp from any to any port 54321 and ufw status shows the following:
To Action From
-- ------ ----
54321/tcp ALLOW Anywhere
54321/tcp (v6) ALLOW Anywhere (v6)
But still I'm unable to curl -if localhost:54321.
ufw
I want to allow curl -if localhost:54321 only with ufw. What rule can I apply from the command line?
I have tried ufw allow proto tcp from any to any port 54321 and ufw status shows the following:
To Action From
-- ------ ----
54321/tcp ALLOW Anywhere
54321/tcp (v6) ALLOW Anywhere (v6)
But still I'm unable to curl -if localhost:54321.
ufw
edited Oct 31 '17 at 3:30
asked Oct 30 '17 at 8:54
Sayanee
1316
1316
2
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31
add a comment |Â
2
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31
2
2
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
From man ufw:
Allow access to udp 1.2.3.4 port 5469 from 1.2.3.5 port 5469:
ufw allow proto udp from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Hence the command you're looking for is
ufw allow proto tcp from <ip_source> to <ip_destination> port 54321
add a comment |Â
up vote
0
down vote
Got it:
ufw allow proto tcp from any to any port 54321,54322
ufw allow out proto tcp from any to any port 54321,54322
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
From man ufw:
Allow access to udp 1.2.3.4 port 5469 from 1.2.3.5 port 5469:
ufw allow proto udp from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Hence the command you're looking for is
ufw allow proto tcp from <ip_source> to <ip_destination> port 54321
add a comment |Â
up vote
0
down vote
From man ufw:
Allow access to udp 1.2.3.4 port 5469 from 1.2.3.5 port 5469:
ufw allow proto udp from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Hence the command you're looking for is
ufw allow proto tcp from <ip_source> to <ip_destination> port 54321
add a comment |Â
up vote
0
down vote
up vote
0
down vote
From man ufw:
Allow access to udp 1.2.3.4 port 5469 from 1.2.3.5 port 5469:
ufw allow proto udp from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Hence the command you're looking for is
ufw allow proto tcp from <ip_source> to <ip_destination> port 54321
From man ufw:
Allow access to udp 1.2.3.4 port 5469 from 1.2.3.5 port 5469:
ufw allow proto udp from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
Hence the command you're looking for is
ufw allow proto tcp from <ip_source> to <ip_destination> port 54321
answered Oct 30 '17 at 12:45
dr01
15.3k114769
15.3k114769
add a comment |Â
add a comment |Â
up vote
0
down vote
Got it:
ufw allow proto tcp from any to any port 54321,54322
ufw allow out proto tcp from any to any port 54321,54322
add a comment |Â
up vote
0
down vote
Got it:
ufw allow proto tcp from any to any port 54321,54322
ufw allow out proto tcp from any to any port 54321,54322
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Got it:
ufw allow proto tcp from any to any port 54321,54322
ufw allow out proto tcp from any to any port 54321,54322
Got it:
ufw allow proto tcp from any to any port 54321,54322
ufw allow out proto tcp from any to any port 54321,54322
answered Oct 31 '17 at 7:45
Sayanee
1316
1316
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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%2funix.stackexchange.com%2fquestions%2f401368%2fallow-ufw-rule-to-curl-localhost-for-a-specific-port%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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');
);
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');
);
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
2
There's a pretty clear example on the ufw man page that allows tcp connections from an IP to a port. Did you try that one?
â Zip
Oct 30 '17 at 10:31