« Back to Frequently Asked Questions

How to see the default gateway on Linux

The ip command can help with discovering the default gateway on a Linux system.

List the routing table

Using the route subcommand, we can retrieve or configure routing information on the system. By just specifying this subcommand, the routing table will be displayed.

# ip route
default via dev ens18 proto static dev ens18 proto kernel scope link src

The default gateway on this system is

Learn more about ip

This article uses the ip command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: ip

ip cheat sheet


Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution.

Mastodon icon