Skip to content

Instantly share code, notes, and snippets.

@stu43005
Created December 4, 2020 16:30
Show Gist options
  • Save stu43005/78d336c0e587db5244ef6c621284f340 to your computer and use it in GitHub Desktop.
Save stu43005/78d336c0e587db5244ef6c621284f340 to your computer and use it in GitHub Desktop.
install AdGuard Home in Synology RT1900ac
mkdir /opt
cd /opt
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/latest/AdGuardHome_linux_armv7.tar.gz
tar -xzvf AdGuardHome_linux_armv7.tar.gz
# grep -rn '/etc/' -e 'dnsmasq'
# netstat -lnp | grep 'dnsmasq'
echo "port=0" >> /etc/dhcpd/dhcpd-port-port.conf
echo 'enable="yes"' > /etc/dhcpd/dhcpd-port-port.info
echo "port=0" >> /etc/dhcpd/dhcpd.conf
killall dnsmasq
/opt/AdGuardHome/AdGuardHome -s install
@stu43005
Copy link
Author

stu43005 commented Dec 4, 2020

首先在管理介面開啟ssh功能,用ssh進入shell介面

再來就能依照上面的腳本去安裝AdGuard Home...

  • 最主要折騰的點在於內建的dnsmasq(或named)會占用53 port,可以用netstat -lnp確認是否占用
  • 如果有在套件管理器上安裝DNS Server,先移除掉再說
  • Synology有將dnsmasq的config路徑做修改,在/etc/dhcpd/dhcpd.conf
  • 在config檔案結尾加上port=0,並重啟dnsmasq,就可以解決port占用的問題
  • 但網頁管理介面在儲存時會重新刷新config的內容,所以要利用他的一些『規則』去保存port設定
  • 最後只要將AdGuardHome安裝為服務,就可以進入AdGuard管理介面了:http://192.168.1.1:3000/

安裝完成後的占用大小

硬碟占用

SynologyRouter> du -shc /opt/*
19.1M   /opt/AdGuardHome
8.2M    /opt/AdGuardHome_linux_armv7.tar.gz
27.3M   total

記憶體占用

SynologyRouter> top
Mem: 184312K used, 51556K free, 0K shrd, 2692K buff, 67356K cached
CPU:  8.6% usr  5.3% sys  0.0% nic 84.0% idle  0.1% io  0.0% irq  1.8% sirq
Load average: 0.45 0.39 0.58 3/229 3587
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
12909     1 root     S     793m342.2  0.4 /volumeUSB2/usbshare2-1/opt/AdGuardHome/AdGuardHome -s run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment