I'm using Ubuntu 11.10. And I want to know something about firewall in Ubuntu, because I want to know if it could be the reason why my application doesn't work properly.
Little background:
I'have programmed client-server application, where Server is in C and client in java, when I run it from Eclipse Indigo (programing editor & environment) it works fine, but when I compile and run the klient in terminal, the communication doesn't work. The server doen't even recognize that the klient try to connect to the server. (using tcp sockets). Somebody said me that firewall could cause these problems, so my question should be probably What effect have firewall to applications and network communication??? (I run all on localhost 127.0.0.1 and port 10000).
It could be little complex question, so I'll try to more spiecify it with few little questions connected to my research and effort to find the source of problem.
This is what I've get when I put in terminal iptables -L:
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
1) I look at ubuntu wiki and I suppose there should be some rules, so I suppose that the firewall is not configured and it's off. Question: Am I right?
2) If is the firewall off or not configured could it have affect to network communication on my computer? (According the backgroud info)
3) If is the firewall on or bad configured can I do something to set up it correctly or swich off?
4)If I do something from no. 3 will it have bad impact to my security (virus protection on internet)?
NOTE: I have few theoretical info about linux, newtorking, firewalls, but I don't have many experiences with linux configuration and practical using these things.
I'm assuming that your server (which is also your client in this case) is behind a NAT router from the internet. If this is the case, a firewall on linux is not strictly needed. (There will be tin-foil hatters out there that say everything needs a well configured firewall.)
The output you have shows that there are no rules in effect and so the default is to let everything pass. So the problem likely exists elsewhere. Start by running your server program and then running
and looking for the name of your program or the port 10000. If you don't find it on the list, then your program did not manage to bind a socket to a port. In that case, you need to do more error checking in your C code. If you do see your program, then look into a program called wireshark. Running wireshark while you run the client will allow you to see if your client is sending packets correctly. A filter like
(tcp.port == 10000)
should yield at least half of the conversation, depending on how your server works.The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall.
ufw by default is initially disabled. From the ufw man page:
“ ufw is not intended to provide complete firewall functionality via its command interface, but instead provides an easy way to add or remove simple rules. It is currently mainly used for host-based firewalls. ” The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall.
ufw by default is initially disabled. From the ufw man page:
“ ufw is not intended to provide complete firewall functionality via its command interface, but instead provides an easy way to add or remove simple rules. It is currently mainly used for host-based firewalls. ”