Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configure a Device’s Unique Identity for the Network

To use a device in a network, you must configure the device’s identity. Configuring the device's identity makes the device accessible on the network and allows other users to log in to it. You can refer to any Internet-connected device in either of two ways:

  • By its IP address

  • By its hostname

Once you have a hostname, you can:

  • Find the IP address

  • Use the Domain Name System (DNS) to resolve an IP address from a hostname

  • Manually map the hostname to a static IP address

Using DNS is an easy and scalable way to resolve IP addresses from hostnames. However, you might not have a DNS entry for the device. You might not want the computer to contact the DNS server to resolve a particular IP address. Perhaps you use this particular IP address frequently. Maybe you use it only for testing or development purposes and do not want to give it a DNS entry.

To configure a device's unique identity, you might need to include some or all of the following details: The hostname of the device, its IP address, the domain name, and IP addresses for two or three domain name servers.

Requirements

You don't need to do any special configuration beyond device initialization.

Overview

In this example, the hostname is the device’s name. Most people find it easier to remember a hostname than an IP address. The software uses the configured hostname as part of the command prompt, to prepend log files and other accounting information, and in other places where knowing the device identity is useful. You can also use the hostname to telnet to a device.

You append a domain name to hostnames that are not fully qualified. The domain name is the name of a network associated with an organization. For sites in the United States, domain names typically take the form of org-name.org-type—for example, “Juniper.net.”

If your hostname and IP address do not have a DNS entry in a name server, configure a static mapping. See Step 4 in the following procedure for an example.

This example uses the values given in the following table to configure each of these variables. You need to substitute data specific to your device and network for these values.

Table 1: Values to Use in Example

Name of Variable

Value Used in Example

Value You Substitute

domain-name domain-name

domain-name device.example.net

Provide your value.

host-name host-name

host-name example-re0

Provide your value.

inet ip-address

inet 172.22.147.39

Provide your value.

name-server ip-address

name-server 172.24.16.115

name-server 192.0.2.10

Provide your value.

Configuration

CLI Quick Configuration

To quickly configure a device using this example:

  1. Copy the following commands and paste the commands in a text file.

  2. Remove any line breaks.

  3. Change the values listed here to match your network configuration.

  4. Copy and paste the commands into the CLI at the [edit] hierarchy level.

  5. Enter commit in configuration mode.

Configure the Device's Identity

Step-by-Step Procedure

To configure the identity settings of a device:

  1. Configure the domain name of your network.

  2. Configure the hostname of the device.

  3. Configure from one to three name servers.

  4. Map the device hostname to its IP address.

Results

To check the configuration, use the configuration mode show system command.

When you have the correct configuration, enter commit.

Verification

Verify the Hostname and the IP Address of the Device

Purpose

Verify that the hostname and the IP address of a device are as expected.

Action

Issue the show host host-name operational command.