Page 1 of 1

How to allow a port listening on a firewall?

Posted: Tue Apr 04, 2017 5:17 pm
by Lord
Hi

I am trying to setup tcp server on raspberry pi 2.
"Rasbian Jessie with Pixel" os version installed on the device.

How to allow a port listening with "Raspberry Pi 2" on a firewall?
How to configure the firewall?

Thank you

Re: How to allow a port listening on a firewall?

Posted: Tue Apr 04, 2017 5:29 pm
by drgeoff
Where is the firewall?

AFAIK Raspbian Jessie default installation and configuration has no firewall running.

If the firewall is your router's NAT, you need to consult the router's documentation. Usually you want to forward ports 80 and 443 to make a web server accessible from the WAN.

Be sure you understand the security implications.

Re: How to allow a port listening on a firewall?

Posted: Tue Apr 04, 2017 5:48 pm
by Lord
I know that the firewall does not come installed. How can I install?

Port has introduced on the router and its running now.

If ServerApp run on the Windows, all systems work because I configured this port on firewall but if ServerApp move from Windows to Raspberry, systems doesn't work on over internet connection. I am trying to solve this problem.

Re: How to allow a port listening on a firewall?

Posted: Wed Apr 05, 2017 12:29 pm
by Lord
+Up

Does nobody know?

Re: How to allow a port listening on a firewall?

Posted: Wed Apr 05, 2017 1:39 pm
by allfox
I think by default, the firewall is already installed, namely the iptables, but by default, it would accept everything. It is exist, but not functioning as a firewall.

I think you should try connect to your App in LAN to make sure it does work.

sudo netstat -lnp would tell you what program is listening to network right now.

Re: How to allow a port listening on a firewall?

Posted: Wed Apr 05, 2017 1:49 pm
by Ernst
Lord wrote:I know that the firewall does not come installed. How can I install?

Port has introduced on the router and its running now.

If ServerApp run on the Windows, all systems work because I configured this port on firewall but if ServerApp move from Windows to Raspberry, systems doesn't work on over internet connection. I am trying to solve this problem.
What are you trying to do ? Are you trying to connect from the internet through a router to a Raspberry ?
If yes: did you update the configuration on the router ?

Re: How to allow a port listening on a firewall?

Posted: Wed Apr 05, 2017 2:40 pm
by Lord
allfox wrote:I think by default, the firewall is already installed, namely the iptables, but by default, it would accept everything. It is exist, but not functioning as a firewall.

I think you should try connect to your App in LAN to make sure it does work.

sudo netstat -lnp would tell you what program is listening to network right now.
I used your code.
I saw my "PORT" that LISTENed by JAVA. (tcp6)

Re: How to allow a port listening on a firewall?

Posted: Wed Apr 05, 2017 3:02 pm
by allfox
As you said tcp6, if it's not working, then it worth a try to initialize the ServerSocket object with the bind address "0.0.0.0". This should force things run on IPv4. I havn't write Java for years, so just give it a try.

While to my understanding, listening on IPv6 address "::" should handle IPv4 connection either, as those IPv4 connection would get a IPv6 mapping address. However in real would, I did witness Apps which only work with IPv4.