No Ubuntu 18.04, quando listo minhas rotas, recebo a seguinte saída:
root@ubuntu1804:~# ip route ls
default via 192.168.122.1 dev ens3 proto dhcp src 192.168.122.236 metric 100
192.168.122.0/24 dev ens3 proto kernel scope link src 192.168.122.236
192.168.122.1 dev ens3 proto dhcp scope link src 192.168.122.236 metric 100
Não entendo por que a segunda entrada 192.168.122.1
está listada e por que não possui uma máscara. Parece ser o IP do gateway, mas isso não acontece em outras distros. Segue minha configuração de rede:
root@ubuntu1804:~# ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.122.236 netmask 255.255.255.0 broadcast 192.168.122.255
inet6 fe80::5054:ff:fe83:1bdf prefixlen 64 scopeid 0x20<link>
ether 52:54:00:83:1b:df txqueuelen 1000 (Ethernet)
RX packets 657141 bytes 903750345 (903.7 MB)
RX errors 0 dropped 1128 overruns 0 frame 0
TX packets 161481 bytes 12399386 (12.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 8366 bytes 15784491 (15.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8366 bytes 15784491 (15.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@ubuntu1804:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.122.1 0.0.0.0 UG 100 0 0 ens3
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3
192.168.122.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens3
No fedora, por exemplo, não vejo essas rotas. A saída que recebo ao listar rotas é:
[root@myhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.1 0.0.0.0 UG 100 0 0 eth0
0.0.0.0 172.16.100.1 0.0.0.0 UG 101 0 0 eth1
172.16.100.0 0.0.0.0 255.255.255.0 U 101 0 0 eth1
192.168.100.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0