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.