I am little confused with Netfilter marks and iptables CONNMARK. Please help clear the understanding.
example:
iptables -t mangle -A mychain -j CONNMARK --restore-mark --mask 0xff
iptables -t mangle -A mychain -m connmark !--mark 0/0xff00 -j RETURN
The first one is CONNMARK target is trying to restore the "mark" made by what? Is it connection tracking? But markings are not done at ip_conntrack is it? packet marking is done at the iptables - right? I am confused
Also, the second one in the rule, it is trying to match a mark if it is non-zero and if there is a match it returns? Please help untangle my misunderstanding.