Help with firewall rules

40 views
Skip to first unread message

Chris

unread,
Apr 24, 2019, 8:44:15 AM4/24/19
to qubes...@googlegroups.com
Hello All,

I have installed PiHole in a standalone qubes and can use it to block adverts.

The problem I have is that I have to keep setting the following firewall rules for it to work!

===== BEGIN
# Flush the PR-QBS chain
iptables -t nat -F PR-QBS

# Add a rule that redirects all the DNS traffic to localhost:53
iptables -t nat -I PR-QBS -i vif+ -p udp --dport 53 -j DNAT --to-destination 127.0.0.1

# Add a rule that accepts the traffic coming to localhost
# from XEN's virtual interfaces on port 53

iptables -I INPUT -i vif+ -p udp --dport 53 -d 127.0.0.1 -j ACCEPT

# Enable the traffic coming from the virtual interfaces
# to be forwarded to the loopback interface
# enabling the route_localnet flag on them

find /proc/sys/net/ipv4/conf -name "vif*" -exec bash -c 'echo 1 | sudo tee {}/route_localnet' \;
===== END

I have tried saving these /rw/config/rc.local and /rw/config/qubes-firewall-user-script  but I still have to keep running the rules.

Should I be saving then rules in another location? I used this tutorial to setup Pihole  - https://blog.tufarolo.eu/how-to-configure-pihole-in-qubesos-proxyvm/

Any help would be apprectiated.

Regards,

Chris


-
Chris Willard

Sent with ProtonMail Secure Email.

Reply all
Reply to author
Forward
0 new messages