harumaki.net

インフラ屋の覚書や、ラーメン食べある記とか。

infra Juniper network

[Juniper]SRX アプリケーション別のタイムアウト設定

投稿日:2014年1月28日

Last Updated on 2023年5月3日 by かんりにん

社内で利用しているアプリケーションのセッションが一定時間操作がない状態で切れてしまうため、回避のため設定を追加。
具体的にはTCPセッションにて、指定したポートの通信タイムアウトを指定する方法。

環境

まずデフォルトのタイムアウト設定を確認したところ、
TCPは30分、UDPで1分という設定がされている様子。

1)プリセットされた設定情報の確認

せっかくなのでpre-definedのアプリケーションに対する設定をちょっと見てみる。

rootでログインしてcliモードへ変更

root@host-A% cli

プリセットされた設定の確認

root@host-A% request pfe execute target fwdd command "show usp app-def tcp"
SENT: Ukern command: show usp app-def tcp
GOT:
GOT: tcp port=0, appl_name=junos-tcp-any, service type=0, alg id=0, timeout=1800
GOT: tcp port=21, appl_name=junos-ftp, service type=1, alg id=1, timeout=1800
GOT: tcp port=22, appl_name=junos-ssh, service type=22, alg id=0, timeout=1800
GOT: tcp port=23, appl_name=junos-telnet, service type=10, alg id=0, timeout=1800
GOT: tcp port=25, appl_name=junos-smtp, service type=7, alg id=0, timeout=1800
GOT: tcp port=43, appl_name=junos-whois, service type=46, alg id=0, timeout=1800
GOT: tcp port=49, appl_name=junos-tacacs, service type=0, alg id=0, timeout=1800
GOT: tcp port=53, appl_name=junos-dns-tcp, service type=16, alg id=16, timeout=1800
GOT: tcp port=65, appl_name=junos-tacacs-ds, service type=0, alg id=0, timeout=1800
GOT: tcp port=70, appl_name=junos-gopher, service type=39, alg id=0, timeout=1800
GOT: tcp port=79, appl_name=junos-finger, service type=17, alg id=0, timeout=1800
GOT: tcp port=80, appl_name=junos-http, service type=6, alg id=6, timeout=300
GOT: tcp port=110, appl_name=junos-pop3, service type=8, alg id=0, timeout=1800
GOT: tcp port=111, appl_name=junos-sun-rpc-tcp, service type=5, alg id=5, timeout=2400
GOT: tcp port=113, appl_name=junos-ident, service type=34, alg id=0, timeout=1800
GOT: tcp port=119, appl_name=junos-nntp, service type=35, alg id=0, timeout=1800
GOT: tcp port=135, appl_name=junos-ms-rpc-tcp, service type=55, alg id=55, timeout=60
GOT: tcp port=139, appl_name=junos-smb, service type=21, alg id=0, timeout=1800
・・・以下略

 

 

それぞれデフォルト値に設定されているので、変更する場合は以下を参考に。

2)カスタム設定の追加

今回はpre-definedアプリでなく独自の設定を加えるので、source、destの各ポート設定とタイムアウトを指定して実行。
以下の例では、

  • ポート30003番に対してソースはどこからでも受け付ける設定
  • タイムアウトは6時間に設定。

として設定。
※運用上6時間という長さが適切かどうかは置いといて…

設定実行

root@host-A# set applications application test-policy protocol tcp source-port 0-65535 destination-port 30003-30003 inactivity-timeout 21600
{primary:node0}[edit]
root@host-A#

→設定後にcommitを実行して適用。

root@host-A& commit

 

 

3)設定の確認

cliモードで”show configuration applications”を実行して、カスタム設定を確認。

root@host-A> show configuration applications
application test-policy {
protocol tcp;
source-port 0-65535;
destination-port 30003-30003;
inactivity-timeout 21600;
}

{primary:node0}
root@host-A>

上記で設定追加は終了。あとは対象のアプリにてセッションタイムアウトの状況を確認して、問題なければOK。

-infra, Juniper, network
-

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


関連記事

nagios snmp ディスク使用率表示スクリプトのカスタマイズ

  [pukiwiki] もともとcheck_snmp_storageを使用していたが、nagiosgraphでグラフを出力させるための perfdataの表示を、nagiosgraph側でパーティシ …

no image

[Juniper]SRX220 コンフィグのバックアップメモ

今回はSRX220Hのコンフィグのバックアップを。 ちょこっとドキュメントを見てみたところ、SSGの時と異なり、SRX側から外部のリモートホストへのtftpが使えないっぽい? もうちょっと詳しく調査し …

メモ:nagios NCPAについて

  客先のLAN環境に置いてあるnagiosをメンテする傍ら、情報収集をしていたら NCPAなるプラグイン?というかエージェント?を見かけたので、備忘録としてメモ。 NCPA http://excha …

RTX1200 事前共有キー/pre-shared-key で使用できる文字列について

  RTX1200へVPNクライアントソフト(YMS-VPN7)を使用してのIPsec接続のセットアップに際して 共有キーの文字列を乱数で生成してtextで登録し、接続テストをしたところ認証失敗のメッ …

no image

[MySQL] ZRM(Zmanda Recovery Manager) Mysql-zrm.conf パラメータ一覧をまとめてみた

ZRMを試すにあたって指定するmysql-zrm.confのパラメータを調べてみたので、そのまとめを。 オプションの一覧と説明の元ソースは、コマンド”mysql-zrm-backup&#8 …

宅麺