デフォルト以外のパステーブルでpingテストを実行するには?

デフォルト以外のパステーブルでpingテストを実行するには?

私のホームネットワークのルーターとして機能するLinuxボックスがあります。 3つのルーティングテーブルがあります。

# ip route show default
default via 192.168.5.1 dev wlp2s0
172.18.231.140/30 dev wwx0c5b8f279a64  proto kernel  scope link  src 172.18.231.141
192.168.0.0/24 dev enp1s0  proto kernel  scope link  src 192.168.0.110
192.168.1.0/24 dev enp3s0  proto kernel  scope link  src 192.168.1.10
192.168.5.0/24 dev wlp2s0  proto kernel  scope link  src 192.168.5.100

#ip route show table ISP1
default via 192.168.0.1 dev enp1s0
192.168.0.0/24 dev enp1s0  proto kernel  scope link  src 192.168.0.110
192.168.1.0/24 dev enp3s0  proto kernel  scope link  src 192.168.1.10

# ip route show table ISP2
default via 172.18.231.142 dev wwx0c5b8f279a64
172.18.231.140/30 dev wwx0c5b8f279a64  proto kernel  scope link  src 172.18.231.141
192.168.0.0/24 dev enp1s0  proto kernel  scope link  src 192.168.0.110
192.168.1.0/24 dev enp3s0  proto kernel  scope link  src 192.168.1.10

一般的に起こるのは、ネットワークに接続するすべてのクライアントがデフォルトゲートウェイを通過することです。必要に応じて、IPに一致するIPルールを追加し、クライアントがISP1テーブルまたはISP2テーブルを使用するように変更します。

ISP2 テーブルに接続されているモバイル ネットワーク "wwx0c5b8f279a64" が接続されているか、接続が失われたかどうかを確認したいのですが、Linux ボックスでは確認がデフォルト パス、つまり "wlp2s0" を通過するため、ping確認できません。相互作用。pingping

この問題を解決する方法はありますか?私はLinuxボックスのローカルトラフィックをISP2テーブルにルーティングできればうまくいくと思いましたが、ボックスのローカルトラフィックをISP2テーブルにルーティングする方法がわかりません。

ベストアンサー1

おそらくnping(通常の一部nmap)がここで役に立ちますか?マンページから:

--dest-mac mac (Ethernet Destination MAC Address) This option sets the destination MAC address that should be set in outgoing Ethernet frames. This is useful in case Nping can't determine the next hop's MAC address or when you want to route probes through a router other than the configured default gateway. The MAC address should have the usual format of six colon-separated bytes, e.g. 0:50:56:d4:01:98. Alternatively, hyphens may be used instead of colons. Use the word random or rand to generate a random address, and broadcast or bcast to use ff:ff:ff:ff:ff:ff. If you set up a bogus destination MAC address your probes may not reach the intended targets.

おすすめ記事