/container add remote-image=adguard/adguardhome:latest interface=veth1 root-dir=adguard mounts=adguard_etc
failure: not allowed by device-mode
If necessary, I can show you the entire order of command execution
/container add remote-image=adguard/adguardhome:latest interface=veth1 root-dir=adguard mounts=adguard_etc
failure: not allowed by device-mode
Strange, I seemed to do it as a commandFirst enable container functionality here:
https://help.mikrotik.com/docs/display/ROS/Device-mode
/system device-mode update container=yes
system device-mode print
mode: enterprise
system device-mode print
mode: enterprise
container: yes
/container add remote-image=adguard/adguardhome:latest interface=veth1 root-dir=adguard mounts=adguard_etc
Unfortunately, setting up logging is an unknown topic for me. I did as written in the Mikrotik wikiAdd the logging=yes directive on the container-creation command and look in the logs. Might explain more about the error.
/container set 0 logging=yes
was unable to import, container 78af614f-b4ef-427b-8e17-22e1dc08ba93
This was the first thing I tried after your advice to enable logging.Remove the container and re-create
Yes, I write directly to a local drive. In the topic header I wrote a model of my Mikrotik and wrote that I understand that this is not the best idea. But I don’t know how to check how much space is on the local drive.You specify as root-dir=adguard => This will write on the local flash, you have enough space ??
7.9.1On which ROS version? There was issue with OCI manifest, fixed in ROS 7.10.
*) container - fixed "container pull" to support OCI manifest format;
container set start-on-boot=yes 0
2023/12/06 16:38:40.922017 [info] go to http://172.17.0.2:3000
I just did this, but another problem appeared, voiced above.Containers are stopped by default after deploying, needs to be started manually /container/run <container_number> and also you can set start-on-boot=yes to autorun container on ROS startup.
Of course it is on another bridge. I did as in the instructions. The bridge itself pings (172.17.0.1)If container VETH is on different bridge than LAN, then this is normal, you need firewall rule fo accept forward traffic in/out containers bridge or VETH IP (depends how you need to secure containers network).
/ip/firewall/filter/add chain=forward action=accept in-interface-list=LAN out-interface=containers
I will try to do as in the instructions. Here are the steps I did:If you added other rules from MT Container tutorial try with:
/system device-mode update container=yes
/container set 0 logging=yes
/interface bridge add name=dockers
/ip address add address=172.17.0.1 interface=dockers
/interface veth add name=veth1 address=172.17.0.2/24 gateway=172.17.0.1
/ip firewall nat add chain=scrnat action=masquerade src-address=172.17.0.0/24
/container config set ram-high=100M
/container config set registry-ur=https://registry-1.docker.io
/container config set tmpdir=/tmp_docker
/container mounts add name=adguard_etc src=/adguard/etc dst=/etc/adguard
/container add remote-image=adguard/adguardhome:latest interface=veth1 root-dir=adguard mounts=adguard_etc
/container set start-on-boot=yes 0
I understand that I have to substitute my values here. If I understand what LAN is, then I don’t understand what “out-interface=containers” is.try with:Code: Select all/ip/firewall/filter/add chain=forward action=accept in-interface-list=LAN out-interface=containers
I didn't know name you assigned to containers bridge, I assumed containers since is like that in tutorial, but in your case is dockers, then replace containers with dockers in that rule. in/out-interface in rules can be interface (not all) or bridge.then I don’t understand what “out-interface=containers” is.
That's what I thought, but unfortunately, the ping still doesn't work.I didn't know name you assigned to containers bridge, I assumed containers since is like that in tutorial, but in your case is dockers, then replace containers with dockers in that rule. in/out-interface in rules can be interface (not all) or bridge.
Yes, again my carelessness. Ping went. Thank you. I will try to further understand containers and adguard.Address subnet is missing for dockers bridge:
/ip address add address=172.17.0.1/24 interface=dockers
By the way, I tried to remove this rule and the container continued to work. It turns out that this rule was unnecessary in this situation?If you added other rules from MT Container tutorial try with:
If you have defconf configuration, order that rule below defconf: drop invalid rule.Code: Select all/ip/firewall/filter/add chain=forward action=accept in-interface-list=LAN out-interface=containers
Apparently I still have an error in setting up the firewall configuration. The fact is that although my adguard starts, the statistics show nothing. And it’s not clear whether this is a problem with Adguard or Mikrotik settings. At the same time, in all the videos that I watched on the topic of launching AdGurd, regardless of the launch location (Mikrotik or another server), traffic blocking begins immediately at the default settings. So I tried to return your rule and even added a rule from the Mikrotik instructions for pi-hole, that is, this:I have different setup (IP firewall for bridge) and I need this rule
/ip firewall nat add action=dst-nat chain=dstnat dst-address=192.168.0.2 dst-port=80 protocol=tcp to-addresses=172.17.0.2 to-ports=80
/ip dns set servers=172.17.0.2
>container print
0 name="5ae8a330-5a2b-45ea-89e2-63f29a037a74" tag="adguard/adguardhome:latest" os="linux" arch="arm" interface=veth1 root-dir=adguard mounts=adguard_etc dns=""
workdir="/opt/adguardhome/work" logging=yes start-on-boot=yes status=running
I believe that you meant this type of configuration, because I can’t draw as beautifully as you do, and I don’t understand everything, and I’m not sure whether my drawing will coincide with reality.I guessing that since you didn't reveal configuration
# 2023-12-08 17:22:43 by RouterOS 7.10.2
#
# model = RB4011iGS+5HacQ2HnD
/interface bridge
add name=bridge-LAN
add name=dockers
/interface ethernet
set [ find default-name=ether1 ] name=eth1-WAN
set [ find default-name=ether10 ] loop-protect=on name=eth10-WAN-LTE
/interface veth
add address=172.17.0.2/24 gateway=172.17.0.1 name=veth1
/container mounts
add dst=/etc/adguard name=adguard_etc src=/adguard/etc
/interface list
add name=list1-WAN
add name=list2-LAN
add name=list3-WAN-LTE
/interface lte apn
set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MyMikroTik
add authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys name=\
SecuretyPass supplicant-identity=""
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=0 band=5ghz-a/n/ac \
channel-width=20/40/80mhz-XXXX country=no_country_set disabled=no \
frequency-mode=manual-txpower mode=ap-bridge name=wlan1-5Gz radio-name=\
b869f4c58845 security-profile=SecuretyPass ssid=Dima1 station-roaming=\
enabled
set [ find default-name=wlan2 ] antenna-gain=0 band=2ghz-b/g/n channel-width=\
20/40mhz-XX country=no_country_set disabled=no frequency-mode=\
manual-txpower mode=ap-bridge name=wlan2-2.4Gz security-profile=\
SecuretyPass ssid=Dima1 station-roaming=enabled
/ip pool
add name=dhcp_pool1 ranges=192.168.0.10-192.168.0.99
add name=dhcp_pool2 ranges=192.168.0.11-192.168.0.99
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool2 interface=bridge-LAN lease-time=10m \
name=dhcp1
/port
set 0 name=serial0
set 1 name=serial1
/container
add interface=veth1 logging=yes mounts=adguard_etc root-dir=adguard \
start-on-boot=yes workdir=/opt/adguardhome/work
/container config
set ram-high=100.0MiB registry-url=https://registry-1.docker.io tmpdir=\
/tmp_docker
/interface bridge port
add bridge=bridge-LAN ingress-filtering=no interface=ether2
add bridge=bridge-LAN ingress-filtering=no interface=ether3
add bridge=bridge-LAN ingress-filtering=no interface=ether4
add bridge=bridge-LAN ingress-filtering=no interface=ether5
add bridge=bridge-LAN ingress-filtering=no interface=ether6
add bridge=bridge-LAN ingress-filtering=no interface=ether7
add bridge=bridge-LAN ingress-filtering=no interface=ether8
add bridge=bridge-LAN ingress-filtering=no interface=ether9
add bridge=bridge-LAN ingress-filtering=no interface=wlan1-5Gz
add bridge=bridge-LAN ingress-filtering=no interface=wlan2-2.4Gz
add bridge=dockers interface=veth1
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set max-neighbor-entries=8192
/interface detect-internet
set detect-interface-list=all
/interface list member
add interface=eth1-WAN list=list1-WAN
add interface=bridge-LAN list=list2-LAN
add interface=eth10-WAN-LTE list=list3-WAN-LTE
/interface ovpn-server server
set auth=sha1,md5
/ip address
add address=192.168.0.2/24 interface=bridge-LAN network=192.168.0.0
add address=172.17.0.1/24 interface=dockers network=172.17.0.0
/ip dhcp-client
add interface=eth1-WAN use-peer-dns=no use-peer-ntp=no
add interface=eth10-WAN-LTE use-peer-dns=no
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=192.168.0.2,192.168.0.1,8.8.8.8 \
gateway=192.168.0.2
/ip dns
set servers="172.17.0.2,192.168.0.2,8.8.8.8,192.168.0.1,192.168.1.1,192.16\
8.0.1,8.8.4.4"
/ip firewall address-list
add address=8.8.8.8 list=allowed-ping-to-WAN
/ip firewall filter
add action=drop chain=input comment="Drop IN echo request" disabled=yes \
icmp-options=8:0 in-interface-list=list1-WAN protocol=icmp \
src-address-list=NotAllowIPRemoteManagement
add action=accept chain=forward disabled=yes in-interface-list=list2-LAN \
out-interface=dockers
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=list1-WAN
add action=masquerade chain=srcnat out-interface-list=list3-WAN-LTE
add action=dst-nat chain=dstnat disabled=yes dst-address=192.168.0.2 \
dst-port=80 protocol=tcp to-addresses=172.17.0.2 to-ports=80
add action=dst-nat chain=dstnat disabled=yes dst-address=192.168.0.2 \
dst-port=80 protocol=tcp to-addresses=172.17.0.2 to-ports=80
/ip service
set telnet disabled=yes
set ftp disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/routing bfd configuration
add disabled=no
/system leds
add interface=wlan2-2.4Gz leds="wlan2-2.4Gz_signal1-led,wlan2-2.4Gz_signal2-le\
d,wlan2-2.4Gz_signal3-led,wlan2-2.4Gz_signal4-led,wlan2-2.4Gz_signal5-led" \
type=wireless-signal-strength
add interface=wlan2-2.4Gz leds=wlan2-2.4Gz_tx-led type=interface-transmit
add interface=wlan2-2.4Gz leds=wlan2-2.4Gz_rx-led type=interface-receive
I wish I had found this topic sooner. Perhaps I would not have started my own topic. And since this happened, I’ll continue here, although it might be worth moving on to the topic you indicated.Here you can se my scenario how I use additional DNS services with ROS.
Yes, it helped. It’s just strange why it worked on my PC even without these settings.Add to DHCP server network Adguard IP for DNS:
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=172.17.0.2,192.168.0.2,192.168.0.1,8.8.8.8 gateway=192.168.0.2
Before this, I didn’t even think about the fact that DNS is configured in two places and whether I need it. Therefore, I will turn to you here for advice. A little later, I plan to set up a DNS for the local network so that some of my devices can be accessed by name. Where is the best place to do this and how, and is it possible to remove DNS from the “configuration” in this case "ip dns"?And you can remove it from ROS DNS (unless you really need it for some reason):
/ip dns
set servers="172.17.0.2,192.168.0.2,8.8.8.8,192.168.0.1,192.168.1.1,192.168.0.1,8.8.4.4"
Why might this happen?And you should "intercept" anyway classic DNS packets in case some client does not want to use the Adguard.
I just recently started trying to set up a firewall and I don’t understand everything. For example, 172.29.45.251 is the address of your PI Hole?Make sure you excluded the Adguard/Pi-hole itself using the appropriate src-address-list.
/ip firewall nat add action=dst-nat chain=dstnat comment="DNS Intercept TCP - Pi-hole" dst-port=53 in-interface=Bridge-LAN log-prefix=IPV4-DNSCATCH-TCP protocol=tcp src-address-list=!Pihole to-addresses=172.29.45.251
/ip firewall nat add action=dst-nat chain=dstnat comment="DNS Intercept UDP - Pi-hole" dst-port=53 in-interface=Bridge-LAN log-prefix=IPV4-DNSCATCH-UDP protocol=udp src-address-list=!Pihole to-addresses=172.29.45.251
Maybe DNS IP is manually set on that PC?Yes, it helped. It’s just strange why it worked on my PC even without these settings.
You have several options to set static local hostnames and domain (example someting.lan):A little later, I plan to set up a DNS for the local network so that some of my devices can be accessed by name. Where is the best place to do this and how, and is it possible to remove DNS from the “configuration” in this case "ip dns"?
When someone sets manually DNS IP (overrides DHCP DNS) on some device in network.Why might this happen?
Not really clear what you asking, guessing you want to use local Adguard DNS for resolving over VPN connection. For this you can set in VPN client configuration to assign Adguard IP for DNS upon connection, Wireguard has DNS = <ip> configuration for interface, for OpenVPN can be set with dhcp-option DNS <ip>, etc...There is one more question that theoretically concerns container configuration. Suppose I want traffic from a certain site to first pass through some third-party VPN service, and then return to the AdGuardHome container and then to my network. Is it possible to do this and how?
Although I was sure that I had dynamic DNS registered, I decided to double-check and you were right. I forgot to clear persistent DNS in my PC settings.Maybe DNS IP is manually set on that PC?
Yes, I also wanted to make sure that local names were available in case of AdGuard downtime. It turns out that I need to leave a note:set only in ROS DNS (/ip/dns) and in Adguard configure conditional DNS forwarding for lan domain to be resolved by ROS DNS (Pi-hole has that feature, for Adguard idk). With this you can achive when Adguard is down that failover ROS DNS resolves local someting.lan without additional configuration in that period and you will not have redundant static records on both DNS servers
/ip dns
set servers="172.17.0.2,192.168.0.2,8.8.8.8,192.168.0.1,192.168.1.1,192.168.0.1,8.8.4.4"
Yes, I was in a hurry with this question... In fact, the situation with my PC is just the opposite. I had to think for myself a little.When someone sets manually DNS IP (overrides DHCP DNS) on some device in network.
no, the question did not concern Wireguard. This is not a website. And frankly, I’m not sure that it makes sense to deploy Wireguard traffic in any other way.Not really clear what you asking, guessing you want to use local Adguard DNS for resolving over VPN connection. For this you can set in VPN client configuration to assign Adguard IP for DNS upon connection, Wireguard has DNS = <ip> configuration for interface, for OpenVPN can be set with dhcp-option DNS <ip>, etc...
-> There are (Android) clients that I've seen that always contact 8.8.8.8 etc. And in case there is a client with hardcoded DNS settings other then the one you distribute via DHCP. This is just a "failsafe" to catch anyone that tries to "evade" the Adguard.Why might this happen?
I just recently started trying to set up a firewall and I don’t understand everything. For example, 172.29.45.251 is the address of your PI Hole?
Offcourse I also do my best to block DNS-over-HTTPS, DNS-over-TLS etc,etc. but that is a bit hit & miss.
-> Yes, in this example NAT-rule, 172.29.45.251 would be a Pihole-instance.
I understand that AdGuard has nothing to do with redirecting traffic. That’s why I wrote that my question only theoretically partially concerns setting up the container.Adguard is DNS service afaik (resolving hosts into IPs), it has nothing with traffic routing.
I watched some videos by this author, including one on setting up Adguard. Perhaps I didn’t understand you quite correctly, but I didn’t see the answer to my question from him. My question concerns setting up this container only indirectly and may even be done without a container at all. I’ll try to formulate it again, excluding the mention of Adguard.Maybe unpopular comment but on Youtube you got The Networn Berg who has dedicated complete explanation on this. He does it also for Pi-hole depending on your preference.