Iptables blocking access to DNS server
 

Iptables blocking access to DNS server

 

hi, i hv setup a OpenVPN with Pihole on a Raspberry pi running Ubuntu 20.04 64bit on my LAN. Everything works perfectly – i can connect to the vpn and pihole does it job filtering ads. i could even manually point other pc’s DNS to the Raspberry IP address to use its Pihole ad blocking. Until i apply the iptables below: Then i could no longer use the Pihole if im not connected to the vpn. I try adding POSTROUTING from 192.168.1.13 to 10.8.0.1 but it hangs. Luckily could access to the Raspberry after cycle the power. Please advice on how we could use the Pihole’s DNS even if we are not connected to the vpn. Raspberry Pi : 192.168.1.13 OpenVPN TUN: 10.8.0.1 Thank you. Code: # Generated by iptables-save v1.8.4 on Thu Jul 16 13:32:36 2020 *mangle :PREROUTING ACCEPT [142:12092] :INPUT ACCEPT [142:12092] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [113:16556] :POSTROUTING ACCEPT [113:16556] COMMIT # Completed on Thu Jul 16 13:32:36 2020 # Generated by iptables-save v1.8.4 on Thu Jul 16 13:32:36 2020 *nat :PREROUTING ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT –to-source 192.168.1.13 COMMIT # Completed on Thu Jul 16 13:32:36 2020 # Generated by iptables-save v1.8.4 on Thu Jul 16 13:32:36 2020 *filter :INPUT DROP [3:108] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [113:16556] -A INPUT -i lo -j ACCEPT -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp –tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP -A INPUT -p tcp -m tcp ! –tcp-flags FIN,SYN,RST,ACK SYN -m state –state NEW -j DROP -A INPUT -p tcp -m tcp –tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP -A INPUT -i tun0 -p tcp -m tcp –dport 53 -j ACCEPT -A INPUT -i tun0 -p udp -m udp –dport…

 

Previous link folders to other partition
Next (Browser: Brave) backup
 

About author

You might also like

Ubuntu Dsicussions 0 Comments

Review app – Vintage camera: Vintage photo filters & effects

The best vintage camera app to create stunning vintage photos by vintage filters Vintage camera will give you the best tools for editing vintage photos. It’s simple and easy to

Ubuntu Dsicussions 0 Comments

[lubuntu] Lubuntu 20.04 System Requirements

Couldn’t find this anywhere on the release page for Lubuntu 20.04. I plan to have 2 partitions: / and /home Will 20GB HDD be enough for / (root) ? Thanks

Ubuntu Dsicussions 0 Comments

[ubuntu] Upgrade 16.04 to 18.04.5 LTS on a dual boot machine with Windows

I currently have a dual-boot machine: one partition on Windows 10 and the other on Ubuntu 16.04 (64 bit). I would like to upgrade to 18.04.5 LTS: 1. Will the

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply