Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos] Special Character Encoding while providing URL input on Junos CLI



Article ID: KB35954 KB Last Updated: 17 Jul 2020Version: 1.0

This article explains the need to encode special characters when a URL is used as part of a command-line to ensure proper functionality.


The list of special characters and their corresponding encoding characters are listed below:

Character              Encoding to be used
space                     %20
!                              %21
"                              %22
#                             %23
$                              %24
%                            %25
&                             %26
'                               %27
(                              %28
)                              %29
*                             %2A
+                             %2B
,                               %2C
-                              %2D
.                               %2E
/                              %2F
:                               %3A
;                               %3B
<                             %3C
=                             %3D
>                             %3E
?                              %3F
@                            %40
[                             %5B
\                              %5C
]                              %5D
^                             %5E
_                             %5F
`                               %60
{                              %7B
|                              %7C
}                              %7D

For detailed list, refer to:

Example of Usage: 

When fetching a file to the router from local server:

Special character “+” need to be encoded in URL so it need to be replaced by  %2B.

user@host> request system software add no-copy no-validate ftp://uname:abcdefg+@<server-ip>/jinstall-x-signed.tgz

NOTE: Since "@" is a part of the syntax format for accessing URL, there is no need to encode this character when it is used in "username:password@server_ip" format. If "@" is being used elsewhere in the username/password, one must encode this character too. In that case, @ will be encoded as %40

Here, the username is uname and password is "abcdefg+"

When the above command is executed, you will see the followoing error message:

fetch: ftp://uname:*@<server-ip>/jinstall-x-signed.tgz: Not logged in
ERROR: Cannot fetch file: jinstall-x-signed.tgz
Removing temporary file '/var/tmp/incoming-package.tgz'

Correct Usage:

user@host> request system software add no-copy no-validate ftp://uname:abcdefg%2B@<server-ip>/jinstall-x-signed.tgz

Here, abcdefg+ is represented as abcdefg%2B where %2B is the encoded format of "+".

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search