
ipt_create_chain pre_inet_bridge raw
ipt_create_chain out_inet_bridge raw

if [ "$MODE" != "start" ]; then
	ipt -t raw -F pre_inet_bridge
	ipt -t raw -F out_inet_bridge
fi

ipt -t raw -A pre_inet -j pre_inet_bridge
ipt -t raw -A out_inet -j out_inet_bridge

for ip4_tmp in $if_inet_ips4; do
	ipt4 -t raw -A pre_inet_bridge -d $ip4_tmp -j RETURN
	ipt4 -t raw -A out_inet_bridge -s $ip4_tmp -j RETURN
done

for ip6_tmp in $if_inet_ips6; do
	ipt6 -t raw -A pre_inet_bridge -d $ip6_tmp -j RETURN
	ipt6 -t raw -A out_inet_bridge -s $ip6_tmp -j RETURN
done

# all other (bridged) traffic shouldn't be tracked
ipt -t raw -A pre_inet_bridge -j NOTRACK
ipt -t raw -A out_inet_bridge -j NOTRACK
