Score:1

how to open specific tcp port on ubuntu

sj flag

I am on Ubuntu 18.04, I am trying to run python -m http.server 8080 and everything works, I can connect to the server from other computers but if I change the port to: python -m http.server 8501 I cannot connect to the server...

I tried disable ufw by sudo ufw disable to allow port 8501, does not work I tried the netstat and it says the system is listen on 0.0.0.0:8501 I tried iptables didn't find anything suspicious...

7    ACCEPT     udp  --  anywhere             anywhere             udp spt:8501
8    ACCEPT     udp  --  anywhere             anywhere             udp dpt:8501
9    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8501
10   ACCEPT     tcp  --  anywhere             anywhere             tcp spt:8501

I was able to curl 127.0.0.1:8501 locally.

any particular setting that disallow this port to be accessible to external??

waltinator avatar
it flag
Did you restart your `http.server` after making these changes? Some settings are only recognized at server start. "... tried ufw. ... did not work" - details, please.
sj flag
yeah, tried everything, restarted the server too
sj flag
could it be that my company's internal network configuration disabled the port sharing for any traffic using the port? I just dont know if technically that is possible
waltinator avatar
it flag
Trying to violate your company's Security Policy (by getting around their TCP/IP Port rules) could get you fired, security clearance revoked, future job prospects reduced. Become aware of your company's Security Policy and don't violate it.
sj flag
It could be that my company's intranet disables the port within the LAN. Although I cannot confirm this easily but if technically possible this could be the reason. I am not trying to violate the company's security policy, if not working i will stop.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.