Using pi hole or adguard home on a different local IP? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
gasto
Posts: 50
Joined: Fri Dec 04, 2020 2:24 am

Using pi hole or adguard home on a different local IP?

Post by gasto »

Hi everybody,

After reading quite a lot I finally managed to install Diet Pi on my Orange Pi Zero.

I also followed the guide on Adguard Github page to install it on my board, and I successfully completed it. However, I noticed that my Diet Pi IP is the same as my Adguard home DNS IP that I'm now using on my devices to resolve domains and block ads.

Is there any way to setup a separate IP for Adguard Home (or Pi Hole for that matter) so that I have that specific separate IP for DNS ads blocking?

I saw on wundertech blog that there's some way of doing that by installing Docker and running this command: sudo docker network create -d macvlan -o parent=eth0 --subnet=192.168.0.1/24 --gateway=192.168.0.1 --ip-range=192.168.0.50/32 my_network

In this case, 192.168.0.50 would be the IP of Adguard home that I could use.

I tried doing that before installing Adguard home but when I was presented with Adguard Home setup I didn't get to choose that IP.

Sorry for the long post, hope it's clear.
Thanks in advance!
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

Re: Using pi hole or adguard home on a different local IP?

Post by Joulinar »

Hi,

many thanks for your message. Can I ask a question. Why do you need a 2nd interface on your system? What should be the aim?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 50
Joined: Fri Dec 04, 2020 2:24 am

Re: Using pi hole or adguard home on a different local IP?

Post by gasto »

Hi Joulinar,

Thank you for your answer. I´m not even sure. But I´m guessing if I need to install a webserver, maybe it´d be more "clean" to have my local Diet Pi IP as that webserver, and then another IP for Adguard Home or Pi Hole.

Maybe there´s no need at all, but I don´t know for sure.
Regards,


edit: As a matter of fact, I tried to install apache web server (I need this in order to install letsencrypt), but I got an error message saying my address (the local Diet PI IP) is already being used (by AdGuard Home). So I guess that would be the reason I would like to set up an additional interface for Adguard home.
Thanks again.
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

Re: Using pi hole or adguard home on a different local IP?

Post by Joulinar »

Hi,

usually it's not needed to have 2 IP address on a single network adapter. You could stay with DietPi standard and install PiHole from DietPi-Software catalogue. This will install a web server automatically. Using DietPi-Letsencrypt wil use that already installed web server to generate you certificates. On DietPi you are free to choose between 3 different web server (Lighttpd, Apache or Nginx). Your web server preference can be done inside DietPi-Software.

Currently I'm not using Adguard home as I'm more in favor of PiHole. Therefore I'm not sure if there is a config file to change Adguard's own web server port to something like 8080. Would need to do a test.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 50
Joined: Fri Dec 04, 2020 2:24 am

Re: Using pi hole or adguard home on a different local IP?

Post by gasto »

Ohh okay, so by changing Adguard Home port from 80 to 8080 would solve my issue in this case? I can try and see where I can change that.
But if not I will switch to Pihole.

Thanks!
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

Re: Using pi hole or adguard home on a different local IP?

Post by Joulinar »

If you are going for 2 IP address on a single network adapter, you would need to manually configure both Adguard as well as Apache to LISTEN on a specific IP address only. By default both tools did not expect such a configuration and will LISTEN an all interfaces, which leads to the port conflict.

Another alternative is to have Adguard running inside a Docker container. This would solve the problem as well https://hub.docker.com/r/adguard/adguardhome

BTW according Adguard GitHub, the own web service should be running on port 3000 and not 80 https://github.com/AdguardTeam/AdGuardH ... ng-Started
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gasto
Posts: 50
Joined: Fri Dec 04, 2020 2:24 am

Re: Using pi hole or adguard home on a different local IP?

Post by gasto »

Yes, the first time for the install it runs on 3000, but after it´s configured, it´s 80.
Thanks again!

edit: Oh and last question since you mentioned Docker. As for CPU and RAM usage, which one is better? Running an application on Docker or via DietPi software?
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

Re: Using pi hole or adguard home on a different local IP?

Post by Joulinar »

during initial setup, you can specify the port Adguard web server schuld be ruining on. No limitations there. Choose a port like 8080.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply