Staex logostaexDocs
Docs/IP Forwarding for Android

IP Forwarding for Android

Configure a parent node to forward IP traffic for Android clients in the Staex network.

Overview#

Android clients in a Staex MCC network rely on the parent node for both traffic routing and as a default gateway. The parent node must be configured to forward IP packets between the Android client and the rest of the MCC network.

Enable IP Forwarding#

Create a sysctl configuration file to enable IPv4 forwarding persistently:

bash
echo "net.ipv4.ip_forward=1" | sudo tee /etc/sysctl.d/01-ip-forward.conf
sudo sysctl -w net.ipv4.ip_forward=1

The first command persists the setting across reboots; the second applies it immediately.

Configure Firewall Rules#

Install iptables-persistent to manage firewall rules that survive reboots, then add NAT and filter rules for the MCC tunnel interface:

bash
sudo apt-get install iptables-persistent

Add NAT masquerading for traffic leaving the mcc0 interface, and appropriate FORWARD chain rules to allow traffic between the Android client and the MCC network.

Apply and Verify#

Test your new rules with iptables-apply to ensure they work correctly before committing them. If the rules cause connectivity problems, iptables-apply will automatically revert after a timeout. Once confirmed, enable the iptables service to load the rules at boot.