In this article, we will show you the different methods of finding the default route or gateway IP address on different Linux desktop/server operating systems.
This article works on the following Linux distributions:
- Debian
- Ubuntu
- Linux Mint
- Fedora
- RHEL
- Rocky Linux
- CentOS
- OpenSUSE
- Kali Linux
- Arch Linux
- Manjaro, etc.
Topic of Contents:
- Finding the Default Route or Gateway Using the Ip Command
- Finding the Default Route or Gateway Using the Route Command
- Finding the Default Route or Gateway Using the Routel Command
- Conclusion
Finding the Default Route or Gateway Using the Ip Command
On most of the popular Linux distributions (i.e. Ubuntu/Debian/Linux Mint, Fedora, CentOS/RHEL/Rocky Linux), you can run the “ip” command as follows to find the default route or gateway IP address:
The default route or gateway IP address of your Linux distribution should be printed. In our case, the default route or gateway IP address is 192.168.189.2.
Finding the Default Route or Gateway Using the Route Command
On most of the popular Linux distributions (i.e. Ubuntu/Debian/Linux Mint, Fedora, CentOS/RHEL/Rocky Linux), you can run the “route” command as follows to find the default route or gateway IP address:
The default route or gateway IP address of your Linux distribution should be printed. In our case, the default route or gateway IP address is 192.168.0.1. The default route/gateway has the destination address 0.0.0.0 as you can see in the following screenshot:
Finding the Default Route or Gateway Using the Routel Command
To find the default route or gateway IP address of your Ubuntu/Debian desktop/server operating system, run the “routel” command as follows:
The default route or gateway IP address of your Ubuntu/Debian desktop/server operating system should be printed. In our case, the default route or gateway IP address is 192.168.189.2.
Conclusion
In this article, we showed you how to use the “ip” and “route” commands to find the default route or gateway IP address of most of the popular Linux distributions (i.e. Ubuntu/Debian/Linux Mint, Fedora, CentOS/RHEL/Rocky Linux). We also showed you how to use the “routel” command to find the default route/gateway IP address of the Ubuntu/Debian desktop/server operating system.