
This way you know that your IP address and gateway is correctly set up. Test if you can reach or access both devices on your network as outside of it. How can I test if my network configuration is correct? Use the ip route command to show routing information, including the default gateway and the network interface it uses. Ip show link What command can I use to display the default gateway on Linux? On the systems running BSD, it is also the ifconfig tool that can be used.įrequently Asked Questions How can I see the MTU of an interface? To see only the interfaces which are active, add the -u (up) parameter. By using the -a parameter, all interfaces will be displayed. These two old style platforms have of course ifconfig still available. When it lists an asterisk (*), it means it uses the default gateway. The output will be something like this: Kernel IP routing tableĭestination Gateway Genmask Flags MSS Window irtt Iface The default gateway can be listed with the netstat command. The output may look like this: default via 123.12.0.1 dev eth0 onlinkġ0.17.0.0/16 dev eth0 proto kernel scope link src 10.17.0.3ġ23.12.0.0/18 dev eth0 proto kernel scope link src 123.123.0.3 With netstat

On Linux systems, this gateway is typically received via DHCP or manually configured in a text configuration file. The default gateway is the system that receives traffic for networks outside your own. Note: the column command is optional, but provides a friendlier output for the eye. Linux network interfaces with ip link show commandĪnother option to show available network interfaces is by using netstat. The easiest way to see what network interfaces are available is by showing the available links. Especially when using containerized applications, dynamic routing, and network aliases. It is advised to start using this command instead of ifconfig, as its output works better with newer machines. Newer Linux distributions now ship only the ip command. The ifconfig command on Linux actually has the most option available, so have a look at the man page for all details. If you still have ifconfig available, run it with the -a parameter.ĭepending on what particular information you need, you can use grep to get you the right lines.

As some systems no longer have that command installed by default, we will also look at using alternative ip. Previously the most obvious command to obtain the available network interfaces was using the ifconfig command. So these commands should be working on the popular distributions like Arch Linux, CentOS, Debian, Gentoo, RHEL, and Ubuntu. Therefore, it is good to know which tools can be used to query these details in a generic way.
