The following sections describe various ways you can troubleshoot
Enabling Logging for Networking
/etc/default/networking file contains two settings for logging:
- To get
ifupdown2logs when the switch boots (stored in
- To enable logging when you run
systemctl [start|stop|reload] networking.service
This file also contains an option for excluding interfaces when you boot the switch or run
systemctl start|stop|reload networking.service . You can exclude any interface specified in
/etc/network/interfaces. These interfaces do not come up when you boot the switch or start/stop/reload the networking service.
Using ifquery to Validate and Debug Interface Configurations
ifquery to print parsed
interfaces file entries.
ifquery to pretty print
iface entries from the
interfaces file, run:
ifquery --check to check the current running state of an interface within the
interfaces file. It will return exit code 0 or 1 if the configuration does not match. The line
bond-xmit-hash-policy layer3+7 below fails because it should read
ifquery --checkis an experimental feature.
ifquery --running to print the running state of interfaces in the
interfaces file format:
ifquery --syntax-help provides help on all possible attributes supported in the
interfaces file. For complete syntax on the
interfaces file, see
man interfaces and
You can use
ifquery --print-savedstate to check the
ifupdown2 state database.
ifdown works only on interfaces present in this state database.
Debugging Mako Template Errors
An easy way to debug and get details about template errors is to use the
mako-render command on your interfaces template file or on
ifdown Cannot Find an Interface that Exists
If you are trying to bring down an interface that you know exists, use
ifdown with the
--use-current-config option to force
ifdown to check the current
/etc/network/interfaces file to find the interface. This can solve issues where the
ifup command issues for that interface was interrupted before it updated the state database. For example:
Removing All References to a Child Interface
If you have a configuration with a child interface, whether it's a VLAN, bond or another physical interface, and you remove that interface from a running configuration, you must remove every reference to it in the configuration. Otherwise, the interface continues to be used by the parent interface.
For example, consider the following configuration:
Notice that bond1 is a member of br0. If bond1 is removed, you must remove the reference to it from the br0 configuration. Otherwise, if you reload the configuration with
ifreload -a, bond1 is still part of br0.
MTU Set on a Logical Interface Fails with Error: "Numerical result out of range"
This error occurs when the MTU you are trying to set on an interface is higher than the MTU of the lower interface or dependent interface. Linux expects the upper interface to have an MTU less than or equal to the MTU on the lower interface.
In the example below, the swp1.100 VLAN interface is an upper interface to physical interface swp1. If you want to change the MTU to 9000 on the VLAN interface, you must include the new MTU on the lower interface swp1 as well.
Interpreting iproute2 batch Command Failures
iproute2 commands for performance reasons. A batch command contains
ip -force -batch - in the error message. The command number that failed is at the end of this line:
Command failed -:1.
Below is a sample error for the command 1:
link set dev host2 master bridge. There was an error adding the bond host2 to the bridge named bridge because host2 did not have a valid address.
Understanding the "RTNETLINK answers: Invalid argument" Error when Adding a Port to a Bridge
This error can occur when the bridge port does not have a valid hardware address.
This can typically occur when the interface being added to the bridge is an incomplete bond; a bond without slaves is incomplete and does not have a valid hardware address.
MLAG Peerlink Interface Drops Many Packets
Losing a large number of packets across an MLAG peerlink interface may not be a problem. Instead this could be occurring in order to prevent looping of BUM (broadcast, unknown unicast and multicast) packets. For more information, and how to detect these drops, read the MLAG chapter.