Last active
March 28, 2019 02:06
-
-
Save jaykepeters/71d61de7ebace1e7e1d35e57a0ad338c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plain OLD | |
iptables -t nat -A PREROUTING -s IP -p udp --dport 53 -j REDIRECT --to-port 5300 | |
ptables -t nat -A PREROUTING -s IP -p tdp --dport 53 -j REDIRECT --to-port 5300 | |
# IP Based DNS Redirection | |
ipset -N restricted nethash | |
iptables -t nat -A PREROUTING -m set --match-set restricted src -p udp --dport 53 -j REDIRECT --to-port 5300 | |
iptables -t nat -A PREROUTING -m set --match-set restricted src -p tcp --dport 53 -j REDIRECT --to-port 5300 | |
ipset -A restricted IP | |
# TRY 2 | |
iptables -t nat -A PREROUTING -m set--match-set restricted src -p udp --dport 53 -j DNAT --to 192.168.1.4:5300 | |
iptables -t nat -A PREROUTING -m set--match-set restricted src -p tcp --dport 53 -j DNAT --to 192.168.1.4:5300 | |
# Mac Based DNS Redirection | |
TBD | |
# Listing and removing PREROUTING table Rules | |
https://www.svennd.be/remove-iptables-prerouting-nat-rule/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment