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


関連記事

no image

postfinger

[pukiwiki] #topicpath #contents *postfinger Simon Mudd氏作のpostfix用ユーティリティスクリプト。 #postfixのsrc.rpmを探してい …

no image

[Juniper]SRX ssh公開鍵認証でログイン

LinuxサーバーへdailyでSRXのコンフィグをバックアップするべく、tftpサーバーを設定しようと思ったら どうやらtftpらしきものがないので、sshでリモートコマンドを使ってコンフィグをとっ …

YAMAHAルーター設定tip

[pukiwiki] すべて製品に付属のマニュアルに載っているのでアレだけど、自分の備忘録用として。 **1)端末アクセス [#o642ebc3] 最近のノートPCにはシリアルケーブルが付属していない …

nagiosgraph​/4.グラフ設定例​/check_mem_pl

  [pukiwiki] *nagiosgraphへのグラフ設定追加例[check_mem.pl] [#d79c6d0f] nagios exchangeから取得したcheck_mem.plの実行結果 …

no image

ネットワークのドキュメント作成の際、グローバルIPを例示的に使いたいときは”IPv4 Examples”を使う

VPNやWebサーバーのNW図を書くことがよくありますが、グローバルIPを記載するとき “aaa.bbb.ccc.ddd/27″とかで表現するのがビミョーにわかりにくいのが悩み …