On 9. Mar 2022, at 16:41, Stefano Brivio <sbrivio@redhat.com> wrote:

On Wed, 9 Mar 2022 13:16:29 +0000
"Christopher.Miller@gd-ms.com" <Christopher.Miller@gd-ms.com> wrote:

Let me ask this.  Is there a way for me to assign IP addresses to
containers (maybe manually with the net command?), so they show up on
my dev network (not the 10.88.xx.xx network)?

Shameless plug that won't help with your issue right now: that's a use
case that's covered by passt (https://passt.top, not widely packaged, no
official Podman integration yet): there you get (by default) a
non-translated address, assigned by its own DHCP/DHCPv6/NDP server.

I don't know enough about Podman in general to answer this, just that
if your container is rootless, you can't skip NAT at the moment (as far
as I know).

This is possible using a macvlan network. The following instructions are for CNI.

First create the configuration file for your new network

/etc/cni/net.d/{your-network}.conflist
(please adapt to your network settings,
especially. you need to adjust your master device and set a name for your-network.)

{
   "cniVersion": "0.4.0",
   "name": “{your-network}",
   "plugins": [
      {
         "type": "macvlan",
         "master": "bn0",
         "ipam": {
            "type": "host-local",
            "ranges": [
                [
                    {
                        "subnet": "172.25.45.0/24",
                        "rangeStart": "172.25.45.1",
                        "rangeEnd": "172.25.45.254",
                        "gateway": "172.25.45.254"
                    }
                ]
            ],
            "routes": [
                {"dst": "0.0.0.0/0"}
            ]
         }
      },
      {
         "type": "tuning",
         "capabilities": {
            "mac": true
         }
      }
   ]
}

Start a container using network mac and ip, e.g.:

$ podman run --name foo \
             --rm --network {your-network} --mac-address 52:54:cf:cf:cf:10 --ip 172.25.45.197

Best
Christian


--
Stefano
_______________________________________________
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io