-1

You see, in my local Mac's network interface there is no 172.18.1.*:

$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether a0:99:9b:17:50:07 
    inet6 fe80::1cd7:aab1:4dc2:a07b%en0 prefixlen 64 secured scopeid 0x4 
    inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 4a:00:02:2c:3b:30 
    media: autoselect <full-duplex>
    status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 4a:00:02:2c:3b:31 
    media: autoselect <full-duplex>
    status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether 4a:00:02:2c:3b:30 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: <unknown type>
    status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 02:99:9b:17:50:07 
    media: autoselect
    status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
    ether 82:c0:df:ea:9f:d6 
    inet6 fe80::80c0:dfff:feea:9fd6%awdl0 prefixlen 64 scopeid 0x9 
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    inet6 fe80::da49:83e0:5dd9:264%utun0 prefixlen 64 scopeid 0xa 
    nd6 options=201<PERFORMNUD,DAD>

but I can ping the 172.18.1.*.

$ ping 172.18.1.20
PING 172.18.1.20 (172.18.1.20): 56 data bytes
64 bytes from 172.18.1.20: icmp_seq=0 ttl=251 time=9.472 ms
64 bytes from 172.18.1.20: icmp_seq=1 ttl=251 time=17.316 ms
64 bytes from 172.18.1.20: icmp_seq=2 ttl=251 time=7.546 ms
64 bytes from 172.18.1.20: icmp_seq=3 ttl=251 time=6.194 ms
^C
--- 172.18.1.20 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 6.194/10.132/17.316/4.308 ms
2
  • What is your question? You have given information, but never asked anything.
    – YLearn
    Commented Sep 1, 2018 at 17:05
  • @YLearn why i can ping the 172.18.1.20? i have no interface of this ip segment.
    – aircraft
    Commented Sep 1, 2018 at 17:07

1 Answer 1

3

Note that you can ping across a router by default. If you traceroute 172.18.1.20 you will likely find it behind your default gateway. The ttl=251 indicates that it's three hops away.

If your ping is not supposed to cross a router you need to use a TTL of 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.