Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Chick on July 19, 2011, 09:51:59 AM



Title: Why is IPTABLES periodically blocking port 8333?
Post by: Chick on July 19, 2011, 09:51:59 AM
Hi, I have a simple question. I've disabled UPnP from bitcoin.conf. Here are my IPTABLE rules regarding port 8333:

Code:
-A INPUT -p tcp --dport 8333 -m state --state NEW -j ACCEPT

However, using netstat shows that there are tons of connections from other nodes onto my server from port 8333. Periodically, I see in the IPTABLES log that a few packets going to port 8333 are being rejected, why is this the case? I do allow ESTABLISHED and RELATED connection packets through.

Also, can anybody tell me why there are also other random ports that are showing as a destination on netstat? I thought Bitcoin only used port 8333 for connecting to other nodes and 8332 for the API.



Title: Re: Why is IPTABLES periodically blocking port 8333?
Post by: CERN on July 19, 2011, 01:21:06 PM
It could be that another rule preceding the one in question is rejecting or dropping connections. I'm afraid that it's impossible to give an answer about why it's happening without seeing your full iptables ruleset

As for the second question:

Quote from: Gavin Andresen
Bitcoin 0.3.24 adds a   -port=  option to listen on a port other than 8333 for incoming connections.

(a quote from this post (http://forum.bitcoin.org/index.php?topic=27699.0))

Along with upnp, etc...  The short answer is that your bitcoin client is likely connecting to peers that are just using a port other than 8333 :)


Title: Re: Why is IPTABLES periodically blocking port 8333?
Post by: Chick on July 20, 2011, 07:42:55 AM
It could be that another rule preceding the one in question is rejecting or dropping connections. I'm afraid that it's impossible to give an answer about why it's happening without seeing your full iptables ruleset

As for the second question:

Quote from: Gavin Andresen
Bitcoin 0.3.24 adds a   -port=  option to listen on a port other than 8333 for incoming connections.

(a quote from this post (http://forum.bitcoin.org/index.php?topic=27699.0))

Along with upnp, etc...  The short answer is that your bitcoin client is likely connecting to peers that are just using a port other than 8333 :)

Never mind that, I've solved it. The remote host basically couldn't complete the data transfer and issues a ACK/FIN tcp packet to close the connection, but my server drops and logs the request.

Thanks!