In Linux network engineering, determining whether an interface is configured to route packets, perform Reverse Path Filtering (RPF), or accept multicast forwarding usually involves rummaging through various virtual files scattered across /proc/sys/net/ipv4/conf/ and /proc/sys/net/ipv6/conf/. To streamline this diagnostic process and provide a unified, atomic interface directly into the kernel\u2019s routing configuration subsystem, the iproute2 suite includes the specialized command ip netconf. With ip netconf, administrators can query kernel-level IPv4 and IPv6 interface runtime flags instantaneously.
Understanding the Role of ip netconf in Linux Networking
The ip netconf command communicates with the kernel via the Netlink NETLINK_ROUTE bus (specifically the RTM_GETNETCONF message family). It exposes crucial operational state flags governing IP packet ingress and egress behavior:
- forwarding: Confirms whether the kernel is actively routing transit packets arriving on the interface.
- rp_filter (Reverse Path Filtering): Displays the active spoofing protection level (0 = disabled, 1 = strict validation, 2 = loose validation).
- proxy_neigh / proxy_arp: Reports whether the interface responds to ARP queries on behalf of hosts residing on adjacent network segments.
- mc_forwarding: Indicates whether multicast traffic routing is enabled on the device.
- ignore_routes_with_linkdown: Indicates whether the kernel automatically ignores routes bound to the device when its physical carrier state drops.
Querying Network Configuration Flags Across All Interfaces
To inspect runtime IP configuration settings across every network device on your Linux system:
ip netconf show
By default, ip netconf reports IPv4 parameters for the default template, the all aggregation group, and each individual interface:
inet default forwarding off rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
inet all forwarding off rp_filter loose mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
inet lo forwarding off rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
inet eth0 forwarding on rp_filter strict mc_forwarding off proxy_neigh off ignore_routes_with_linkdown on
inet wlan0 forwarding off rp_filter loose mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
Filtering by Specific Network Interface
To isolate diagnostic output to a single physical or virtual interface (e.g., eth0):
ip netconf show dev eth0
The output reports the exact operational parameters for that link:
inet eth0 forwarding on rp_filter strict mc_forwarding off proxy_neigh off ignore_routes_with_linkdown on
This allows immediate verification of routing and security policies:
forwarding on: Confirms that IP forwarding is active, allowing this node to act as a router or gateway.rp_filter strict: Confirms RFC 3704 strict reverse path filtering is active, preventing IP address spoofing.ignore_routes_with_linkdown on: Ensures dead gateway routes are bypassed if the link goes down.
Querying IPv6 Network Configuration Flags
IPv6 routing behavior differs significantly from IPv4, especially concerning router advertisements and multicast listeners. To inspect IPv6 configuration flags, pass the -6 flag:
ip -6 netconf show dev eth0
The IPv6 netconf query reveals protocol-specific parameters:
inet6 eth0 forwarding on mc_forwarding off proxy_neigh off ignore_routes_with_linkdown on
If IPv6 forwarding is enabled on an interface, the Linux kernel typically disables router advertisement (RA) processing unless accept_ra is explicitly configured to 2.
Using JSON Output for Scripting and Automation
When writing automated network health check scripts or container orchestration verification routines, use the -j (JSON) and -p (pretty print) flags:
ip -j -p netconf show dev eth0
The command emits clean, structured JSON:
[ {
"family": "inet",
"dev": "eth0",
"forwarding": true,
"rp_filter": "strict",
"mc_forwarding": false,
"proxy_neigh": false,
"ignore_routes_with_linkdown": true
} ]
You can pipe this output directly into jq to extract boolean configuration states programmatically:
ip -j netconf show dev eth0 | jq '.[0].forwarding'
Using ip netconf eliminates the need to parse raw /proc/sys/net/ files, providing reliable, scriptable network configuration introspection across all Linux distributions.