Skip to content

fix(pasta): assign a fixed IPv6 address, gateway, and DNS to the netns - #620

Open
haytok wants to merge 1 commit into
rootless-containers:masterfrom
haytok:assign-fixed-ipv6
Open

fix(pasta): assign a fixed IPv6 address, gateway, and DNS to the netns#620
haytok wants to merge 1 commit into
rootless-containers:masterfrom
haytok:assign-fixed-ipv6

Conversation

@haytok

@haytok haytok commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Currently, curl -fsSL http://[${parent_ipv6}]:8080 fails when running hack/integration-ipv6.sh with --net=pasta.

This is because pasta copies the destination address ${parent_ipv6} into the isolated netns and the destination becomes a local address inside the netns.

To begin with, the only interface on the host with an available IPv6 route is the dummy interface (dummy42), so it is selected as the template, and its address and route are duplicated into the netns by nl_addr_dup() and nl_route_dup() [1].

As a result, the route to ${parent_ipv6} becomes local, the packets never leave the netns, and they do not reach the httpd running on the host.

To resolve this error, pass --address, --gateway, and --dns-forward when running pasta, so that a fixed IPv6 configuration is assigned to tap0 inside the netns.

child: fd00::100
gateway: fd00::2
DNS: fd00::3

With these options, pasta executes nl_addr_set() and nl_route_set_def() [1] in pasta.c instead of nl_addr_dup() and nl_route_dup(), and assigns the specified address and route to tap0 inside the netns.

As a result, ${parent_ipv6} is no longer duplicated into the netns, and when running curl -fsSL http://[${parent_ipv6}]:8080 inside the netns, packets leave the netns through tap0.

On the host side, pasta relays the connection to the httpd, so the curl now succeeds.

[1] https://passt.top/passt/tree/pasta.c

Currently, `curl -fsSL http://[${parent_ipv6}]:8080` fails when running
`hack/integration-ipv6.sh` with `--net=pasta`.

This is because pasta copies the destination address `${parent_ipv6}` into
the isolated netns and the destination becomes a local address inside the
netns.

To begin with, the only interface on the host with an available IPv6 route
is the dummy interface (`dummy42`), so it is selected as the template, and
its address and route are duplicated into the netns by `nl_addr_dup()` and
`nl_route_dup()` [1].

As a result, the route to `${parent_ipv6}` becomes `local`, the packets
never leave the netns, and they do not reach the httpd running on the
host.

To resolve this error, pass `--address`, `--gateway`, and `--dns-forward`
when running pasta, so that a fixed IPv6 configuration is assigned to tap0
inside the netns.

  child:   fd00::100
  gateway: fd00::2
  DNS:     fd00::3

With these options, pasta executes `nl_addr_set()` and
`nl_route_set_def()` [1] in `pasta.c` instead of `nl_addr_dup()` and
`nl_route_dup()`, and assigns the specified address and route to tap0
inside the netns.

As a result, `${parent_ipv6}` is no longer duplicated into the netns, and
when running `curl -fsSL http://[${parent_ipv6}]:8080` inside the netns,
packets leave the netns through tap0.

On the host side, pasta relays the connection to the httpd, so the curl
now succeeds.

[1] https://passt.top/passt/tree/pasta.c

Signed-off-by: Hayato Kiwata <dev@haytok.jp>
@AkihiroSuda AkihiroSuda added this to the v3.2.0 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants