Created
April 27, 2021 09:50
-
-
Save nomaster/9339e521f2e9dc260882af48781c39ce to your computer and use it in GitHub Desktop.
Podman network on existing bridge interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cniVersion": "0.4.0", | |
"name": "vlan24", | |
"plugins": [ | |
{ | |
"type": "bridge", | |
"bridge": "br24", | |
"ipam": { | |
"type": "static", | |
"routes": [ | |
{ | |
"dst": "0.0.0.0/0" | |
} | |
], | |
"addresses": [ | |
{ | |
"address": "10.11.0.17/24", | |
"gateway": "10.11.0.1" | |
} | |
] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This creates a podman network using an existing bridge interface on the host. In this case, it is used to directly attach the container to a VLAN 24, in which the host has otherwise no IP connectivity.
/etc/cni/net.d/vlan24.conflist
sudo podman network inspect vlan24
podman run -d --network vlan24 docker.io/nginx
curl -I http://10.11.0.17
Note that only one container can be started with the configuration above, which uses a single IP address. This can probably be expanded with specifying a network address and an additional range for the IP address leases.