Installing adguard on a usb drive

I am a very happy user of gl-mt6000 flint 2. I currently have firmware 4.7.0 beta6 installed and I must admit that I have a problem with adguard. I configured it to keep client logs for 90 days. Unfortunately, these logs are saved only for 1 day and then overwritten again, so I do not have a history view. What is the problem? Secondly, can I connect a pendrive to this router to install e.g. adguard or other services on it? I admit that I had such a solution on my previous Asus ac86u router on which I had the merlinwrt software. It worked great and did not use the router's disk space, which gave me huge possibilities.

You can enable persistent storage of the log files using this command:

sed -i '/^querylog:/,/^[^ ]/ s/^  file_enabled: .*/  file_enabled: true/' /etc/AdGuardHome/config.yaml
/etc/init.d/adguardhome restart

It might wear off your flash memory faster - but shouldn't be a big thing.

I know this solution, but can this file be set on the USB memory so that Adguard uses it?

You can try to hard/softlink the log files to your USB stick. Not sure if it will work nor would I recommend it.

Edit: Or you might change the log path in the config.yaml - not sure either.

You just have to ensure that Adguard is allowed to write to the stick.

I try this method:

If you want to install Adguard home outside router then can use any mini computers such like raspberry pi, nuc or Nas .

I have an Intel nuc. But the thing is that on the previous Asus ac86u router (weaker than flint 2) I had adguard installed on USB and it worked great. I don't understand why there is no such option on this router. Adguard logs are quite large, so it is worth using a USB memory for this. It would be great if the factory software on this router had such functionality.

My flint 2 router enough storage with Adguard logs 90 days .
Do you really need logs 90 days?

It would be enough for max 60 days. The problem is that adguard stores this log max up to one day. The above command did not solve the problem, so I am thinking about installing on a USB drive or replacing flint 2 with something from the new Asus series.

The command here should definitely solve this issue.

Depending on the yaml file, you might need to look into it manually and set file_enabled: true
Make sure to restart AdGuard afterwards.

When i run this command i have this information:

root@GL-MT6000:~# sudo sed -i '/^querylog:/,/[1]/ s/^ file_enabled: .*/ file_enabled: true/' /etc/AdGuardHome/config.yaml
root@GL-MT6000:~# /etc/init.d/adguardhome restart

Warning: Section @zone[1] (wan) cannot resolve device of network 'wan6'
Warning: Section @zone[1] (wan) cannot resolve device of network 'wwan'
Warning: Section @zone[1] (wan) cannot resolve device of network 'secondwan'
Warning: Section @zone[2] (guest) cannot resolve device of network 'guest'
Warning: Option 'wgserver'.masq6 is unknown
Warning: Section 'wgserver' has no forward policy specified, using default
Warning: Option 'sambasharewan'.dest_proto is unknown
Warning: Section 'sambasharewan' does not specify a protocol, assuming TCP+UDP
Warning: Option 'sambasharelan'.dest_proto is unknown
Warning: Section 'sambasharelan' does not specify a protocol, assuming TCP+UDP
Warning: Option 'glnas_ser'.dest_proto is unknown
Warning: Section 'glnas_ser' does not specify a protocol, assuming TCP+UDP
Warning: Option 'webdav_wan'.dest_proto is unknown
Warning: Section 'webdav_wan' does not specify a protocol, assuming TCP+UDP
Warning: Section 'wgserver_allow_dns' does not specify a protocol, assuming TCP+UDP
Warning: Section @redirect[4] (GL-shardeum) has no target specified, defaulting to DNAT
Warning: Section @redirect[5] (GL-shardeum) has no target specified, defaulting to DNAT
Warning: Section @redirect[6] (GL-celestia) has no target specified, defaulting to DNAT
Warning: Section @redirect[7] (GL-celestia) has no target specified, defaulting to DNAT
Warning: Section @zone[2] (guest) has no device, network, subnet or extra options
 * Clearing IPv4 filter table
 * Clearing IPv4 nat table
 * Clearing IPv4 mangle table
 * Clearing IPv4 raw table
 * Populating IPv4 filter table
   * Rule 'Allow-DHCP-Renew'
   * Rule 'Allow-IGMP'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Rule 'Allow-DHCP'
   * Rule 'Allow-DNS'
   * Rule #14
   * Rule #15
   * Rule #16
   * Rule #17
   * Rule 'wgserver_allow'
   * Rule 'wgserver_allow_dns'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-celestia'
   * Redirect 'GL-celestia'
   * Forward 'lan' -> 'wan'
   * Forward 'guest' -> 'wan'
   * Forward 'wgserver' -> 'wan'
   * Forward 'lan' -> 'wgserver'
   * Forward 'wgserver' -> 'lan'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 nat table
   * Redirect 'GL-shardeum'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-celestia'
   * Redirect 'GL-celestia'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 mangle table
   * Rule 'process_mark'
   * Rule 'process_mark_dns'
   * Rule 'process_explict_vpn'
   * Rule 'process_mark_stubby'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 raw table
   * Zone 'lan'
     - Using automatic conntrack helper attachment
   * Zone 'wan'
   * Zone 'guest'
     - Using automatic conntrack helper attachment
   * Zone 'wgserver'
 * Clearing IPv6 filter table
 * Clearing IPv6 nat table
 * Clearing IPv6 mangle table
 * Populating IPv6 filter table
   * Rule 'Allow-DHCPv6'
   * Rule 'Allow-MLD'
   * Rule 'Allow-ICMPv6-Input'
   * Rule 'Allow-ICMPv6-Forward'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Rule 'Allow-DHCP'
   * Rule 'Allow-DNS'
   * Rule #14
   * Rule #15
   * Rule #16
   * Rule #17
   * Rule 'wgserver_allow_dns'
   * Forward 'lan' -> 'wan'
   * Forward 'guest' -> 'wan'
   * Forward 'wgserver' -> 'wan'
   * Forward 'lan' -> 'wgserver'
   * Forward 'wgserver' -> 'lan'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv6 nat table
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_lan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_lan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_wan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_wan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_guest_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_guest_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_wgserver_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_wgserver_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_rule'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv6 mangle table
   * Rule 'process_mark'
   * Rule 'process_mark_dns'
   * Rule 'process_explict_vpn'
   * Rule 'process_mark_stubby'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Set tcp_ecn to off
 * Set tcp_syncookies to on
 * Set tcp_window_scaling to on
 * Running script '/etc/firewall.nat6'
 * Running script '/etc/firewall.vpn_server_policy.sh'
 * Running script '/etc/firewall.vpn_client_deal_leak.sh'
iptables v1.8.7 (legacy): Couldn't load target `deal_client_leak':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
   ! Failed with exit code 1
 * Running script '/usr/bin/gl_block.sh'
 * Running script '/etc/firewall.ethernet_ttl'
iptables: No chain/target/match by that name.
iptables v1.8.7 (legacy): Couldn't load target `ETHERNET_TTL':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
ip6tables: No chain/target/match by that name.
ip6tables v1.8.7 (legacy): Couldn't load target `ETHERNET_TTL':No such file or directory

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables: No chain/target/match by that name.
   ! Failed with exit code 1
iptables: No chain/target/match by that name.
Warning: Section @zone[1] (wan) cannot resolve device of network 'wan6'
Warning: Section @zone[1] (wan) cannot resolve device of network 'wwan'
Warning: Section @zone[1] (wan) cannot resolve device of network 'secondwan'
Warning: Section @zone[2] (guest) cannot resolve device of network 'guest'
Warning: Option 'wgserver'.masq6 is unknown
Warning: Section 'wgserver' has no forward policy specified, using default
Warning: Option 'sambasharewan'.dest_proto is unknown
Warning: Section 'sambasharewan' does not specify a protocol, assuming TCP+UDP
Warning: Option 'sambasharelan'.dest_proto is unknown
Warning: Section 'sambasharelan' does not specify a protocol, assuming TCP+UDP
Warning: Option 'glnas_ser'.dest_proto is unknown
Warning: Section 'glnas_ser' does not specify a protocol, assuming TCP+UDP
Warning: Option 'webdav_wan'.dest_proto is unknown
Warning: Section 'webdav_wan' does not specify a protocol, assuming TCP+UDP
Warning: Section 'wgserver_allow_dns' does not specify a protocol, assuming TCP+UDP
Warning: Section 'adguard_home' has no target specified, defaulting to DNAT
Warning: Section 'adguard_home_guest' has no target specified, defaulting to DNAT
Warning: Section @redirect[4] (GL-shardeum) has no target specified, defaulting to DNAT
Warning: Section @redirect[5] (GL-shardeum) has no target specified, defaulting to DNAT
Warning: Section @redirect[6] (GL-celestia) has no target specified, defaulting to DNAT
Warning: Section @redirect[7] (GL-celestia) has no target specified, defaulting to DNAT
Warning: Section @zone[2] (guest) has no device, network, subnet or extra options
 * Clearing IPv4 filter table
 * Clearing IPv4 nat table
 * Clearing IPv4 mangle table
 * Clearing IPv4 raw table
 * Populating IPv4 filter table
   * Rule 'Allow-DHCP-Renew'
   * Rule 'Allow-IGMP'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Rule 'Allow-DHCP'
   * Rule 'Allow-DNS'
   * Rule #14
   * Rule #15
   * Rule #16
   * Rule #17
   * Rule 'wgserver_allow'
   * Rule 'wgserver_allow_dns'
   * Redirect 'Adguard Home'
   * Redirect 'Adguard Home guest'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-celestia'
   * Redirect 'GL-celestia'
   * Forward 'lan' -> 'wan'
   * Forward 'guest' -> 'wan'
   * Forward 'wgserver' -> 'wan'
   * Forward 'lan' -> 'wgserver'
   * Forward 'wgserver' -> 'lan'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 nat table
   * Redirect 'Adguard Home'
   * Redirect 'Adguard Home guest'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-shardeum'
   * Redirect 'GL-celestia'
   * Redirect 'GL-celestia'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 mangle table
   * Rule 'process_mark'
   * Rule 'process_mark_dns'
   * Rule 'process_explict_vpn'
   * Rule 'process_mark_stubby'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv4 raw table
   * Zone 'lan'
     - Using automatic conntrack helper attachment
   * Zone 'wan'
   * Zone 'guest'
     - Using automatic conntrack helper attachment
   * Zone 'wgserver'
 * Clearing IPv6 filter table
 * Clearing IPv6 nat table
 * Clearing IPv6 mangle table
 * Populating IPv6 filter table
   * Rule 'Allow-DHCPv6'
   * Rule 'Allow-MLD'
   * Rule 'Allow-ICMPv6-Input'
   * Rule 'Allow-ICMPv6-Forward'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Rule 'Allow-DHCP'
   * Rule 'Allow-DNS'
   * Rule #14
   * Rule #15
   * Rule #16
   * Rule #17
   * Rule 'wgserver_allow_dns'
   * Forward 'lan' -> 'wan'
   * Forward 'guest' -> 'wan'
   * Forward 'wgserver' -> 'wan'
   * Forward 'lan' -> 'wgserver'
   * Forward 'wgserver' -> 'lan'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv6 nat table
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_lan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_lan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_wan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_wan_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_guest_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_guest_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_wgserver_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_wgserver_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'prerouting_rule'
Warning: fw3_ipt_rule_append(): Can't find target 'postrouting_rule'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Populating IPv6 mangle table
   * Rule 'process_mark'
   * Rule 'process_mark_dns'
   * Rule 'process_explict_vpn'
   * Rule 'process_mark_stubby'
   * Zone 'lan'
   * Zone 'wan'
   * Zone 'guest'
   * Zone 'wgserver'
 * Set tcp_ecn to off
 * Set tcp_syncookies to on
 * Set tcp_window_scaling to on
 * Running script '/etc/firewall.nat6'
 * Running script '/etc/firewall.vpn_server_policy.sh'
 * Running script '/etc/firewall.vpn_client_deal_leak.sh'
iptables v1.8.7 (legacy): Couldn't load target `deal_client_leak':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
   ! Failed with exit code 1
 * Running script '/usr/bin/gl_block.sh'
 * Running script '/etc/firewall.ethernet_ttl'
iptables: No chain/target/match by that name.
iptables v1.8.7 (legacy): Couldn't load target `ETHERNET_TTL':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name.
ip6tables: No chain/target/match by that name.
ip6tables v1.8.7 (legacy): Couldn't load target `ETHERNET_TTL':No such file or directory

Try `ip6tables -h' or 'ip6tables --help' for more information.
ip6tables: No chain/target/match by that name.
   ! Failed with exit code 1
iptables: No chain/target/match by that name.

Finally dont take effect and adguard safe only 1 day log.


  1. ^ ↩︎

Did you enable the logs inside AdGuard Home as well?

I think yes, but how check this ?

Look inside your AdGuard Home settings, especially the General > Logs settings.

Yes, this option is enabled all the time