harumaki.net

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

infra Juniper network

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

投稿日:2014年1月28日

Last Updated on 2021年7月4日 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


関連記事

SNMPのTX/RXカウンタについて(YAMAHA RTX1200)

  会社のGWルーターに使用しているRTX1200のインターフェースのTX/RXカウントを LinuxサーバーからSNMPを使って累積でログに書き出していたところ、 32ビット長分に達するとリセットさ …

no image

クラスタリング/heartbeat

クラスタリング/heartbeat † 2台のホスト間でのクラスタリングを構成する。以下のような機能を提供する。 フェイルオーバ機能 2つのノードでアクティブ/スタンバイ構成とし、 フェ …

no image

net-snmp snmpd.logの設定を追加、変更

某VPSサービスで借りた仮想サーバーでsnmpdを動かしたところ、ログがどこにも出ていなかったのでログ出力設定を追加。 たまたまだと思いつつ、設定状況は環境によって様々だと思うので、ひとまず要点をいろ …

nagiosgraph​/メモ:nagiosグラフで出力されるレポートについて

  nagiosグラフで出力されるレポートについて † nagiosgraphをセットアップした時気になったことをツラツラと。 ↑ 1)自動で出力されるグラフについて &dag …

no image

[Juniper]SRX アカウント設定いろいろ

  SRXシリーズでのアカウントの各種設定をメモ書き。 コマンドラインから操作する場合は、原則configureモードで行う。 参考:お世話になっております! SRX Getting Started …