« Back to Networking: 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 192.168.1.1 dev ens18 proto static 
192.168.1.0/24 dev ens18 proto kernel scope link src 192.168.1.150

The default gateway on this system is 192.168.1.1.

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

Other questions related to Networking

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!