LinuxでMTU(IPv4)をテストする

LinuxでMTU(IPv4)をテストする

ICMPエコーとレスポンスを除くすべてのICMPメッセージがファイアウォールレベルでブロックされる複数のネットワークがあることがわかりました。

私は必要があることを知っています。少なくともMTUネゴシエーションでは、IPv4のICMPメッセージタイプ3を許可する必要があります。

次のコマンドを使用してパケットをスニッフィングできます。

sudo tcpdump icmp

しかし、グローバルテストのためにリモートポイントでICMPパケットタイプ3をどのように生成しますか?

ベストアンサー1

提供するには、ICMP Type 3「宛先に到達できません」パケットが必要です。健康IP接続。

テストのためにICMPパケットタイプ3を生成する最も簡単な方法は、このnpingプログラムを使用することです。

このnpingプログラムはソフトウェアパッケージの一部なので、インストールnmapが必要です。これを行うには、次のことを行う必要があります。

sudo apt install nmap

インストール後にリモートLinuxシステムをテストするには、リモート側で実行を開始してICMPタイプ3および4パケットを受信します。

sudo tcpdump  'icmp[0] = 3'

または

sudo tcpdump  '(icmp[0] = 3) and (host ip_or_dns_of_nping_sender)'     

次に、他のシステム/エンドにICMP Type 3パケットを送信させます。

sudo nping --icmp-type 3 ip_or_dns_of_remote

必ず双方向でテストしてみてください。

たとえば、ループバックインターフェイスを使用してローカルシステムのテストを表示します。

最初の端末からICMP Type 3メッセージを受信します。

$sudo tcpdump  -i lo 'icmp[0] = 3'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
21:37:44.089420 IP localhost > localhost: [|icmp]
21:37:45.090092 IP localhost > localhost: [|icmp]
21:37:46.091289 IP localhost > localhost: [|icmp]
21:37:47.093095 IP localhost > localhost: [|icmp]
21:37:48.095019 IP localhost > localhost: [|icmp]
^C
5 packets captured
10 packets received by filter
0 packets dropped by kernel

2 番目の端末で - ICMP タイプ 3 メッセージを送信します。

$sudo nping --icmp-type 3 localhost
Starting Nping 0.6.47 ( http://nmap.org/nping ) at 2017-03-06 21:37 WET
SENT (0.0221s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable     (type=3/code=0) ttl=64 id=40477 iplen=28 
RCVD (0.2088s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable  (type=3/code=0) ttl=64 id=40477 iplen=28 
SENT (1.0228s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
RCVD (1.2088s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
SENT (2.0240s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
RCVD (2.2088s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
SENT (3.0258s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
RCVD (3.2088s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
SENT (4.0277s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 
RCVD (4.2088s) ICMP 127.0.0.1 > 127.0.0.1 Destination unreachable (type=3/code=0) ttl=64 id=40477 iplen=28 

Max rtt: 186.715ms | Min rtt: 181.081ms | Avg rtt: 184.307ms
Raw packets sent: 5 (140B) | Rcvd: 5 (140B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 4.24 seconds

アクセスできない

おすすめ記事