0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

簡易TCPサーバを使ったポートへの疎通

Last updated at Posted at 2021-12-25

HPCクラスターのシステム構築時、スレーブノードから特殊なアプリケーションのライセンスサーバのTCPポートなどにて対してネットワーク疎通のテストを行いたいときがある。その際にアプリケーションのライセンスサーバがまだ導入されておらずポートに対してとりあえず仮テストしたい場合に、ncコマンドを使用して簡易的なTCPサーバを立ち上げ、そのポートに対して疎通テストを行うことができる。

■TCP簡易サーバの実行

TCPサーバ(例 port:12443)を立ち上げ複数ノードに対してリッスンする。

$ nc -klnv 12443

■スレーブノード(クライアント)からの疎通テスト実行

サーバIP(例:192.168.10.10)に対して疎通確認したいTCPポート(例:12443)に問い合わせてみる。

$ nc 192.168.10.10 12443

Hello  #文字入力してみる

■結果 TCP簡易サーバ側表示

$ nc -klnv 12443
Listening on 0.0.0.0 12443
Connection received on 192.168.10.5 50121

Hello #スレーブノードから文字が送信された。

スレーブノードからサーバのTCPポートに対して疎通が確認できた。
テストを終了するにはサーバ側のコンソールでCTRL+Cを入力する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?