Problem scenarios: Either you are using CentOS 7.x (and ifconfig is even not a command) or you are using ifconfig and different flags (like -v for verbose), but you cannot find the default gateway. How do you know if you have a default gateway even configured on a Linux server?
Solution The "ifconfig" command cannot show the default gateway. To find the default gateway on your Linux server, there are three different commands:
The "ip route" command will show the result by displaying "default via x.x.x.x..." The x.x.x.x is the IP address of the default gateway.