Skip to content

Instantly share code, notes, and snippets.

@razhangwei
Last active July 4, 2024 05:59
Show Gist options
  • Save razhangwei/ad1f07ac8550d24dc07787fe67c4f748 to your computer and use it in GitHub Desktop.
Save razhangwei/ad1f07ac8550d24dc07787fe67c4f748 to your computer and use it in GitHub Desktop.
AdGuard Home OMV
  • MAC VLAN?

    • Why: To simplify port mapping.
    • How:
      • Method 1: defined in docker-compose.yaml (Preferred. See the attached snippet).
      • Method 2: created in OMV compose GUI. (Not recommended since it only support IPv6).
    • what the limiation?
      • the new ip from mac vlan can only be accessed from other local devices on the same LAN but not from the docker host. That means local request forwarding is possible by other services like Caddy.
  • How to support IPv6?

    • Add an IPv6 address in the MAC VLAN, define its gateway and subset.
    • Preferr to the publich

sub-mac-vlan

sudo ip link add mac0 link ens18 type macvlan mode bridge
sudo ip addr add 192.168.0.99/24 brd + dev mac0
sudo ip link set mac0 up

Issue (7/3/2025): still can't ping the adguard host (192.168.0.86/24)

References

  1. https://www.youtube.com/watch?v=X6LebvlVV-M
services:
adguardhome:
container_name: adguardhome
image: adguard/adguardhome
networks:
local_network:
ipv4_address: 192.168.0.86 # Existing IPv4 address
ipv6_address: 2601:647:6480:d7b0::86
volumes:
- ./workdir:/opt/adguardhome/work
- ./confdir:/opt/adguardhome/conf
restart: unless-stopped
ports:
- 53:53/tcp
- 53:53/udp
- 67:67/udp
- 68:68/udp
- 80:80/tcp
- 443:443/tcp
- 443:443/udp
- 3000:3000/tcp
- 853:853/tcp
- 784:784/udp
- 853:853/udp
- 8853:8853/udp
- 5443:5443/tcp
- 5443:5443/udp
networks:
local_network:
driver: macvlan
driver_opts:
parent: ens18
enable_ipv6: true
ipam:
config: # these info can be found the router management page. Confirm with ping and ping6
- subnet: 192.168.0.0/24
gateway: 192.168.0.1
- subnet: 2601:647:6480:d7b0::/64
gateway: 2601:647:6480:d7b0:82cc:9cff:fe0c:73ca
services:
adguardhome:
networks:
local_network: # IP addresses
ipv4_address: 192.168.0.86
ipv6_address: 2601:647:6480:d7b0::86
networks:
local_network:
driver: macvlan
driver_opts:
parent: ens18
enable_ipv6: true
ipam:
config: # these info can be found the router management page. Confirm with ping and ping6
- subnet: 192.168.0.0/24
gateway: 192.168.0.1 # address of the router
- subnet: 2601:647:6480:d7b0::/64
gateway: 2601:647:6480:d7b0:82cc:9cff:fe0c:73ca # address of the router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment