Skip to content

Exclude traffic for host in iptables tproxy rule? #564

Answered by Klaaktu
Klaaktu asked this question in Q&A
Discussion options

You must be logged in to vote

iptables -t mangle -A PREROUTING -p {tcp | udp} -m addrtype ! --dst-type LOCAL,BROADCAST -m mac --mac-source <mac_address> -j TPROXY --on-port 60080 --tproxy-mark 0x1

BROADCAST for excluding DHCPv4
OpenWrt needs kmod-ipt-tproxy, iptables-tproxy, iptables-mod-extra
Nintendo Switch doesn't seem to have IPv6 (no config, no show address, no link local correspond to mac) so didn't try ip6tables.

In addition, for OpenWrt, ip stuff is best put into /etc/config/network

config route
	option interface 'loopback'
	option target '0.0.0.0'
	option netmask '0.0.0.0'
	option type 'local'
	option table '100'

config rule
	option mark '0x1'
	option lookup '100'

Now I just need to figure out why sslocal i…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@zonyitoo
Comment options

@Klaaktu
Comment options

@zonyitoo
Comment options

@Klaaktu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Klaaktu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants