macOS에서 56바이트 이상 ping

macOS에서 56바이트 이상 ping

저는 macOS를 사용하고 있으며 터미널을 사용하여 ping을 수행하고 있습니다. 56바이트를 초과하여 ping하려면 어떻게 해야 합니까? 검색을 시도했지만 답변을 찾을 수 없었습니다.

답변1

ping -s 크기 주인

ping -s 1472 target.example.com

일반적인 헤더 길이를 사용하면 조각화 없이 단일 전체 크기 패킷을 생성하기 때문에 1472를 예로 들었습니다.

명령 옵션 에 대한 자세한 내용은 터미널에서 ping(1)명령을 사용하는 매뉴얼 페이지를 참조하세요 .man ping

답변2

핑을 보내는 호스트에게도 달려 있습니다.

mbp ~ % ping -s 1400 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 1400 data bytes
76 bytes from 8.8.8.8: icmp_seq=0 ttl=117 time=12.969 ms
wrong total length 96 instead of 1428
76 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=12.342 ms
wrong total length 96 instead of 1428
^C

mbp ~ % ping -s 1400 bbc.co.uk
PING bbc.co.uk (151.101.64.81): 1400 data bytes
1408 bytes from 151.101.64.81: icmp_seq=0 ttl=59 time=10.415 ms
1408 bytes from 151.101.64.81: icmp_seq=1 ttl=59 time=12.601 ms

위의 예에서 8.8.8.8은 전체 패킷으로 응답하지 않고 bbc.co.uk로 응답합니다. 하다

대신에 Linux에서도 비슷한 동작이 발생합니다.

wrong total length 96 instead of 1428

당신은 얻는다

truncated 

Linux의 동일한 예:

E520:~$ ping -s 1400 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 1400(1428) bytes of data.
76 bytes from 8.8.8.8: icmp_seq=1 ttl=117 (truncated)
76 bytes from 8.8.8.8: icmp_seq=2 ttl=117 (truncated)

E520:~$ ping -s 1400 bbc.co.uk
PING bbc.co.uk (151.101.192.81) 1400(1428) bytes of data.
1408 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=1 ttl=59 time=8.27 ms
1408 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=2 ttl=59 time=8.36 ms

관련 정보