LibreNMS Docker Static Address with ipvlan driver

Hi All

Just wonder if anyone got the librenms docker working with a static address while using the ipvlan driver while using a single static ip address for services that get spawned during the docker-compose up.

The goal of this post is to configure the docker-compose.override.yml or nano docker-compose.yml file to assign a SINGLE static address to the container and for all the services that get spawn during the docker-compose up to use this same static address.

I have already created a network called ipvlan-net-librenms which in the same subnet as the attached interface on the VM that is hosting the container.

docker network create -d ipvlan
–subnet 192.168.2.0/24
–gateway 192.168.2.21
–ip-range=192.168.2.150/29
-o ipvlan=l2
-o parent=ens160 ipvlan-net-librenms

Thanks

When i configure the following in the docker-compose.yml

networks:
default:
external:
name: ipvlan-net-librenms

And I issue the docker-compose up command and inspect the network for ipvlan-net-librenms

I can see IP’s been assigned to each service from the ip-range above

    "Containers": {
        "01bebc7b492baca09af75e0d2fbf11aef05816a9f729ba365e9fdd0a668a46e1": {
            "Name": "librenms_dispatcher",
            "EndpointID": "24b6748b0a435fadb220194c852869ea1d4f0d2e4bb7ddfd016e40a6bda143c2",
            "MacAddress": "",
            "IPv4Address": "192.168.2.150/24",
            "IPv6Address": ""
        },
        "05a9b9b048d4eabb0ac58cbd255f73adfeb30b623923439a5170e8db1c454924": {
            "Name": "librenms_rrdcached",
            "EndpointID": "50180dfe691c3124131be1c42cae7816a8295243d60fd3c20d2c1f570cc925f4",
            "MacAddress": "",
            "IPv4Address": "192.168.2.148/24",
            "IPv6Address": ""
        },
        "1dba4ee221aa667e97f7cbbd1bc35f2915a69ae2eb1ac1559199d06d704249bc": {
            "Name": "librenms_memcached",
            "EndpointID": "957d9aaced1050c678080ff9f64994df90227d29b9c5c2cf21eb38090734ca9a",
            "MacAddress": "",
            "IPv4Address": "192.168.2.146/24",
            "IPv6Address": ""
        },
        "2412285091ca757a32e2772685c0d8fbfd3828944c5d8b9bd5d32be149f35268": {
            "Name": "librenms_msmtpd",
            "EndpointID": "d3f0c4b20cfcfda0e9136a74802f9d2f368c4bb6c27881d07b33f4b1be77dffb",
            "MacAddress": "",
            "IPv4Address": "192.168.2.147/24",
            "IPv6Address": ""
        },
        "3019e6e346614bf0f50c30aedf097bbef6a2f887c9564e4fff3b4799210dbaad": {
            "Name": "librenms_syslog",
            "EndpointID": "8bf2440ddb0dbe1c88f81cf8d41c39cafd75191a39f9852401e4bc7d8b9eda97",
            "MacAddress": "",
            "IPv4Address": "192.168.2.151/24",
            "IPv6Address": ""
        },
        "8aad46949663b4c14dd96ad47915bfd3a2126ee59fbbc14154c2b90e8f01a1cd": {
            "Name": "librenms_db",
            "EndpointID": "0e59d60e4e4e8a1a96d7938ed5aa1a084bd399825a872b7ec3a06a36411bacb5",
            "MacAddress": "",
            "IPv4Address": "192.168.2.144/24",
            "IPv6Address": ""
        },
        "b5278f455cfcc4ea5b3df6911e20aad6a8b5edb1c9aba2ce409f4e8b6c738d9b": {
            "Name": "librenms",
            "EndpointID": "73db7082abd113b02fc4f9358ffd315f33e63dad6f887bc797c669caaf32422d",
            "MacAddress": "",
            "IPv4Address": "192.168.2.149/24",
            "IPv6Address": ""
        },
        "c84224bc76736829397fa8118b842cff559acd5ace9f851746b70c86ff8bd310": {
            "Name": "librenms_redis",
            "EndpointID": "d12b8d567cd7097eb7e633cc7015fdb386f8f7f5a5bc4731b61a98a0fe9024c6",
            "MacAddress": "",
            "IPv4Address": "192.168.2.145/24",
            "IPv6Address": ""
        }
    },

I would like to use only one IP for the above.