Help installing Adguard on Openwrt

I follow adguard guide in this tutorial

annd i ggot stuck with this section

IPTables (firewall3)
Copy and paste these iptables rules in Network → Firewall → Custom Rules Tab or directly to /etc/firewall.user.

iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 53 -j DNAT --to 192.168.1.1:53
iptables -t nat -A PREROUTING -i br-lan -p udp --dport 53 -j DNAT --to 192.168.1.1:53

the problem is, i don't have "custom rules" tab in my luci openwrt menu

how do i solve this problem?

Tried traffic rules ?

i don't know how to input this data in traffic rules

IPTables (firewall3)
Copy and paste these iptables rules in Network → Firewall → Custom Rules Tab or directly to /etc/firewall.user.

iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 53 -j DNAT --to 192.168.1.1:53
iptables -t nat -A PREROUTING -i br-lan -p udp --dport 53 -j DNAT --to 192.168.1.1:53

the traffic rules menu look like this


i have no idea... i'm a complete beginner in openwrt

Actually, wrong tab, sorry.

1 Like

I have a couple questions for you to get started:

  1. What version of OpenWrt are you using?
  2. Do you have a compelling reason to use AdGuard specifically, or are you just looking for ad blocking functionality?

#1 is important, because those rules you show are "iptables" meaning they only work on 21.03 and earlier; 22.03 and later use "nftables" so different format. If you have set up ssh access to your router, just log in to it and do ubus call system board, then paste the results here (otherwise a screen shot of the Status -> Overview page will work).

#2 If AdGuard use is "because I found it first", then I'd suggest uninstalling it and using the adblock package (System -> Software tab), as it accomplishes the same result, but with a far simpler installation and configuration.

In any case, whether you go with AdGuard, adblock, PiHole or whatever, you'll ultimately need to go through that page that @frollic references after you've got one of those working.

2 Likes

thanks, i will read it first

  1. i'm using OpenWrt 22.03.5, perhaps "custom rules" menu are not available in the new version
  2. thanks for the suggestion i'll try using adblock as alternative

Read the wiki page, port forwards.

Correct, 22.03 switched up the whole firewall stack from iptables to nftables, and that particular option was not carried over in the GUI. There are several methods for adding "custom rules" to the firewall, but they all involve translating those iptables commands to nft. For what you are looking to accomplish, you should be able to use just LuCI/GUI, but if you find that you really want to use hand-written nft, just ask.