Related Documentation
- J Series
- Security Policies Overview
- SRX Series
- Security Policies Overview
- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices

Example: Defining a Custom ICMP Application
This example shows how to define a custom ICMP application.
Requirements
Before you begin:
- Understand custom policy application. See Understanding Custom Policy Applications.
- Understand the ICMP predefined policy application. See Understanding the ICMP Predefined Policy Application.
Overview
Junos OS supports ICMP—as well as several ICMP messages—as predefined or custom applications. When configuring a custom ICMP application, you define a type and code.
- There are different message types within ICMP. For example:
- type 0 = Echo Request message
- type 3 = Destination Unreachable message
- An ICMP message type can also have a message code. The
code provides more specific information about the message, as shown
in Table 1.
Table 1: Message Descriptions
Message Type Message Code 5 = Redirect
0 = Redirect datagram for the network (or subnet)
1 = Redirect datagram for the host
2 = Redirect datagram for the type of application and network
3 = Redirect datagram for the type of application and host
11 = Time Exceeded Codes
0 = Time to live exceeded in transit
1 = Fragment reassembly time exceeded
Junos OS supports any type or code within the range of 0 through 55 .
In this example, you define a custom application named host-unreachable using ICMP as the transport protocol. The type is 3 (for destination unreachable) and the code is 1 (for host unreachable). You set the timeout value at 4 minutes.
![]() | Note: For more information about ICMP types and codes, refer to RFC 792, Internet Control Message Protocol. |
Configuration
Step-by-Step Procedure
The following example requires you to navigate various
levels in the configuration hierarchy. For instructions on how to
do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide
.
To define a custom ICMP application:
Set the application type and code.
[edit applications application host-unreachable]user@host# set icmp-type 5 icmp-code 0Set the inactivity timeout value.
[edit applications application host-unreachable]user@host# set inactivity-timeout 4- If you are done configuring the device, commit the configuration.[edit]user@host# commit
Verification
To verify the configuration is working properly, enter the show applications command.
Related Documentation
- J Series
- Security Policies Overview
- SRX Series
- Security Policies Overview
- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices



