Gill
Occasional Visitor
Hey Guys,
I need help on Iptables as I am totally noob on this topic. What I am trying to do is to force the users to use specific DNS. For that purpse I enabled the ssh and logged into the router.
cd /jffs/scripts
vi firewall-start
and then pasted this script
#!/bin/sh
#block DNS
iptables -I FORWARD 7 -p udp -o eth0 -d 208.67.222.222 --dport 53 -j ACCEPT
iptables -I FORWARD 8 -p udp -o eth0 -d 208.67.220.220 --dport 53 -j ACCEPT
iptables -I FORWARD 9 -p udp -o eth0 --dport 53 -j DROP
<Esc Key>
:wq
Edit (Also performed chmod a+rx /jffs/scripts/firewall-start)
Restarted my router and it no internet. I was forcing those DNS through WAN page on gui. My questions are:
1) Can you please confirm if my steps are right.
2) How do i check if the script is running/working?
3) if I have to block certain IP blocks from country, As per wiki it says add the code to firewall-script. Should i just copy and paste it like that?
Thanks for the help!
I need help on Iptables as I am totally noob on this topic. What I am trying to do is to force the users to use specific DNS. For that purpse I enabled the ssh and logged into the router.
cd /jffs/scripts
vi firewall-start
and then pasted this script
#!/bin/sh
#block DNS
iptables -I FORWARD 7 -p udp -o eth0 -d 208.67.222.222 --dport 53 -j ACCEPT
iptables -I FORWARD 8 -p udp -o eth0 -d 208.67.220.220 --dport 53 -j ACCEPT
iptables -I FORWARD 9 -p udp -o eth0 --dport 53 -j DROP
<Esc Key>
:wq
Edit (Also performed chmod a+rx /jffs/scripts/firewall-start)
Restarted my router and it no internet. I was forcing those DNS through WAN page on gui. My questions are:
1) Can you please confirm if my steps are right.
2) How do i check if the script is running/working?
3) if I have to block certain IP blocks from country, As per wiki it says add the code to firewall-script. Should i just copy and paste it like that?
Thanks for the help!
Last edited: