Supported Platforms
Related Documentation
- EX, M, MX, PTX, QFX, T Series
- Understanding Hostnames
- M, MX, PTX, T Series
- Example: Configuring the Name of the Router, IP Address, and System ID
- QFabric System, QFX Series standalone switches
- Mapping the Hostname of the Switch to IP Addresses
Configuring the Hostname of the Router or Switch
The hostname of the device provides its identification for many purposes. Junos OS uses the configured hostname as part of the command prompt, to prepend log files and other accounting information, as well as in other places where knowing the device identity is useful. We recommend that the hostname be descriptive and memorable.
Optionally, instead of configuring the hostname at the [edit system] hierarchy level, you can use a configuration group, as shown in this procedure. This is a recommended best practice for configuring the hostname, especially if the device has dual Routing Engines. This procedure uses groups called re0 and re1 as an example.
To set the hostname:
- Include the host-name statement
in the configuration.
The name value must be less than 256 characters.
[edit groups group-name system]host-name hostname;For example:
[edit groups re0 system]root@# set host-name san-jose-router[edit groups re1 system]root@# set host-name san-jose-router1 - If you used one or more configuration groups, apply the
configuration groups, substituting the appropriate group names.
For example:
[edit]user@host# set apply-groups [re0 re1] - Commit the changes.[edit]root@# commit
The hostname subsequently appears in the device CLI prompt.
san-jose-router@#
Related Documentation
- EX, M, MX, PTX, QFX, T Series
- Understanding Hostnames
- M, MX, PTX, T Series
- Example: Configuring the Name of the Router, IP Address, and System ID
- QFabric System, QFX Series standalone switches
- Mapping the Hostname of the Switch to IP Addresses
Published: 2014-07-23
Supported Platforms
Related Documentation
- EX, M, MX, PTX, QFX, T Series
- Understanding Hostnames
- M, MX, PTX, T Series
- Example: Configuring the Name of the Router, IP Address, and System ID
- QFabric System, QFX Series standalone switches
- Mapping the Hostname of the Switch to IP Addresses