Table of Contents
IP forwarding lets a device pass packets between networks when the packets are addressed to another host. A Linux system that performs forwarding can act as a router. Forwarding packets still requires a route and a firewall policy that allows the intended traffic.

How a packet is forwarded
- The router receives an IP packet and checks whether the destination is one of its own addresses.
- For a packet to be forwarded, it looks up the destination. The most specific matching prefix normally wins within the selected routing table.
- It reduces the IPv4 time to live or the IPv6 hop limit and applies relevant forwarding rules. If allowed, it sends the packet toward the next hop or directly onto the destination link.
Static routes are configured manually. Dynamic routing protocols can learn routes. Either can supply routes the device uses to forward packets. See how a router directs traffic and use the CIDR calculator to check which addresses a route covers.

Read the Linux forwarding settings
sysctl net.ipv4.ip_forward
sysctl net.ipv6.conf.all.forwardingA value of 1 means the corresponding global setting is enabled. A value of 0 means it is off. These read-only commands do not require changing the host. Run them in the network namespace that matters for the workload. A missing IPv6 setting may mean IPv6 is unavailable in that environment. Details are in the Linux kernel IP sysctl documentation.
If forwarding is on but traffic still fails
Check the outgoing interface and route, the destination’s return route, and firewall logs for the forwarding path. A TCP or UDP port-forwarding rule is a separate NAT configuration. Enabling IP forwarding alone neither creates a port mapping nor restricts which networks can communicate. On a managed host, have the administrator confirm the intended routes and policy before changing anything.
Reader Comments 0
Sign in with email or Google to join the discussion.