Redirect traffic towards one IP to another IP
Posted: Wed May 22, 2019 10:14 am
Situation:-
Gateway router IP: 192.168.88.1
raspberrry pi (pi-hole): 192.168.88.20
Offending device IP: 192.168.88.30
My DHCP server has been set to give out addresses via static addressing, with the DNS server being 192.168.88.20.
But a wayward device (the 192.168.88.30) has its DNS hardcoded to Google DNS 8.8.8.8 and 8.8.4.4.
Therefore, if I want to redirect all the 192.168.88.30's attempts to access 8.8.8.8/8.8.4.4. to my pi-hole server 192.168.88.20, all I have to do is to create the NAT entries as shown below?
Gateway router IP: 192.168.88.1
raspberrry pi (pi-hole): 192.168.88.20
Offending device IP: 192.168.88.30
My DHCP server has been set to give out addresses via static addressing, with the DNS server being 192.168.88.20.
But a wayward device (the 192.168.88.30) has its DNS hardcoded to Google DNS 8.8.8.8 and 8.8.4.4.
Therefore, if I want to redirect all the 192.168.88.30's attempts to access 8.8.8.8/8.8.4.4. to my pi-hole server 192.168.88.20, all I have to do is to create the NAT entries as shown below?
Code: Select all
5 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=53 protocol=udp dst-address=8.8.8.8
dst-port=53 log=no log-prefix=""
6 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=53 protocol=tcp dst-address=8.8.8.8
dst-port=53 log=no log-prefix=""
7 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=53 protocol=udp dst-address=8.8.4.4
dst-port=53 log=no log-prefix=""
8 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=53 protocol=tcp dst-address=8.8.4.4
dst-port=53 log=no log-prefix=""