I found the following code snippet in the bitcoin source tree which is defined as part of a bash script to control the outbound connections on port 8333. Can someone explain me the exact working of the commands.
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8333 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8333 ! -d ${LOCALNET} -j MARK --set-mark 0x2
Source file: https://github.com/bitcoin/bitcoin/blob/ad57b310bac44a7e470cf66276421f2bbc61b1f0/contrib/qos/tc.sh