Answer the question
In order to leave comments, you need to log in
How to whitelist mac addresses in ipchain?
Preamble
There is a "family" Yandex-dns, for which a second dnsmasq instance is running on the router and ipchains rules are configured that transparently proxy all connections from these hosts anywhere to the 53rd port of this dnsmasq instance.
These rules are written through uci, and in real ipchains they look like more or less like this:
iptables -t nat -A zone_lan_prerouting -p udp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source XX:XX:XX:XX:XX:XX -m comment --comment family-yandex-dns -j DNAT --to-destination 192.168.1.5:65053
iptables -t nat -A zone_lan_prerouting -p tcp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source XX:XX:XX:XX:XX:XX -m comment --comment family-yandex-dns -j DNAT --to-destination 192.168.1.5:65053
Answer the question
In order to leave comments, you need to log in
Let the poppies of the white hosts be 11:11:11:11:11:11 and 22:22:22:22:22:22, then:
iptables -t nat -A zone_lan_prerouting -p udp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source 11:11:11:11:11:11 -j ACCEPT
iptables -t nat -A zone_lan_prerouting -p tcp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source 11:11:11:11:11:11 -j ACCEPT
iptables -t nat -A zone_lan_prerouting -p udp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source 22:22:22:22:22:22 -j ACCEPT
iptables -t nat -A zone_lan_prerouting -p tcp -m id --id 0x66773300 -m udp --dport 53 -m mac --mac-source 22:22:22:22:22:22 -j ACCEPT
iptables -t nat -A zone_lan_prerouting -p udp -m id --id 0x66773300 -m udp --dport 53 -m comment --comment family-yandex-dns -j DNAT --to-destination 192.168.1.5:65053
iptables -t nat -A zone_lan_prerouting -p tcp -m id --id 0x66773300 -m udp --dport 53 -m comment --comment family-yandex-dns -j DNAT --to-destination 192.168.1.5:65053
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question