Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify an IPv6 CIDR? #349

Open
edysli opened this issue Nov 12, 2024 · 1 comment
Open

How to specify an IPv6 CIDR? #349

edysli opened this issue Nov 12, 2024 · 1 comment
Labels
area/ipv6 IPv6 enhancement New feature or request

Comments

@edysli
Copy link

edysli commented Nov 12, 2024

I'm trying to use slirp4netns for a single-stack IPv6, rootless Kubernetes cluster using k3s and can't find a way to specify the IPv6 CIDR to use. The --cidr=CIDR option apparently only accepts IPv4 addresses and I don't see any equivalent option for IPv6.
k3s generates the following command, but it fails:

$ slirp4netns --mtu 65520 -r 3 --disable-host-loopback --cidr fd5b:e9ce:dffb:cafe::/64 --enable-ipv6 12331 tap0
WARNING: Support for IPv6 is experimental
invalid CIDR: fd5b:e9ce:dffb:cafe::/64

How shall I specify the IPv6 CIDR to use?

version info:

$ slirp4netns --version
slirp4netns version 1.2.0
commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
libslirp: 4.7.0
SLIRP_CONFIG_VERSION_MAX: 4
libseccomp: 2.5.5
@AkihiroSuda
Copy link
Member

Currently hard-coded

slirp4netns/slirp4netns.c

Lines 263 to 272 in ee1542e

inet_pton(AF_INET6, "fd00::", &cfg.vprefix_addr6);
cfg.vprefix_len = 64;
inet_pton(AF_INET6, "fd00::2", &cfg.vhost6);
cfg.vhostname = NULL;
cfg.tftp_server_name = NULL;
cfg.tftp_path = NULL;
cfg.bootfile = NULL;
cfg.vdhcp_start = s4nn->vdhcp_start;
cfg.vnameserver = s4nn->vnameserver;
inet_pton(AF_INET6, "fd00::3", &cfg.vnameserver6);

@AkihiroSuda AkihiroSuda added enhancement New feature or request area/ipv6 IPv6 labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipv6 IPv6 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants