the lo is the loopback adapter , with ip address 127.0.0.1 which is used by operating system for its own internal communications.
/etc/network/interfacesand there is no separated file for gateway configuration :
/etc/network/interfaces.ddirectory for configuration files.
ifdown and ifup commands use this configuration file.
/etc/hosts(both Ubuntu , CentOS)
This shows us how the system is currently configured. If a packet comes into the system and has a destination in the range 172.16.43.0 through 172.16.43.255, then it is forwarded to the gateway *, which is 0.0.0.0 — a special address which represents an invalid or non-existant destination. So, in this case, our system will not route these packets.If the destination is not in this IP address range, it is forwarded to the default gateway (in this case, 172.16.43.2, and that system will determine how to forward the traffic on to the next step towards its destination.
Kernel maintains the routing cache information to route the packets faster. We can list the kernel’s routing cache information by using the -C flag.
netstat -rnalso shows routing table.
All the above settings will be lost after a system restart. use config files instead.
pingcommand is one of the most used utilities for troubleshooting, testing, and diagnosing network connectivity issues.
pingcommand, we can determine whether a remote destination IP is active or inactive. You can also find the round-trip delay in communicating with the destination and check whether there is a packet loss.
for ipv6 environment use ping6 command.
The non-complexity comes in the “and if that doesn’t work” rule. When multiple services are listed, they’re tried in order, and a sevice either succeeds or fails. If it fails, the next is tried, etc.