connect: Network is unreachable
Getting this?
[root@mdskvm-p01 yum.repos.d]# ping 8.8.8.8
connect: Network is unreachable
[root@mdskvm-p01 yum.repos.d]# ip route add default via 192.168.0.1
Solve it by donig this:
[root@mdskvm-p01 yum.repos.d]# ip route show
default via 192.168.0.1 dev enp2s0f0
192.168.0.0/24 dev enp2s0f0 proto kernel scope link src 192.168.0.39
[root@mdskvm-p01 yum.repos.d]#
[root@mdskvm-p01 yum.repos.d]#
[root@mdskvm-p01 yum.repos.d]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=15.9 ms
^C
— 8.8.8.8 ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 15.902/15.902/15.902/0.000 ms
[root@mdskvm-p01 yum.repos.d]#
Another solution to this issue is very basic. Suppose you ran the following command to add an IP:
ip addr add 192.168.0.100 dev eno1
What it actually does is this:
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 2c:44:fd:96:82:74 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.100/32 scope global eno1
Notice the /32. That means only that specific IP is accessible, the rest isn't. What you need to do is add the IPv4 CIDR notation as follows:
ip addr add 192.168.0.100/24 dev eno1
Thx,