Description

Customer couldn't put an underscore in the hostname for their ACX running Junos EVO, which is not supported as documented.

However, the prompt they got on the device was as below after originally trying to set a "/" in the hostname:

 

error: host-name: 'X/XX-X': Must be a string of alphanumericals, dashes or underscores

 

But when using the "_" instead, the commit fails:

 

mgd: error: Invalid hostname - 'X_XX-X', Underscore not allowed in hostname

error: foreign reconfiguration failed

 

As you can see the initial error says that underscores are supported but then they cannot be commited (believe by design).

Symptoms

While adding unsupported character, it says underscore is supported.
labroot@JTAC# set system host-name J/AC-R-01 
error: host-name: 'J/AC-R-01': Must be a string of alphanumericals, dashes or underscores

And when try underscore, it throws error on commit, as expected per document.
[edit]
labroot@JTAC# set system host-name J_AC-R-01    

[edit]
labroot@H20-48# commit 
mgd: error: Invalid hostname - 'J_AC-R-01', Underscore not allowed in hostname
error: foreign reconfiguration failed

Solution

As per document, "In Junos OS Evolved, the hostname can contain any combination of alphabetic characters, numbers, and dashes. No underscores or other special characters are allowed."

https://www.juniper.net/documentation/us/en/software/junos/junos-getting-started-evo/junos-getting-started/topics/concept/hostnames-understanding.html

 

Hence the prompt for unsupported character is misleading, wrt doc & commit prompt for underscore.

This will be fixed in future releases via PR1840008 & will be as below.

error: host-name: 'J/AC-R-01': Must be a string of alphanumericals, dashes


The underscore got removed for evo since LTS19 Windriver update from linux, which removed it.

So this wont be added back in future, since evo is basically built over LTS19 shell for newer releases.

Modification History

2024-10-01 : Article Created