Hi Laurent,

Why are you using fe80::/112 as a subnet? This is a link-local address which has a special meaning for ipv6, you should not use this address space and I don't expect this to work.
If you use podman network create --ipv6 it will create a random private ipv6 subnet for you.

---
Paul

On Mon, Nov 21, 2022 at 5:13 PM Laurent Meunier <laurent@deltalima.net> wrote:
Hello,

I would like to create rootful containers with static IPv4 and IPv6
addresses that are part of my network (containers that somehow act as
physical devices on my network).
 From what I understand in the documentation [1], the macvlan driver
should be my preferred option with netavark.

[1]
https://github.com/containers/podman/blob/main/docs/tutorials/basic_networking.md#macvlan


My problem is that I get an error when starting a container attached to
a macvlan network created with an IPv6 subnet:
> Error: netavark: failed configure macvlan: IO error: failed to add route: Invalid argument (os error 22)

FYI, as long as the maclan network is created without IPv6 subnet, I can
create new podman containers without error.


[root@fedora-server ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
state UP group default qlen 1000
     link/ether 52:54:00:fd:e8:df brd ff:ff:ff:ff:ff:ff
     inet 192.168.122.2/24 brd 192.168.122.255 scope global dynamic
noprefixroute enp1s0
        valid_lft 2219sec preferred_lft 2219sec
     inet6 fe80::5054:ff:fefd:e8df/64 scope link noprefixroute
        valid_lft forever preferred_lft forever
[root@fedora-server ~]#
[root@fedora-server ~]# ip r
default via 192.168.122.1 dev enp1s0 proto dhcp src 192.168.122.2 metric
100
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.2
metric 100
[root@fedora-server ~]#
[root@fedora-server ~]# podman info |grep -i networkbackend
   networkBackend: netavark
[root@fedora-server ~]#
[root@fedora-server ~]# podman network create \
                           --driver macvlan \
                           --opt=parent=enp1s0 \
                           --subnet 192.168.122.0/24 \
                           --gateway 192.168.122.1 \
                           --subnet fe80::/112 \
                           mynetwork
mynetwork
[root@fedora-server ~]#
[root@fedora-server ~]# podman run -it --rm \
                           --ip=192.168.122.97 \
                           --ip6=fe80::97 \
                           --network=mynetwork \
                           registry.fedoraproject.org/fedora:latest bash
Error: netavark: failed configure macvlan: IO error: failed to add
route: Invalid argument (os error 22)
[root@fedora-server ~]#
[root@fedora-server ~]# podman run -it --rm \
                           --ip=192.168.122.97 \
                           --network=mynetwork \
                           registry.fedoraproject.org/fedora:latest bash
Error: netavark: failed configure macvlan: IO error: failed to add
route: Invalid argument (os error 22)


I don't know what I'm doing wrong. Maybe I'm missing something important
from the documentation. Any help will be appreciated.


Thanks.
--
Laurent Meunier <laurent@deltalima.net>
_______________________________________________
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io