Local network access issues for containers behind nordvpn container

Hi,

I'm experiencing an issue with my container setup passing trafic through a nordvpn container. I'll describe my environment and the problem I'm facing, in the hopes that you can help me find a solution.

Problem:

I want to use a NordLynx container to route the outgoing network traffic of my other containers through the nordvpn container. The nordvpn container connects successfully to the VPN, and I can verify that the network traffic of the other containers is passing through the VPN using the following commands:

  • podman exec nordvpn curl ifconfig.me: returns a VPN IP address
  • podman exec bazarr curl ifconfig.me: also returns the same VPN IP address
  • curl ifconfig.me: returns my real public IP address

However, the containers behind the VPN are inaccessible from my local network. For example, when I try to access the web interface of a container using the address http://192.168.1.16:6767/movies, the browser spins indefinitely and nothing happens.

How can I configure my environment to make the containers behind the VPN accessible from my local network, while still routing their network traffic through the VPN?

Environment:

  • OS: Ubuntu 22.04
  • podman version: 3.4.4
  • Configuration file:

version: "3.3"
services:
  nordvpn:
    image: ghcr.io/bubuntux/nordlynx
    container_name: nordvpn
    environment:
      - PRIVATE_KEY_FILE=/run/secrets/privatekey #required
      - ALLOWED_IPS=0.0.0.0/0
      - NET_LOCAL=192.168.1.0/24
    cap_add:
      - NET_ADMIN #required
      - NET_RAW
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=1 # Recommended if using ipv4 only
    secrets:
      - privatekey
    ports:
      - "6767:6767" # Bazarr
    restart: unless-stopped
  bazarr:
    image: lscr.io/linuxserver/bazarr:latest
    container_name: bazarr
    environment:
      - PUID=0
      - PGID=0
      - TZ=America/Toronto
    volumes:
      - "bazarr:/config:Z"
      - "/mnt/commun/media/shows:/tv:z" #optional
      - "/mnt/commun/media/movies:/movies:z" #optional
    network_mode: "service:nordvpn"
    depends_on:
      - nordvpn
    restart: unless-stopped

secrets:
  privatekey:
    file: ./privatekey.txt

volumes:
  bazarr:

Thank you for your help!