How to Access Junos Devices with Telnet

By Walter J. Goralski, Cathy Gadecki, Michael Bushong

The basic way of accessing a remote device is using Telnet. After you configure an IP address on the management interface (whether that interface is out-of-band or in-band), you can access the device by opening up a Telnet session to that address.

For example, if you configure your device with a management interface address of 192.168.71.246, you should be able to access the device with the Telnet session:

> telnet 192.168.71.246
Trying 192.168.71.246...
telnet: connect to address 192.168.71.246: Connection refused
telnet: Unable to connect to remote host

Oops, something went wrong. Access to the device must be explicitly configured on the device (which is part of the initial setup, but many people don’t complete it!). More specifically, particular modes of access must be explicitly enabled. In this case, you’re trying to access the device using Telnet, so you must tell the device to allow Telnet connections. To configure the Telnet service on the device, do the following:

[edit]
system {
  services {
    telnet;
  }
}

After Telnet services are enabled on the device, the Telnet request is successful:

> telnet 192.168.71.246
Trying 192.168.71.246...
Connected to device.domain.net.
Escape character is '^]'.
dummies (ttyp0)
login:

When your Telnet session is established, access is then based on user authentication. The exact authentication mechanism is based on your configuration.

Root access to the device is restricted to only those connections that are made via the console (indicating physical access to the router) or via an encrypted session (such as SSH or HTTPS).

If you try to log in with the root username, your login will fail regardless of the password you enter. If you must use Telnet to access the device and you must have root access, try setting up a user ID with super-user privileges.