Skip to content

Instantly share code, notes, and snippets.

@ocodo
Last active October 20, 2026 03:45
Show Gist options
  • Select an option

  • Save ocodo/b93db23bfd6ea9f4bc267ee38bfb9066 to your computer and use it in GitHub Desktop.

Select an option

Save ocodo/b93db23bfd6ea9f4bc267ee38bfb9066 to your computer and use it in GitHub Desktop.

Waydroid networking troubleshooting summary

Goal

Get Waydroid connected to the internet and, preferably, the local LAN. The host LAN is 10.0.0.0/24, with gateway 10.0.0.1 and intended DNS resolver 10.0.0.2.

The approach is to retain Waydroid's existing waydroid0 bridge and provide correct forwarding and NAT. We have not migrated Waydroid onto the physical LAN subnet.

Host network

  • Host interface: enp3s0
  • Host IPv4: 10.0.0.33/24
  • LAN gateway: 10.0.0.1
  • Default route: via 10.0.0.1 on enp3s0
  • Host internet connectivity: confirmed
  • IPv4 forwarding: net.ipv4.ip_forward = 1

Waydroid network

  • Host bridge: waydroid0
  • Bridge address: 192.168.240.1/24
  • Android interface: eth0
  • Android address: 192.168.240.112/24
  • Android default route: via 192.168.240.1
  • DHCP: supplied by Waydroid's dnsmasq
  • Waydroid NAT: masquerading 192.168.240.0/24 traffic is configured in nftables table ip lxc

The Waydroid networking script is /usr/lib/waydroid/data/scripts/waydroid-net.sh. It creates the bridge, configures DHCP, and manages the inet lxc and ip lxc nftables tables. Do not modify this packaged script without a specific reason.

Root cause

The host's ip filter FORWARD chain, managed by iptables-nft, has a default policy of drop.

Waydroid already had forwarding accept rules in a separate nftables base chain, inet lxc. Those rules did not override the drop verdict from the host's ip filter FORWARD chain.

Two temporary runtime rules were added to ip filter FORWARD:

sudo nft add rule ip filter FORWARD iifname "waydroid0" accept
sudo nft add rule ip filter FORWARD oifname "waydroid0" accept

The first permits forwarding from Waydroid; the second permits forwarding back out through Waydroid.

These rules fixed the observed connectivity failure.

Verification

Before the fix:

  • Android could ping 192.168.240.1.
  • Android could not ping 1.1.1.1.
  • The NAT counter increased, confirming outbound traffic reached the masquerading rule.
  • A capture on enp3s0 showed translated requests leaving as 10.0.0.33 and replies returning from 1.1.1.1.
  • Those replies were not appearing on waydroid0.

After adding both forwarding rules, a capture on waydroid0 showed successful round-trip traffic:

192.168.240.112 > 1.1.1.1: ICMP echo request
1.1.1.1 > 192.168.240.112: ICMP echo reply

Three consecutive requests and replies were observed.

Current status and remaining work

  • Identify the actual host interface and LAN gateway.
  • Confirm IPv4 forwarding is enabled.
  • Confirm Waydroid's bridge, Android address, default route, and NAT configuration.
  • Identify the host firewall's forwarding drop as the connectivity blocker.
  • Add runtime forwarding rules and confirm ICMP replies reach waydroid0.
  • Confirm Android's own ping 1.1.1.1 succeeds.
  • Test DNS resolution using the intended resolver, 10.0.0.2.
  • Test access to local LAN hosts.
  • Make the forwarding fix persistent using a suitable firewall configuration that coexists with Docker, Tailscale, and Waydroid.

Important cautions

The two added rules are runtime-only and may disappear when firewall rules are reloaded or the host reboots. Do not consider persistence solved yet.

Do not create another bridge such as br0, enslave enp3s0 to a bridge, or change the host's NetworkManager configuration. Those actions are unnecessary for the current NAT-based solution and risk disrupting the host's LAN connection.

Do not change Waydroid's subnet to 10.0.0.0/24 merely to obtain internet access. The existing 192.168.240.0/24 subnet works with NAT; direct LAN presence is a separate design choice.

Continue interactively, one CLI step at a time, including the inspection command whenever a change is made. Avoid numbered instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment