How can I check the IP address and gateway address on CentOS?
To view the IP address and gateway address of CentOS, you can use the following command:
- View IP address.
ifconfig
In the output, you can find lines that start with “inet”, and the value following it is the IP address.
- Check the gateway address:
route -n
Find the row in the output where the destination in the target column is 0.0.0.0, then locate the corresponding value in the gateway column, which will be the gateway address.