10-Security

HomeSupportConfigure & DeployConfiguration GuidesH3C Access Controllers Configuration Guides(E5208P03 E5215P01 R5215P01)-6W10210-Security
13-Session management
Title Size Download
13-Session management 69.98 KB

Managing sessions

Overview

Session management is a common module, providing basic services for NAT, ASPF, and intrusion detection and protection to implement their session-based services. Session management can be applied for the following purposes:

·     Fast match between packets and sessions.

·     Management of transport layer protocol states.

·     Identification of application layer protocols.

·     Session aging based on protocol states or application layer protocols.

·     Persistent sessions.

·     Special packet match for the application layer protocols requiring port negotiation.

·     ICMP/ICMPv6 error control packet resolution and session match based on the resolution results.

Session management operation

Session management tracks the session status by inspecting the transport layer protocol information. It updates session states or ages out sessions according to data flows from the initiators or responders.

When a connection request passes through the device from a client to a server, the device creates a session entry. The entry can contain the request and response information, such as:

·     Source IP address and port number.

·     Destination IP address and port number.

·     Transport layer protocol.

·     Application layer protocol.

·     Protocol state of the session.

A multichannel protocol requires that the client and the server negotiate a new connection based on an existing connection to implement an application. Session management enables the device to create a relation entry for each connection during the negotiation phase. The entry is used to associate the connection with the application. Relation entries will be removed after the associated connections are established.

If the destination IP address of a packet is a multicast IP address, the packet will be forwarded out of multiple ports. When a multicast connection request is received on an inbound interface, the device performs the following operations:

·     Creates a multicast session entry on the inbound interface.

·     Creates a corresponding multicast session entry for each outbound interface.

Unless otherwise stated, "session entry" in this chapter refers to both unicast and multicast session entries.

In actual applications, session management works with ASPF to dynamically determine whether a packet can pass the firewall and enter the internal network according to connection status, thus preventing intrusion.

Session management only tracks connection status. It does not block potential attack packets.

Session management functions

Session management enables the device to provide the following functions:

·     Creates sessions for protocol packets, updates session states, and sets aging time for sessions in different protocol states.

·     Supports ICMP/ICMPv6 error packet mapping, enabling the device to search for original sessions according to the payloads in the ICMP/ICMPv6 error packets.

Because error packets are generated due to host errors, the mapping can help speed up the aging of the original sessions.

·     Supports persistent sessions, which are kept alive for a long period of time.

·     Supports session management for the control channels and dynamic data channels of application layer protocols, for example, FTP.

Compatibility information

Feature and hardware compatibility

Hardware series

Model

Session management compatibility

WX1800H series

WX1804H

WX1810H

WX1820H

Yes

WX2500H series

WX2510H

WX2540H

WX2560H

Yes

WX3000H series

WX3010H

WX3010H-L

WX3010H-X

WX3024H

WX3024H-L

Yes:

·     WX3010H

·     WX3010H-X

·     WX3024H

No:

·     WX3010H-L

·     WX3024H-L

WX3500H series

WX3508H

WX3510H

WX3520H

WX3540H

Yes

WX5500E series

WX5510E

WX5540E

Yes

WX5500H series

WX5540H

WX5560H

WX5580H

Yes

Access controller modules

EWPXM1MAC0F

EWPXM1WCME0

EWPXM2WCMD0F

LSQM1WCMX20

LSQM1WCMX40

LSUM1WCME0

LSUM1WCMX20RT

LSUM1WCMX40RT

Yes

 

Command and hardware compatibility

The WX1800H series, WX2500H series, and WX3000H series access controllers do not support the slot keyword or the slot-number argument.

Session management task list

Tasks at a glance

(Optional.) Setting the session aging time for different protocol states

(Optional.) Specifying persistent sessions

(Optional.) Enabling session statistics collection

(Optional.) Specifying the loose mode for session state machine

(Optional.) Configuring session logging

 

Except for configuring session logging, all other tasks are mutually independent and can be configured in any order.

Setting the session aging time for different protocol states

IMPORTANT

IMPORTANT:

If more than 800000 sessions exist, do not set the aging time shorter than the default for a certain protocol state. Short aging time settings can make the device slow in response.

 

If a session in a certain protocol state has no packet hit before the aging time expires, the device automatically removes the session.

To set the session aging time for different protocol states:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

1.     Set the session aging time for different protocol states.

session aging-time state { fin | icmp-reply | icmp-request | rawip-open | rawip-ready | syn | tcp-close | tcp-est | tcp-time-wait | udp-open | udp-ready } time-value

The default aging time for sessions in different protocol states is as follows:

·     FIN_WAIT: 30 seconds.

·     ICMP-REPLY: 30 seconds.

·     ICMP-REQUEST: 60 seconds.

·     RAWIP-OPEN: 30 seconds.

·     RAWIP-READY: 60 seconds.

·     TCP SYN-SENT and SYN-RCV: 30 seconds.

·     TCP CLOSE: 2 seconds.

·     TCP ESTABLISHED: 3600 seconds.

·     TCP TIME-WAIT: 2 seconds.

·     UDP-OPEN: 30 seconds.

·     UDP-READY: 60 seconds.

 

Specifying persistent sessions

This task is only for TCP sessions in ESTABLISHED state. You can specify TCP sessions that match the permit statements in the specified ACL as persistent sessions, and set longer lifetime or never-age-out persistent sessions. A never-age-out session is not removed until the device receives a connection close request from the initiator or responder, or you manually clear the session entries.

For a TCP session in ESTABLISHED state, the priority order of the associated aging time is as follows:

·     Aging time for persistent sessions.

·     Aging time for sessions in different protocol states.

The system supports using multiple ACLs to specify persistent sessions.

To specify persistent sessions:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Specify persistent sessions.

session persistent acl [ ipv6 ] acl-number [ aging-time time-value ]

By default, no persistent sessions are specified.

 

Enabling session statistics collection

This feature enables the device to collect session-based outbound and inbound packets and bytes. You can display session statistics based on different criteria.

·     To display statistics per unicast session, use the display session table command.

·     To display statistics per unicast packet type, use the display session statistics command.

·     To display statistics per multicast session, use the display session table multicast command.

·     To display statistics per multicast packet type, use the display session statistics multicast command.

To enable session statistics collection:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enable session statistics collection.

session statistics enable

By default, session statistics collection is disabled.

 

Specifying the loose mode for session state machine

For asymmetric-path networks, if session synchronization is not enabled, to prevent the device from dropping packets abnormally, set the mode of the session state machine to loose.

As a best practice, use the default strict mode on symmetric-path networks.

To specify the loose mode for session state machine:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Specify the loose mode for session state machine.

session state-machine mode loose

By default, session state machine is in strict mode.

 

Configuring session logging

Session logs provide information about user access, IP address translation, and network traffic for security auditing. These logs are sent to the log server or the information center.

The device supports time-based or traffic-based logging:

·     Time-based logging—The device outputs session logs regularly.

·     Traffic-based logging—The device outputs a session log when the traffic amount of a session reaches a threshold only when the session statistics collection feature is enabled. After outputting a session log, the device resets the traffic counter for the session. The traffic-based thresholds can be byte-based and packet-based. If you set both thresholds, the last configuration takes effect.

If you set both time-based and traffic-based logging, the device outputs a session log when whichever is reached. After outputting a session log, the device resets the traffic counter and restarts the interval for the session.

If you enable session logging but do not enable logging for session creation or deletion, the device does not output a session log when a session entry is created or removed.

The session logging feature must work with the flow log feature to generate session logs. For information about flow log, see Network Management and Monitoring.

To configure session logging:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     (Optional.) Set a time-based logging type.

session log time-active time-value

By default, no threshold is set for time-based session logging.

3.     (Optional.) Set a traffic-based logging type.

session log { bytes-active bytes-value | packets-active packets-value }

By default, no threshold is set for traffic-based logging.

4.     (Optional.) Enable logging for session creation.

session log flow-begin

By default, logging for session creation is disabled.

5.     (Optional.) Enable logging for session deletion.

session log flow-end

By default, logging for session deletion is disabled.

6.     Enter interface view.

interface interface-type interface-number

N/A

7.     Enable session logging.

session log enable { ipv4 | ipv6 } [ acl acl-number ] { inbound | outbound }

By default, session logging is disabled.

 

 

NOTE:

To configure session logging, you must use a minimum of one command from the following commands:

·     session log time-active.

·     session log { bytes-active bytes-value | packets-active packets-value }.

·     session log flow-begin.

·      session log flow-end.

 

Displaying and maintaining session management

Execute display commands in any view and reset commands in user view.

 

Task

Command

Display the aging time for sessions in different protocol states.

display session aging-time state

Display IPv4 unicast session table entries.

display session table ipv4 [ slot slot-number ] [ source-ip start-source-ip [ end-source-ip ] ] [ destination-ip start-destination-ip [ end-destination-ip ] ] [ protocol { dccp | icmp | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ verbose ]

Display IPv6 unicast session table entries.

display session table ipv6 [ slot slot-number ] [ source-ip start-source-ip [ end-source-ip ] ] [ destination-ip start-destination-ip [ end-destination-ip ] ] [ protocol { dccp | icmpv6 | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ verbose ]

Display IPv4 unicast session statistics.

display session statistics ipv4 { source-ip source-ip | destination-ip destination-ip | protocol { dccp | icmp | raw-ip | sctp | tcp | udp | udp-lite } | source-port source-port | destination-port destination-port } * [ slot slot-number ]

Display IPv6 unicast session statistics.

display session statistics ipv6 { source-ip source-ip | destination-ip destination-ip | protocol { dccp | icmpv6 | raw-ip | sctp | tcp | udp | udp-lite } | source-port source-port | destination-port destination-port } * [ slot slot-number ]

Display summary information about unicast session statistics.

display session statistics [ summary ] [ slot slot-number ]

Display IPv4 multicast session table entries.

display session table multicast ipv4 [ slot slot-number ] [ source-ip start-source-ip [ end-source-ip ] ] [ destination-ip start-destination-ip [ end-destination-ip ] ] [ protocol { dccp | icmp | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ verbose ]

Display IPv6 multicast session table entries.

display session table multicast ipv6 [ slot slot-number ] [ source-ip start-source-ip [ end-source-ip ] ] [ destination-ip start-destination-ip [ end-destination-ip ] ] [ protocol { dccp | icmpv6 | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ verbose ]

Display multicast session statistics.

display session statistics multicast [ slot slot-number ]

Display relation table entries.

display session relation-table { ipv4 | ipv6 } [ slot slot-number ]

Clear IPv4 unicast session table entries.

reset session table ipv4 [ slot slot-number ] [ source-ip source-ip ] [ destination-ip destination-ip ] [ protocol { dccp | icmp | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ vpn-instance vpn-instance-name ]

Clear IPv6 unicast session table entries.

reset session table ipv6 [ slot slot-number ] [ source-ip source-ip ] [ destination-ip destination-ip ] [ protocol { dccp | icmpv6 | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ vpn-instance vpn-instance-name ]

Clear IPv4 and IPv6 unicast session table entries.

reset session table [ slot slot-number ]

Clear unicast session statistics.

reset session statistics [ slot slot-number ]

Clear IPv4 multicast session table entries.

reset session table multicast ipv4 [ slot slot-number ] [ source-ip source-ip ] [ destination-ip destination-ip ] [ protocol { dccp | icmp | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ vpn-instance vpn-instance-name ]

Clear IPv6 multicast session table entries.

reset session table multicast ipv6 [ slot slot-number ] [ source-ip source-ip ] [ destination-ip destination-ip ] [ protocol { dccp | icmpv6 | raw-ip | sctp | tcp | udp | udp-lite } ] [ source-port source-port ] [ destination-port destination-port ] [ vpn-instance vpn-instance-name ]

Clear IPv4 and IPv6 multicast session table entries.

reset session table multicast [ slot slot-number ]

Clear multicast session statistics.

reset session statistics multicast [ slot slot-number ]

Clear relation table entries.

reset session relation-table [ ipv4 | ipv6 ] [ slot slot-number ]

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网