Enable IPv6 ULA, SLAAC Router Advertisements, NAT66, and E2E validation - #3104
Enable IPv6 ULA, SLAAC Router Advertisements, NAT66, and E2E validation#3104sferrogoo wants to merge 1 commit into
Conversation
eee6c24 to
c758369
Compare
|
@google/android-cuttlefish @adelva1984 @jemoreira PTAL |
… and E2E validation * Add IPv6 Unique Local Address (ULA) subnets fd00:cf:22::/64 (cvd-wbr) and fd00:cf:24::/64 (cvd-ebr) to cuttlefish-host-resources defaults and init script. * Configure dnsmasq to broadcast IPv6 Router Advertisements for guest SLAAC autoconfiguration. * Implement native nftables masquerading (NAT66) and forwarding rules in cuttlefish-host-resources.init. * Add nftables dependency in base/debian/control. * Add E2E network integration test in //cvd/network_tests:network_tests verifying SLAAC IP acquisition, guest-to-host dual-stack communication, and pure IPv6-only operation.
cd09095 to
4f5ccc3
Compare
| t.Fatalf("Timed out waiting for ADB device connection: %v", adbErr) | ||
| } | ||
|
|
||
| // 1. Verify SLAAC IPv6 assignment on in-guest network interface |
There was a problem hiding this comment.
factorize or split up the test further instead of doing this
| var ip6Output e2etests.CommandOutput | ||
| var activeDev string | ||
| var gatewayIP string | ||
| for attempt := 1; attempt <= 15; attempt++ { |
| var activeDev string | ||
| var gatewayIP string | ||
| for attempt := 1; attempt <= 15; attempt++ { | ||
| // Check all potential network interfaces (wireless and ethernet bridges) |
There was a problem hiding this comment.
The following block is hard to reason about and this comment doesn't help.
| // 2. Verify guest-to-host IPv6 connectivity | ||
| t.Logf("Verifying dual-stack guest-to-host IPv6 connectivity (gateway %s on %s)...", gatewayIP, activeDev) | ||
| // Query detected router link-local address from neighbor table | ||
| neighOut, _ := c.RunCmd("adb", "shell", fmt.Sprintf("ip -6 neigh show dev %s", activeDev)) |
| } | ||
| t.Logf("Guest ULA: %s, Router LL: %s, Gateway ULA: %s", guestIP, routerLL, gatewayIP) | ||
|
|
||
| connCmd := fmt.Sprintf("su 0 toybox ping -6 -c 3 -I %s %s || su 0 toybox ping -6 -c 3 -I %s %s || su 0 toybox ping -6 -c 3 %s", guestIP, gatewayIP, activeDev, routerLL, gatewayIP) |
| } | ||
| t.Logf("Dual-stack IPv6 connectivity successful:\n%s", connOut.Stdout) | ||
|
|
||
| // 3. Uninstall / Flush IPv4 (Simulate IPv6-Only environment) |
There was a problem hiding this comment.
deserves a different test; you are testing too many variables within the one test.
There was a problem hiding this comment.
Does this test depend on the test host actually having the defaults updated?
How can you run the test on a v4-only host?
| @@ -0,0 +1,159 @@ | |||
| // Copyright (C) 2026 The Android Open Source Project | |||
There was a problem hiding this comment.
This appears to have been added in another directory "network_tests" at the same level as the "networking_tests" directory. Perhaps this would be better with either:
- a different directory name, if the goal of these tests is different from the goal of tests in networking_tests/
- rolled into networking_tests/ as a new test file or a new test case
| iptables, | ||
| jq, | ||
| less, | ||
| nftables, |
Description
This change adds complete IPv6 support for Cuttlefish instances on the host and validates guest dual-stack and pure IPv6-only operation.
IPv6 Unique Local Addresses (ULA):
fd00:cf:22::/64oncvd-wbrandfd00:cf:24::/64oncvd-ebr./etc/default/cuttlefish-host-resources.Router Advertisements (SLAAC):
dnsmasqto broadcast SLAAC Router Advertisements for autonomous in-guest address assignment.NAT66 & Forwarding:
nftablesmasquerading and forwarding rules incuttlefish-host-resources.init.nftablespackage dependency tocuttlefish-baseindebian/control.Automated E2E Integration Testing:
//cvd/network_tests:network_testsverifying guest SLAAC acquisition, guest-to-host dual-stack communication, and 100% pure IPv6-only functionality after flushing IPv4.