OMG! You may be close to installing the container package...If one does go down the route of using some sort of DNS protection there are many options.
[...]
Let's stick to pi-hole since Mikrotik has docs for that.First problem: Does the container/docker get its own VLAN? Or does it have to be on a separate bridge?
[...]
/interface/veth/add name=veth-pihole address=10.10.10.10/24 gateway=10.10.10.1
/ip/address/add address=10.10.10.1/24 interface=veth-pihole
/ip/firewall/nat/add chain=srcnat action=masquerade src-address=10.10.10.0/24
/interface/list/member add list=LAN interface=veth-pihole
EXPOSE 53 53/up
EXPOSE 67/up
EXPOSE 80
A VETH is kind of like an EOIP interface. If you make it a member of a bridge (and tag it to a particular VLAN's PVID), then you can assign it an IP in the subnet for that bridge (or VLAN).Thats fine but I have a single bridge with multiple VLANS.
So you are saying create a separate vlan for the docker??
/interface vlan
add interface=BR1 name=CONTAINER_VLAN vlan-id=98
/ip address
add address=172.17.0.1/24 interface=CONTAINER_VLAN
/interface veth
add name=veth-mycontainer address=172.17.0.2/24 gateway=172.17.0.1
/interface bridge port
add bridge=BR1 interface=veth-mycontainer pvid=98
/interface bridge vlan
add bridge=BR1 tagged=BR1 vlan-ids=98
# Mikrotik use masquerade with IP, this may not be needed, but harmless
/ip firewall nat
add chain=srcnat action=masquerade src-address=172.17.0.0/24
# CONTAINER_VLAN should be in an some TBD interface list...
/interface list member
# if using @pcunite style
add interface=CONTAINER_VLAN list=BASE
# for the defconf config
add interface=CONTAINER_VLAN list=LAN
DANG ! So that's the reason I only saw my router's IP ... time to evaluate this option again and move that little Pi-bugger from NAS to router again.You could do the firewall a lot of ways, the example uses masquerade so if you had multiple VLANs it look like it was coming from the router's address and allow outbound internet access for pi-hole downloads:
I get the "all VLAN" approach, but for stuff that really only does Layer 3/IP stuff, you really don't need ANY bridge. A DNS server container (or web server, storage server, etc) does NOT need Layer2.Or, since it's also just an interface on the router, you can give it an address in a unique subnet and all VLANs that use the router as the gateway will be able to talk directly to it. If desired, you could add a NAT rule to replace a legacy DNS server's address on a particular VLAN.
Since I'm 100% positive you can figure out any firewall needs. I'm an agnostic guy, but pi-hole is pretty porky and perhaps dated. Never heard of Blocky:Lets forget Pi-hole its so yesterday (betamax). Either discuss adguard or blocky for example.
How is Pi-hole so yesterday?Lets forget Pi-hole its so yesterday (betamax). Either discuss adguard or blocky for example.
It is ARM only, and that is annoying. But there is NO "Docker binary" to update. It's essential a soup'ed up "choot" that uses the OCI container format, and chroot been same for 40+ years.TIK do not update the Docker binary as quickly as they should so IMO NOT a good way to use 3rd party stuff
Mind sharing how you setup the firewall and bridging? That seem to be the sticking point here.I'm using Pi-hole and Unbound as recursive resolver for some time in containers. So far so good, still, local recursive resolver has side effect - slower dns responses when host is not in cache, depends on quality of internet connection and MT device performance.
Router configMind sharing how you setup the firewall and bridging? That seem to be the sticking point here.I'm using Pi-hole and Unbound as recursive resolver for some time in containers. So far so good, still, local recursive resolver has side effect - slower dns responses when host is not in cache, depends on quality of internet connection and MT device performance.
My bad Amm0 … not binary —- but refer to viewtopic.php?p=985966&hilit=Docker+update#p985966And it's unclear what issues you're actually run into...
Depends on device, I have Pi-Hole and Unbound in different containers (Pi-Hole uses Unbound recursive as upstream DNS), 40 Firewall rules, 124 mangle rules, 39 queue tree rules, working every day from home, at evening mostly streaming torrents, etc...:Regardless - it seems like running either blocky or PiHole (or any container for that matter?) on the MikroTik is probably more hassle than it's worth? -- Increased complexities with decreased performance, compared to a dedicated server or RPi - is this a fair assumption to make?
I'm using Pi-hole and Unbound as recursive resolver for some time in containers. So far so good, still, local recursive resolver has side effect - slower dns responses when host is not in cache, depends on quality of internet connection and MT device performance.
dns-diag.png
This is an error from unbound, you will need to configure it to work as recursive resolver. Maybe just do-not-query-localhost setting is just causing problem (https://serverfault.com/questions/69909 ... works-fine) in your configuration, it needs to be configured to no value.;; WARNING: recursion requested but not available
server:
cache-max-ttl: 86400
cache-min-ttl: 0
directory: "/opt/unbound/etc/unbound"
edns-buffer-size: 1232
interface: 0.0.0.0@53
do-ip4: yes
do-udp: yes
do-tcp: yes
do-ip6: no
prefer-ip6: no
rrset-roundrobin: yes
username: "_unbound"
log-local-actions: no
log-queries: no
log-replies: no
log-servfail: no
logfile: /opt/unbound/etc/dev/null
verbosity: 0
aggressive-nsec: yes
delay-close: 10000
do-daemonize: no
do-not-query-localhost: no
neg-cache-size: 4M
qname-minimisation: yes
access-control: 127.0.0.1/32 allow
access-control: 192.168.0.0/16 allow
access-control: 172.16.0.0/12 allow
access-control: 10.0.0.0/8 allow
auto-trust-anchor-file: "var/root.key"
root-hints: "/dns/root.hints"
chroot: "/opt/unbound/etc"
deny-any: yes
harden-algo-downgrade: yes
harden-below-nxdomain: yes
harden-dnssec-stripped: yes
harden-glue: yes
harden-large-queries: yes
harden-referral-path: no
harden-short-bufsize: yes
hide-http-user-agent: no
hide-identity: yes
hide-version: yes
http-user-agent: "DNS"
identity: "DNS"
private-address: 10.0.0.0/8
private-address: 172.16.0.0/12
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: fd00::/8
private-address: fe80::/10
ratelimit: 1000
tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
unwanted-reply-threshold: 10000
use-caps-for-id: no
val-clean-additional: yes
infra-cache-slabs: 2
incoming-num-tcp: 10
key-cache-slabs: 2
msg-cache-size: 32m
msg-cache-slabs: 2
num-queries-per-thread: 4096
num-threads: 3
outgoing-range: 8192
rrset-cache-size: 64m
rrset-cache-slabs: 2
minimal-responses: yes
prefetch: yes
prefetch-key: yes
serve-expired: yes
so-reuseport: yes
include: /opt/unbound/etc/unbound/a-records.conf
include: /opt/unbound/etc/unbound/srv-records.conf
remote-control:
control-enable: no
This is an error from unbound, you will need to configure it to work as recursive resolver. Maybe just do-not-query-localhost setting is just causing problem (https://serverfault.com/questions/69909 ... works-fine) in your configuration, it needs to be configured to no value.;; WARNING: recursion requested but not available
But there also other stuff that needs to be configured, depends on your neeeds and device resources. I'm using mvance/unbound-rpi:latest docker image in my ROS container with modified unbound.conf:
You have more resources in CCR2116 so you can optimize configuration for your device, like increase threads count, cache memory sizes, etc... See unbound configuration documentation https://nlnetlabs.nl/documentation/unbo ... ound.conf/Code: Select allserver: cache-max-ttl: 86400 cache-min-ttl: 0 directory: "/opt/unbound/etc/unbound" edns-buffer-size: 1232 interface: 0.0.0.0@53 do-ip4: yes do-udp: yes do-tcp: yes do-ip6: no prefer-ip6: no rrset-roundrobin: yes username: "_unbound" log-local-actions: no log-queries: no log-replies: no log-servfail: no logfile: /opt/unbound/etc/dev/null verbosity: 0 aggressive-nsec: yes delay-close: 10000 do-daemonize: no do-not-query-localhost: no neg-cache-size: 4M qname-minimisation: yes access-control: 127.0.0.1/32 allow access-control: 192.168.0.0/16 allow access-control: 172.16.0.0/12 allow access-control: 10.0.0.0/8 allow auto-trust-anchor-file: "var/root.key" root-hints: "/dns/root.hints" chroot: "/opt/unbound/etc" deny-any: yes harden-algo-downgrade: yes harden-below-nxdomain: yes harden-dnssec-stripped: yes harden-glue: yes harden-large-queries: yes harden-referral-path: no harden-short-bufsize: yes hide-http-user-agent: no hide-identity: yes hide-version: yes http-user-agent: "DNS" identity: "DNS" private-address: 10.0.0.0/8 private-address: 172.16.0.0/12 private-address: 192.168.0.0/16 private-address: 169.254.0.0/16 private-address: fd00::/8 private-address: fe80::/10 ratelimit: 1000 tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt unwanted-reply-threshold: 10000 use-caps-for-id: no val-clean-additional: yes infra-cache-slabs: 2 incoming-num-tcp: 10 key-cache-slabs: 2 msg-cache-size: 32m msg-cache-slabs: 2 num-queries-per-thread: 4096 num-threads: 3 outgoing-range: 8192 rrset-cache-size: 64m rrset-cache-slabs: 2 minimal-responses: yes prefetch: yes prefetch-key: yes serve-expired: yes so-reuseport: yes include: /opt/unbound/etc/unbound/a-records.conf include: /opt/unbound/etc/unbound/srv-records.conf remote-control: control-enable: no
Default configuration from that image doesn't setup Unbound as recursive resolver. It uses Cloudflare as upstream DNS, see /opt/unbound/etc/unbound/forward-records.conf from container shell. You can use directly in Pi-hole Cloudflare DNS if you want to use it as upstream and not local recursive. I removed line which includes that configuration in unbound.conf among other modifications.But I haven't even used the "unbound.conf" customization. It works for me directly once the container is created.
linuxserver/openssh-server:latestCould you tell me which container is the Linux you have installed?
teddysun/go-shadowsocks2:latestAnd the Shadowsocks?
Yes, both have arm64 build, you can see that in Tags tab on Docker page for image, eg. https://hub.docker.com/r/linuxserver/op ... erver/tagsAnd if they would work on 64bit architecture.
Default configuration from that image doesn't setup Unbound as recursive resolver. It uses Cloudflare as upstream DNS, see /opt/unbound/etc/unbound/forward-records.conf from container shell. You can use directly in Pi-hole Cloudflare DNS if you want to use it as upstream and not local recursive. I removed line which includes that configuration in unbound.conf among other modifications.But I haven't even used the "unbound.conf" customization. It works for me directly once the container is created.
linuxserver/openssh-server:latestCould you tell me which container is the Linux you have installed?
teddysun/go-shadowsocks2:latestAnd the Shadowsocks?
Yes, both have arm64 build, you can see that in Tags tab on Docker page for image, eg. https://hub.docker.com/r/linuxserver/op ... erver/tagsAnd if they would work on 64bit architecture.
Image is based on Alpine linux distribution which is using apk package manager https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper. You can install other software pakages using that tool.As you know I was interested in several things that I saw in your configuration, linux works perfectly for me, but I can't do anything that I know how to do with it, I suppose that you have it to facilitate other functionalities, it doesn't seem that you have anything configured by whim, or I don't get to know it. For example, I can't install any package, or at least I haven't known how to do it.
These environment variables are described at https://hub.docker.com/r/teddysun/go-shadowsocks2, PASSWORD is masked because I don't want to share it, must be set same at server and client side (METHOD also must be the same on both sides since this defines protocol cipher algorithm).--------------------------------------------------------------
/container/envs/add name=shadowsocks_envs key=TZ value="Europe/Madrid"
/container/envs/add name=shadowsocks_envs key=DNS_ADDRS value=192.168.4.2 <---- This is the Pi-Hole veth address
/container/envs/add name=shadowsocks_envs key=PASSWORD value="xxxxxxx" <---- obviously my password don't apears
/container/envs/add name=shadowsocks_envs key=SERVER_PORT value=443
/container/envs/add name=shadowsocks_envs key=METHOD value=AEAD_AES_128_GCM
/container/envs/add name=shadowsocks_envs key=ARGS value="-plugin v2ray-plugin -plugin-opts server;tls;host=xxx;logLevel=none" <---- and I don´t know if "host=xxx" is the problem
--------------------------------------------------------------
--------------------------------------------------------------
/container/mounts/add name=shadowsocks_acme src=nvme1-part1/disk1/shadowsocks/root/acme.sh dst=/root/.acme.sh
/container/mounts/add name=shadowsocks_tmp src=nvme1-part1/disk1/shadowsocks/root/tmp dst=/root/tmp
--------------------------------------------------------------
var ( ... flag.*
/root/.acme.sh/myhost.net/fullchain.cer
/root/.acme.sh/myhost.net/myhost.net.key
Image is based on Alpine linux distribution which is using apk package manager https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper. You can install other software pakages using that tool.As you know I was interested in several things that I saw in your configuration, linux works perfectly for me, but I can't do anything that I know how to do with it, I suppose that you have it to facilitate other functionalities, it doesn't seem that you have anything configured by whim, or I don't get to know it. For example, I can't install any package, or at least I haven't known how to do it.
These environment variables are described at https://hub.docker.com/r/teddysun/go-shadowsocks2, PASSWORD is masked because I don't want to share it, must be set same at server and client side (METHOD also must be the same on both sides since this defines protocol cipher algorithm).--------------------------------------------------------------
/container/envs/add name=shadowsocks_envs key=TZ value="Europe/Madrid"
/container/envs/add name=shadowsocks_envs key=DNS_ADDRS value=192.168.4.2 <---- This is the Pi-Hole veth address
/container/envs/add name=shadowsocks_envs key=PASSWORD value="xxxxxxx" <---- obviously my password don't apears
/container/envs/add name=shadowsocks_envs key=SERVER_PORT value=443
/container/envs/add name=shadowsocks_envs key=METHOD value=AEAD_AES_128_GCM
/container/envs/add name=shadowsocks_envs key=ARGS value="-plugin v2ray-plugin -plugin-opts server;tls;host=xxx;logLevel=none" <---- and I don´t know if "host=xxx" is the problem
--------------------------------------------------------------
--------------------------------------------------------------
/container/mounts/add name=shadowsocks_acme src=nvme1-part1/disk1/shadowsocks/root/acme.sh dst=/root/.acme.sh
/container/mounts/add name=shadowsocks_tmp src=nvme1-part1/disk1/shadowsocks/root/tmp dst=/root/tmp
--------------------------------------------------------------
Arguments for v2ray-plugin (in ARGS) and tls certificate creation/renewal with acme.sh script are described here: https://github.com/teddysun/v2ray-plugin#usage and some not described arguments can be found in source code https://github.com/teddysun/v2ray-plugi ... er/main.go (part of source). Also these plugin options must be aligned in your client configuration (tls;host;path).Code: Select allvar ( ... flag.*
Masked host argument must be set to your public host.domain if you have or you can create it on some dyndns service and tls certificate must be created for it. Created cretificate with full chain (all certificates in chain must be in single PEM file with name fullchain.cer) and key (PEM file with name <your_public_host_domain>.key) must be placed into /root/.acme.sh/<your_public_host_domain>, more info about acme.sh at https://github.com/acmesh-official/acme.sh. Eg, if you have host with name myhost.net it will be:
I mounted /root/.acme.sh dir so that its content is persisted if I need to recreate container with new version and /root/tmp is for file transfer from ROS to container (read-only in container).Code: Select all/root/.acme.sh/myhost.net/fullchain.cer /root/.acme.sh/myhost.net/myhost.net.key
I guess your container is not starting because you didn't place any certificate but it is mandatory when using tls. To troubleshoot service, enable logging for this container and also set v2ray-plugin argument logLevel=debug and examine log in ROS.
ShadowsocksX-NG (Mac) Server Preferences:Could you share the configuration for deploying the go-shadowsocks2 client mode container?
I meant something else. Is it possible to run this container in client mode on Mikrotik. My server is set to ubuntuShadowsocksX-NG (Mac) Server Preferences:Could you share the configuration for deploying the go-shadowsocks2 client mode container?
ss-ng.png
I think yes, at least for non transparent proxy, but I never tried so I don't have something to share. Ofc, for non transparent setup you will need manually to add proxy address (container's IP/hostname) and proxy port in client OS/browser.I meant something else. Is it possible to run this container in client mode on Mikrotik. My server is set to ubuntu