2

I've built a CentOS 7.3 VM using VirtualBox. This VM has the following interface:

[root@localhost ~]# ip addr show enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:fa:df:f8 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86063sec preferred_lft 86063sec
    inet6 fe80::68e5:f976:c846:7881/64 scope link
       valid_lft forever preferred_lft forever

When I try to ping this address, I get:

[root@localhost ~]# ping -c 3 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.
64 bytes from 10.0.2.15: icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from 10.0.2.15: icmp_seq=2 ttl=64 time=0.034 ms
64 bytes from 10.0.2.15: icmp_seq=3 ttl=64 time=0.034 ms

--- 10.0.2.15 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.027/0.031/0.034/0.007 ms

However the ping command fails when I specify the interface name in my ping command:

[root@localhost ~]# ping -c 3 -I enp0s3 10.0.2.15
PING 10.0.2.15 (10.0.2.15) from 10.0.2.15 enp0s3: 56(84) bytes of data.

--- 10.0.2.15 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2001ms

Another thing I noticed is that this problem appears to be specific to CentOS 7.3. The same command works fine on a CentOS 7.2 VM:

[root@localhost ~]# ip addr show enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:12:a3:c1 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86226sec preferred_lft 86226sec
    inet6 fe80::a00:27ff:fe12:a3c1/64 scope link
       valid_lft forever preferred_lft forever


[root@localhost ~]# ping -c 3 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.
64 bytes from 10.0.2.15: icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from 10.0.2.15: icmp_seq=2 ttl=64 time=0.031 ms
64 bytes from 10.0.2.15: icmp_seq=3 ttl=64 time=0.032 ms

--- 10.0.2.15 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.021/0.028/0.032/0.005 ms


[root@localhost ~]# ping -c 3 -I enp0s3 10.0.2.15
PING 10.0.2.15 (10.0.2.15) from 10.0.2.15 enp0s3: 56(84) bytes of data.
64 bytes from 10.0.2.15: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 10.0.2.15: icmp_seq=2 ttl=64 time=0.031 ms
64 bytes from 10.0.2.15: icmp_seq=3 ttl=64 time=0.030 ms

--- 10.0.2.15 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.026/0.029/0.031/0.002 ms

Why does this work in CentOS 7.2 but not CentOS 7.3?

0

You must log in to answer this question.

Browse other questions tagged .