What's new

How do you add iptables to ASUSWRT Merlin?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

W1nks

Occasional Visitor
Hi all,

I just recently got an ASUS RT-AC86U router and put Merlin's firmware on it right away. I got pretty much everything set up the way I need it except I would like to be able to add a few iptables rules. I was trying to read through the Wiki a bit and in other places on how to do this. It's my understanding that I need to enable JIFFS partition as well as SSH so I can telnet, correct?

I'm a little lost on what to do after doing that because I'm not super familiar with Linux and am still learning. What are the steps/commands I need to follow once I telnet into the router? I know the iptables commands I need to use because I had them on my previous router. I will be using the commands:

iptables -t nat -l PREROUTING -p udp -s 192.168.1.11/32 --dport 53 - j DNAT --to 8.8.8.8
iptables -t nat -l PREROUTING -p tcp -s 192.168.1.11/32 --dport 53 - j DNAT --to 8.8.8.8
iptables -t nat -l PREROUTING -p udp -s 192.168.1.11/32 --dport 53 - j DNAT --to 8.8.4.4
iptables -t nat -l PREROUTING -p tcp -s 192.168.1.11/32 --dport 53 - j DNAT --to 8.8.4.4
iptables -t nat -l PREROUTING -p udp -s 192.168.1.12/32 --dport 53 - j DNAT --to 8.8.8.8
iptables -t nat -l PREROUTING -p tcp -s 192.168.1.12/32 --dport 53 - j DNAT --to 8.8.8.8
iptables -t nat -l PREROUTING -p udp -s 192.168.1.12/32 --dport 53 - j DNAT --to 8.8.4.4
iptables -t nat -l PREROUTING -p tcp -s 192.168.1.12/32 --dport 53 - j DNAT --to 8.8.4.4

I'm using these commands because I want to set a certain DNS server for a few specific devices I own.

I had dd-wrt on my previous router and I could add these through the GUI. I like the interface of ASUSWRT so I would like to stick with it if I can get everything figured out with these commands.

Thanks!
 
I'm using these commands because I want to set a certain DNS server for a few specific devices I own.

Use DNSFilter, through the webui. It will allow you to do the same thing without the need for any special iptables configuration.
 
@RMerlin - reviving old thread as I am after similar setup and not getting the desired results.

Check this thread please
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top