Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

show services sessions

date_range 13-Feb-24

Syntax

content_copy zoom_out_map
show services sessions 
<brief | extensive | terse>
<application-protocol protocol> 
<count> 
<destination-port destination-port>
<destination-prefix destination-prefix>
<interface interface-name>
<limit number> 
<nat number>
<nat-port-overload-index number>
<protocol protocol> 
<service-set service-set> 
<source-nat-pool source-nat-pool-name>
<source-port source-port> 
<source-prefix source-prefix> 
<utilization>

Description

Display session information.

Note:

On MX Series routers (with interchassis redundancy configured), the idle timeout for every flow is displayed in the show services session extensive and show services flows extensive commands.

Options

none

Display standard information about all sessions.

brief | extensive | terse

(Optional) Display the specified level of output.

application-protocol protocol

(Optional) Display information about one of the following application protocols:

  • bootp—Bootstrap protocols

  • dce-rpc—Distributed Computing Environment-Remote Procedure Call protocols

  • dce-rpc-portmap—Distributed Computing Environment-Remote Procedure Call protocols portmap service

  • dns—Domain Name System protocol

  • exec—Remote Execution Protocol

  • ftp—File Transfer Protocol

  • h323—H.323

  • icmp—ICMP

  • icmpv6—ICMPv6

  • iiop—Internet Inter-ORB Protocol

  • ike-esp-nat—IKE ALG

  • ip—IP

  • login—LOGIN

  • netbios—NETBIOS

  • netshow—NETSHOW

  • pptp—Point-to-Point Tunneling Protocol

  • realaudio—RealAudio

  • rpc—Remote Procedure Call protocol

  • rpc-portmap—Remote Procedure Call protocol portmap service

  • rtsp—Real-Time Streaming Protocol

  • rsh—Remote Shell

  • sip—Session Initiation Protocol

  • shell—Shell

  • snmp—SNMP

  • sql—SQLNet

  • talk—Talk Program

  • tftp—Trivial File Transfer Protocol

  • traceroute—Traceroute

  • winframe—WinFrame

Note:

You can use the none option with the show services sessions count application-protocol command to display information about sessions other than ALG sessions.

count

(Optional) Display a count of the matching entries.

destination-port destination-port

(Optional) Display information for the specified destination port. The range of values is from 0 to 65,535.

destination-prefix destination-prefix

(Optional) Display information for the specified destination prefix.

interface interface-name

(Optional) Display information about the specified interface. On M Series and T Series routers, interface-name can be ms-fpc/pic/port or rspnumber. On J Series routers, interface-name is ms-pim/0/port.

limit number

(Optional) Maximum number of entries to display.

nat

Display sessions with network address translation.

nat-port-overload-index Displays NAT port overload index; the range is 0 through 127.
protocol protocol

(Optional) Display information about one of the following IP types:

  • number—Numeric protocol value from 0 to 255

  • ah—IPsec Authentication Header protocol

  • egp—An exterior gateway protocol

  • esp—IPsec Encapsulating Security Payload protocol

  • gre—A generic routing encapsulation protocol

  • icmp—Internet Control Message Protocol

  • icmp6—Internet Control Message Protocol version 6

  • igmp—Internet Group Management Protocol

  • ipip—IP-within-IP Encapsulation Protocol

  • ospf—Open Shortest Path First protocol

  • pim—Protocol Independent Multicast protocol

  • rsvp—Resource Reservation Protocol

  • sctp—Stream Control Transmission Protocol

  • tcp—Transmission Control Protocol

  • udp—User Datagram Protocol

service-set service-set

(Optional) Display information for the specified service set.

source-nat-pool Displays the source NAT pool name.
source-port source-port

(Optional) Display information for the specified source port. The range of values is from 0 to 65,535.

source-prefix source-prefix

(Optional) Display information for the specified source prefix.

utilization

(Optional) Display statistical details about session utilization.

Required Privilege Level

view

Output Fields

Table 1 lists the output fields for the show services sessions command. Output fields are listed in the approximate order in which they appear.

Table 1: show services sessions Output Fields

Field Name

Field Description

Level of Output

Interface

Name of the interface.

application-protocol

Session

Session ID that uniquely identifies the session.

All levels

ALG

Name of the application.

terse

Flags

Session flag for the ALG:

  • 0x1—Found an existing session.

  • 0x2—Reached session or flow limit.

  • 0x3—No memory available for new sessions.

  • 0x4—No free session ID available.

  • 0x0000—No session ID found.

All levels

IP Action

Flag indicating whether IP action has been set for the session.

All levels

Offload

Flag indicating whether the session has been offloaded to the Packet Forwarding Engine.

All levels

Asymmetric

Flag indicating whether the session is uni-directional.

terse

application-protocol

Service set

Name of a service set. Individual empty service sets are not displayed.

count

Sessions Count

Number of sessions.

count

Sample Output

show services sessions

content_copy zoom_out_map
user@host> show services sessions  
ms-2/0/0
Session: 293, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    10.10.10.2:43677 ->    10.20.20.1:53    Forward  I 	      1
UDP	   10.20.20.1:53    ->        192.0.2.1:43677 Forward  O 	      1
Session: 53, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    10.10.10.2:37494 ->    10.20.20.1:53    Forward  I 	      1
UDP	   10.20.20.1:53    ->        10.11.11.11:37494 Forward  O 	      1
Session: 66, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    10.10.10.2:48161 ->    10.20.20.1:53    Forward  I 	      1
UDP	   10.20.20.1:53    ->        10.11.11.11:48161 Forward  O 	      1
Session: 17, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    10.10.10.2:38908 ->    10.20.20.1:53    Forward  I 	      1
UDP	   10.20.20.1:53    ->        10.11.11.11:38908 Forward  O 	      1
Session: 42, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    10.10.10.2:58189 ->    10.20.20.1:53    Forward  I 	      1
UDP	   10.20.20.1:53    ->        10.11.11.11:58189 Forward  O 	      1

show services sessions brief

The output for the show services flows brief command is identical to that for the show services sessions command. For sample output, see show services sessions.

show services sessions extensive

content_copy zoom_out_map
user@host> show services sessions extensive     
ms-0/1/0
Session: 2, ALG: 0, Flags: 0x0080, IP Action: no, Offload: no
NAT PLugin Data:
  NAT Action:   Translation Type - DYNAMIC NAT44
    NAT source         192.0.21.2         ->    10.10.10.127
TCP            192.0.2.2:52145 ->        198.51.100.2:23    Forward  I              22
  Byte count: 1483
  Flow role: Unknown, Timeout: 0
TCP            198.51.100.2:23    ->   10.10.10.127:52145 Forward  O              18
  Byte count: 2712
  Flow role: Unknown, Timeout: 0

show services sessions terse

content_copy zoom_out_map
user@router> show services sessions terse
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              33
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              31

show services sessions application-protocol

This command has the same output for the rpc, dce-rpc, rpc-portmap and dce-rpc-portmap ALGs.

content_copy zoom_out_map
user@router> show services sessions application-protocol dce-rpc
Interface name: ms-1/1/0
Session: 8, ALG: portmapper, Flags: 0x1800, IP Action: no, Offload: no
UDP    192.168.203.198:1019  ->192.168.203.194:2049  Forward  I               4
UDP    192.168.203.194:2049  ->192.168.203.198:1019  Forward  O               4
Session: 7, ALG: portmapper, Flags: 0x1800, IP Action: no, Offload: no
UDP    192.168.203.198:954   ->192.168.203.194:613   Forward  I               1
UDP    192.168.203.194:613   ->192.168.203.198:954   Forward  O               1
Session: 6, ALG: portmapper, Flags: 0x1800, IP Action: no, Offload: no
UDP    192.168.203.198:53836 ->192.168.203.194:613   Forward  I               1
UDP    192.168.203.194:613   ->192.168.203.198:53836 Forward  O               1
Session: 5, ALG: portmapper, Flags: 0x1000, IP Action: no, Offload: no
UDP    192.168.203.198:59813 ->192.168.203.194:111   Forward  I               1
UDP    192.168.203.194:111   ->192.168.203.198:59813 Forward  O               1
Session: 4, ALG: portmapper, Flags: 0x1800, IP Action: no, Offload: no
UDP    192.168.203.198:36595 ->192.168.203.194:2049  Forward  I               1
UDP    192.168.203.194:2049  ->192.168.203.198:36595 Forward  O               1
Session: 3, ALG: portmapper, Flags: 0x1000, IP Action: no, Offload: no
UDP    192.168.203.198:56050 ->192.168.203.194:111   Forward  I               1
UDP    192.168.203.194:111   ->192.168.203.198:56050 Forward  O               1

user@router> show services sessions application-protocol dns
Interface name: ms-2/0/0
Session: 293, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    198.51.100.2:43677 ->    203.0.113.10:53    Forward  I 	      1
UDP	   203.0.113.10:53    ->        192.0.2.1:43677 Forward  O 	      1
Session: 53, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    198.51.100.2:37494 ->    203.0.113.10:53    Forward  I 	      1
UDP	   203.0.113.10:53    ->        192.0.2.1:37494 Forward  O 	      1
Session: 66, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    198.51.100.2:48161 ->    203.0.113.10:53    Forward  I 	      1
UDP	   203.0.113.10:53    ->        192.0.2.1:48161 Forward  O 	      1
Session: 17, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    198.51.100.2:38908 ->    203.0.113.10:53    Forward  I 	      1
UDP	   203.0.113.10:53    ->        192.0.2.1:38908 Forward  O 	      1
Session: 42, ALG: 16, Flags: 0x0040, IP Action: no, Offload: no
UDP	    198.51.100.2:58189 ->    203.0.113.10:53    Forward  I 	      1
UDP	   203.0.113.10:53    ->        192.0.2.1:58189 Forward  O 	      1
user@router> show services sessions application-protocol ftp
Interface name: ms-4/1/0
Session: 1, ALG: 1, Flags: 0x0040, IP Action: no, Offload: no
TCP	      192.0.2.129:32843 ->       198.51.100.129:21    Forward  I 	     26
TCP	      198.51.100.129:21    ->        192.0.2.0:32843 Forward  O 	     30
user@router> show services sessions application-protocol ike-esp-nat
Service Set: ss_ipv4, Session: 33554435, ALG: ike-esp-nat, Flags: 0x0800, IP Action: no, Offload: no, Asymmetric: no
ESP 198.51.100.2:4689  ->        203.0.113.1:62108 Forward O 2199
ESP 192.0.2.2:62108  ->       198.51.100.2:4689 Forward I 0
Service Set: ss_ipv4, Session: 33554434, ALG: ike-esp-nat, Flags: 0x0800, IP Action: no, Offload: no, Asymmetric: no
ESP 192.0.2.2:44179  ->       198.51.100.2:43809 Forward I 2199
ESP 198.51.100.2:43809  ->       203.0.113.1:44179 Forward O 0
Service Set: ss_ipv4, Session: 33554433, ALG: ike-esp-nat, Flags: 0x0000, IP Action: no, Offload: no, Asymmetric: no
UDP 192.0.2.2:500  ->         198.51.100.2:500 Forward I 8
UDP 198.51.100.2:500  ->         203.0.113.1:57730 Forward O
user@router> show services sessions application-protocol pptp
Interface name: ms-2/0/0
Session: 3, ALG: pptp, Flags: 0x2800, IP Action: no, Offload: no, Asymmetric: no
GRE        203.0.113.138:0     ->    203.0.113.138:0     Forward  O              21
GRE        192.0.2.794:0     ->    203.0.113.138:0:65000 Forward  I               0
Session: 2, ALG: pptp, Flags: 0x2800, IP Action: no, Offload: no, Asymmetric: no
GRE        192.0.2.794:0     ->    203.0.113.138:0:49913 Forward  I              88
GRE        203.0.113.138:0:49913 ->    192.0.2.794:65001 Forward  O               0
Session: 1, ALG: pptp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP        192.0.2.794:1511  ->    203.0.113.138:0:1723  Forward  I              13
TCP        203.0.113.138:0:1723  ->    192.0.2.794:1511  Forward  O              12

user@router> show services sessions application-protocol rtsp
Interface name: ms-0/1/0
Session: 13, ALG: rtsp, Flags: 0x0800, IP Action: no, Offload: no
UDP	       203.0.113.66:5004  ->        198.51.100.66:3989  Forward  O 	    152
UDP	       198.51.100.66:3989  ->        192.0.2.161:5004  Forward  I 	      0
Session: 9, ALG: rtsp, Flags: 0x0800, IP Action: no, Offload: no
UDP	       203.0.113.66:5004  ->        198.51.100.66:3986  Forward  O 	      3
UDP	       198.51.100.66:3986  ->        192.0.2.161:5004  Forward  I 	      0

user@router> show services sessions application-protocol rsh
Interface name: ms-2/0/0
Session: 3, ALG: 2, Flags: 0x0840, IP Action: no, Offload: no
TCP	   203.0.113.10:1023  ->     198.51.100.2:1020  Forward  O 	      4
TCP	    198.51.100.2:1020  ->    203.0.113.10:1023  Forward  I 	      3
Session: 1, ALG: 2, Flags: 0x0040, IP Action: no, Offload: no
TCP	    198.51.100.2:1021  ->    203.0.113.10:514   Forward  I 	   1331
TCP	   203.0.113.10:514   ->     198.51.100.2:1021  Forward  O 	   2485
user@router> show services sessions application-protocol sip
Interface name: ms-2/0/0
Session: 4, ALG: sip, Flags: 0x0800, IP Action: no, Offload: no
UDP           198.51.100.130:6000  ->       192.0.2.129:12682 Forward  I             246
UDP           192.0.2.129:12682 ->       198.51.100.162:6000  Forward  O               0
Session: 1, ALG: sip, Flags: 0x0000, IP Action: no, Offload: no
UDP           198.51.100.130:5060  ->       192.0.2.130:5060  Forward  I              10
UDP           192.0.2.130:5060  ->       198.51.100.162:5060  Forward  O               9

user@router> show services sessions application-protocol sql
Interface name: ms-2/0/0
Session: 3934, ALG: sqlnet, Flags: 0x0800, IP Action: no, Offload: no
TCP	    198.51.100.2:39754 ->    203.0.113.138:0:1408  Forward  I 	     26
TCP	   203.0.113.138:0:1408  ->        192.0.2.1:39754 Forward  O 	     23

user@router> show services sessions application-protocol talk
Interface name: ms-0/2/0
Session: 4, ALG: 65, Flags: 0x0800, IP Action: no, Offload: no
TCP            203.0.113.162:36888 ->        192.0.2.2:33294 Forward  O               4
TCP            192.0.2.1:33294 ->        203.0.113.162:36888 Forward  I               3
Session: 7, ALG: 65, Flags: 0x0800, IP Action: no, Offload: no
UDP            203.0.113.162:1165  ->        192.0.2.2:518   Forward  O               1
UDP            192.0.2.2:518   ->        203.0.113.162:1165  Forward  I               1
Session: 8, ALG: 65, Flags: 0x0000, IP Action: no, Offload: no
UDP            192.0.2.2:1509  ->        203.0.113.162:518   Forward  I               3
UDP            203.0.113.162:518   ->        192.0.2.2:1509  Forward  O               3
Session: 6, ALG: 0, Flags: 0x0000, IP Action: no, Offload: no
UDP            192.0.2.1:123   ->        192.0.2.2:123   Forward  O               4

show services sessions count

content_copy zoom_out_map
user@host> show services sessions count 
Interface   Service set                                          Sessions count
ms-1/1/0    ss                                                                2

show services sessions destination-port

content_copy zoom_out_map
user@router> show services sessions destination-port 21
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              25
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              24

show services sessions destination-prefix

content_copy zoom_out_map
user@router> show services sessions destination-prefix 10.1.1.2
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              25
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              24

show services sessions interface

content_copy zoom_out_map
user@router> show services sessions interface ms-1/1/0
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              30
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              29

show services sessions protocol

content_copy zoom_out_map
user@router> show services sessions protocol tcp
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              30
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              29

show services sessions service-set

content_copy zoom_out_map
user@router> show services sessions service-set sample
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              33
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              31

show services sessions source-port

content_copy zoom_out_map
user@router> show services sessions source-port 21
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              33
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              31

show services sessions source-prefix

content_copy zoom_out_map
user@router> show services sessions source-prefix 10.2.2.2 
ms-1/1/0
Session: 1, ALG: ftp, Flags: 0x2000, IP Action: no, Offload: no, Asymmetric: no
TCP           10.2.2.2:52138 ->       10.1.1.2:21    Forward  I              33
TCP           10.1.1.2:21    ->       10.2.2.2:52138 Forward  O              31

Release Information

Command introduced in Junos OS Release 10.4.

Support added in Junos OS Release 19.3R2 for Next Gen Services on MX Series routers MX240, MX480 and MX960 with the MX-SPC3 services card.

The nat, nat-port-overload-index, and source-nat-pool are introduced in Junos OS Release 23.4R1.

footer-navigation