Setting listenaddress for CheckMK community edition?

CMK version: 2.5.0p17 Community Edition (Container)

OS version: VyOS Stream 2026.03 (Linux vyos 6.6.128-vyos #1 SMP Mon Mar 16 10:04:04 UTC 2026 x86_64 GNU/Linux, Podman version 4.9.5)

Error message:

In my tests of CheckMK being a container where the host have two VRFs I have managed to “lock” the webgui through defining apache IP-address by entering the container and run “omd config ”.

Is this the only way to change which IP the apache webserver should listen too (using omd in cli)?

Also how to do similar of which IP to be used as source IP for outgoing SNMP gets/walks?

What I want to achieve is that IP for VRF MGMT should be used for webgui and IP for VRF PROD should be used for all other services.

This depends on your network configuration inside your container environment and how is your routing configured. Normally the IP of your interface with the default gateway is used.
I asked your question, the AI of my least distrust. :wink:
The anwer was very long and in the end it said - “yes it is possible” - the problem in the answer and why it is so long is the problem, asymmetric routing. As i don’t know VyOS by myself, i cannot verify if the answer is ok.

The container see the host-networks.

But I fail to locate this variable inside CheckMK (or if its a cfg-file since its the community edition).

I mean I can configure which IP the webgui should listen at by “omd config ” but I cant figure out how to do the same for egress SNMP queries.

This has nothing to do with CheckMK.

It is only a configuration on container level and network traffic routing.

As you know the VyOS you can say if the writing from Claude can be valid :wink:

############# AI Output #############

Yes, this is doable. The approach: the container gets two Podman networks, one per VRF, and therefore two interfaces. VyOS lets you bind a container network to a VRF (set container network <name> vrf <vrf>). You can check whether your release supports it with set container network TEST vrf ?. It should be available in 1.4/1.5 or rolling.

Layout

                VRF MGMT                         VRF PROD
  MGMT clients ──► eth1 ──DNAT──► pod-mgmt   pod-prod ──► eth2 ──► other devices
                                  172.16.10.0/24   172.16.20.0/24
                                        │               │
                                   eth0 (container)  eth1 (container)
                                   172.16.10.10      172.16.20.10
                                        └── Apache :8000 ──┘

Configuration (example)

# VRFs (if not already present)
set vrf name MGMT table 100
set vrf name PROD table 200
set interfaces ethernet eth1 vrf MGMT
set interfaces ethernet eth2 vrf PROD

# Container networks, each bound to a VRF
set container network mgmt prefix 172.16.10.0/24
set container network mgmt vrf MGMT
set container network prod prefix 172.16.20.0/24
set container network prod vrf PROD

# Container attached to both networks
set container name web image <your-image>
set container name web network mgmt address 172.16.10.10
set container name web network prod address 172.16.20.10

VyOS creates the bridges pod-mgmt and pod-prod for these, each placed in the matching VRF.

Inbound via MGMT: DNAT

set nat destination rule 10 inbound-interface name eth1
set nat destination rule 10 protocol tcp
set nat destination rule 10 destination port 8000
set nat destination rule 10 translation address 172.16.10.10
set nat destination rule 10 translation port 8000

Use DNAT here rather than Podman port mapping (port). Port mapping would otherwise listen in the default VRF, not in MGMT.

The real catch: asymmetric routing

The container should have its default route via PROD (172.16.20.1). Replies to MGMT clients would then also leave via PROD and get dropped. There are three ways to fix this:

Option A: SNAT on VyOS (simplest, recommended). VyOS masquerades MGMT requests to the gateway IP 172.16.10.1. The container then only sees a directly connected network and replies correctly via eth0.

set nat source rule 10 outbound-interface name pod-mgmt
set nat source rule 10 protocol tcp
set nat source rule 10 destination port 8000
set nat source rule 10 translation address masquerade

The downside: Apache only sees 172.16.10.1 in its logs instead of the real client IP.

Option B: Policy routing inside the container. This requires set container name web capability net-admin and an entrypoint script, for example:

ip route add default via 172.16.10.1 dev eth0 table 100
ip rule add from 172.16.10.10 table 100

This preserves the real client IPs.

Option C: Static routes inside the container. Here you route only the MGMT subnets via 172.16.10.1 and everything else by default via PROD. This works as long as MGMT and PROD destinations don’t overlap.

Making PROD the default route

With multiple networks, Podman/netavark sets a default route for each one, and the metric depends on the order. Check it with:

sudo podman exec web ip route

If the wrong route wins, fix it in the entrypoint (with net-admin): delete the default route via eth0 and keep only default via 172.16.20.1.

Outbound via PROD

On the VyOS side, VRF PROD must either route 172.16.20.0/24 to its peers (statically or via BGP/OSPF in the VRF) or masquerade it on eth2:

set nat source rule 20 outbound-interface name eth2
set nat source rule 20 source address 172.16.20.0/24
set nat source rule 20 translation address masquerade

Hardening

Since Apache listens on 0.0.0.0:8000, it’s also reachable via the PROD IP. Either set Listen 172.16.10.10:8000 in Apache, or block inbound traffic to port 8000 from PROD toward 172.16.20.10 in the VyOS firewall.

If you tell me your VyOS version and your actual subnets, I can put together the exact configuration for you.

Well those AI/LLM’s are mostly hallucinating.

You cannot assign more than one network to a container in podman using VyOS.

When you point that out to the “AI” it will “Oh sorry, you are correct…”.

There are various complex ways to deal with this using veth and SNAT/DNAT etc at the host to make it work but its really inefficient.

Using “allow-host-networks” exposes the host network to the container and by that the container can interact directly with the vrf’s as long as the container application have support for such.

Which for example the CheckMK container doesnt as it seems.

When configuring apache listenaddress (webgui) through omd config <sitename> it only supports IPv6 or IPv4 addresses NOT with the vrf/interface postfix like so:

192.0.2.1%PROD or 192.0.2.1%eth1

But for ingress TCP this is usually no an issue since a regular listenaddress 192.0.2.1 (without the vrf/interface postfix) will still work (some kind of TCP-stack magic in Linux where it keeps track of which vrf was used for ingress of TCP and then use the same for returning traffic).

Where the vrf/interface postfix is needed is for UDP ingress and egress and TCP egress (since here that magic of keeping track of vrf must be manually defined).

But even without vrf/interface support I would like to define which IP CheckMK should be using as source IP when doing the SNMP queries towards other hosts.

Googling on this topic there should exist something to define source IP in Setup → Agents → SNMP rules, thats at least what the “AI” suggest.

But looking at Setup → Agents → SNMP rules there is no setting of “listenaddress” or “source IP” to configure. The closest is “UDP port used for SNMP” which really doesnt help me :slight_smile:

Out of the blue it seems that CheckMK mostly are designed to use a single IP-address for both management and production and not being designed for the usecase of having one vrf for MGMT and another vrf for PROD to be used (even if apache listenaddress by accident do work with vrfs since thats ingress TCP).

Current workaround since the container by default lives in vrf:Default (Local) is to setup a vrf-leak so that whatever lives in vrf:Default will use vrf:PROD as its default gateway:

set protocols static route 0.0.0.0/0 next-hop 192.168.1.254 vrf 'PROD'

This way all egress traffic from the container is forced out of the vrf PROD. However if the container would support configuring listenaddress and/or source IP to be used for egress traffic such as SNMP (along with the postfix of vrf/interface like %PROD) then I wouldnt need to setup vrf-leak at the host.

This is not a problem of CheckMK. It depends on the configuration of the OS and routing for the container base image. In the case of the CheckMK container you have a Ubuntu 22.04 as the base image. Keep in mind CheckMK container is not a single application container like a myssql server or nginx container.
I don’t know how far you can customise the network configuration inside the container without having problems on updates.