How to check if port is open and unused?
up vote
0
down vote
favorite
I am currently at my uni and connected to uni's network. I set up a server on my PC but noone can connect from outside uni network because ports are blocked, however I have access to one of uni's servers with linux and I think I could make vpn server there and connect from my pc to uni's server and people would connect in this order Internet -> VPN on my uni's server -> My PC but the thing is that I don't know which port is open and unused so I could use it as port for the vpn and the server. How can I check which port is open for sure and if it is unused? Is it possible that this solution will work and people would connect to me like this?
networking vpn port-forwarding
add a comment |
up vote
0
down vote
favorite
I am currently at my uni and connected to uni's network. I set up a server on my PC but noone can connect from outside uni network because ports are blocked, however I have access to one of uni's servers with linux and I think I could make vpn server there and connect from my pc to uni's server and people would connect in this order Internet -> VPN on my uni's server -> My PC but the thing is that I don't know which port is open and unused so I could use it as port for the vpn and the server. How can I check which port is open for sure and if it is unused? Is it possible that this solution will work and people would connect to me like this?
networking vpn port-forwarding
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am currently at my uni and connected to uni's network. I set up a server on my PC but noone can connect from outside uni network because ports are blocked, however I have access to one of uni's servers with linux and I think I could make vpn server there and connect from my pc to uni's server and people would connect in this order Internet -> VPN on my uni's server -> My PC but the thing is that I don't know which port is open and unused so I could use it as port for the vpn and the server. How can I check which port is open for sure and if it is unused? Is it possible that this solution will work and people would connect to me like this?
networking vpn port-forwarding
I am currently at my uni and connected to uni's network. I set up a server on my PC but noone can connect from outside uni network because ports are blocked, however I have access to one of uni's servers with linux and I think I could make vpn server there and connect from my pc to uni's server and people would connect in this order Internet -> VPN on my uni's server -> My PC but the thing is that I don't know which port is open and unused so I could use it as port for the vpn and the server. How can I check which port is open for sure and if it is unused? Is it possible that this solution will work and people would connect to me like this?
networking vpn port-forwarding
networking vpn port-forwarding
asked Dec 1 at 23:26
Arek Żyłkowski
41
41
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30
add a comment |
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
netstat -l
Will list ports in use if you have permissions to check.
Trying is the only way to see if a port is open (not being blocked by a firewall etc), one of the many ways to try is;
nc -l $IP $PORT > test.tmp
it will wait for a connection, so then in a different terminal/screen/tmux do
echo test | nc -q 0 $IP $PORT
from outside the network.... nmap is commonly used for port scanning but unless you want to test all ports is not going to help much in this case (and you would need a service binding to all ports first).
nc -l $IP $PORT > test.tmpdoesn't work or I don't know how to use it properly
– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
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
netstat -l
Will list ports in use if you have permissions to check.
Trying is the only way to see if a port is open (not being blocked by a firewall etc), one of the many ways to try is;
nc -l $IP $PORT > test.tmp
it will wait for a connection, so then in a different terminal/screen/tmux do
echo test | nc -q 0 $IP $PORT
from outside the network.... nmap is commonly used for port scanning but unless you want to test all ports is not going to help much in this case (and you would need a service binding to all ports first).
nc -l $IP $PORT > test.tmpdoesn't work or I don't know how to use it properly
– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
add a comment |
up vote
1
down vote
netstat -l
Will list ports in use if you have permissions to check.
Trying is the only way to see if a port is open (not being blocked by a firewall etc), one of the many ways to try is;
nc -l $IP $PORT > test.tmp
it will wait for a connection, so then in a different terminal/screen/tmux do
echo test | nc -q 0 $IP $PORT
from outside the network.... nmap is commonly used for port scanning but unless you want to test all ports is not going to help much in this case (and you would need a service binding to all ports first).
nc -l $IP $PORT > test.tmpdoesn't work or I don't know how to use it properly
– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
add a comment |
up vote
1
down vote
up vote
1
down vote
netstat -l
Will list ports in use if you have permissions to check.
Trying is the only way to see if a port is open (not being blocked by a firewall etc), one of the many ways to try is;
nc -l $IP $PORT > test.tmp
it will wait for a connection, so then in a different terminal/screen/tmux do
echo test | nc -q 0 $IP $PORT
from outside the network.... nmap is commonly used for port scanning but unless you want to test all ports is not going to help much in this case (and you would need a service binding to all ports first).
netstat -l
Will list ports in use if you have permissions to check.
Trying is the only way to see if a port is open (not being blocked by a firewall etc), one of the many ways to try is;
nc -l $IP $PORT > test.tmp
it will wait for a connection, so then in a different terminal/screen/tmux do
echo test | nc -q 0 $IP $PORT
from outside the network.... nmap is commonly used for port scanning but unless you want to test all ports is not going to help much in this case (and you would need a service binding to all ports first).
edited Dec 2 at 16:07
answered Dec 1 at 23:50
user1133275
2,780515
2,780515
nc -l $IP $PORT > test.tmpdoesn't work or I don't know how to use it properly
– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
add a comment |
nc -l $IP $PORT > test.tmpdoesn't work or I don't know how to use it properly
– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
nc -l $IP $PORT > test.tmp doesn't work or I don't know how to use it properly– Arek Żyłkowski
Dec 2 at 13:34
nc -l $IP $PORT > test.tmp doesn't work or I don't know how to use it properly– Arek Żyłkowski
Dec 2 at 13:34
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
Did you read the manual?; linux.die.net/man/1/nc . "doesn't work" is ambiguous what did you expect to happen vs what actually happened?
– user1133275
Dec 2 at 16:05
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485409%2fhow-to-check-if-port-is-open-and-unused%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If a port is open, then it is by definition in-use (only ports which have a program bound to them are open). I have a feeling what you meant to ask is how to check if a port is unfiltered and unused, because it sounds like the important part here is that your firewall is not blocking the port and no program is using it.
– Austin Hemmelgarn
Dec 3 at 20:30