Difference between revisions of "Juniper: Basic Configuration CLI"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "Basic Connection and Configuration with the CLI For CLI access, you connect from your management PC or laptop to the Services Router through the console port. (For informatio...")
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Basic Connection and Configuration with the CLI
+
sumber: https://www.juniper.net/documentation/software/jseries/junos93/jseries-install-quick-start/basic-connection-and-configuration-with-the-cli.html
 +
 
  
 
For CLI access, you connect from your management PC or laptop to the Services Router through the console port. (For information about the CLI, see JUNOS CLI Basics.)
 
For CLI access, you connect from your management PC or laptop to the Services Router through the console port. (For information about the CLI, see JUNOS CLI Basics.)
Step 1. Connecting, Logging In, and Starting the CLI
+
 
 +
==Step 1. Connecting, Logging In, and Starting the CLI==
  
 
You are prompted for a username and password. The default username is root. Because no password is initially required, press Enter at the password prompt for a first-time login.
 
You are prompted for a username and password. The default username is root. Because no password is initially required, press Enter at the password prompt for a first-time login.
Line 8: Line 10:
 
To access a Services Router with the JUNOS CLI:
 
To access a Services Router with the JUNOS CLI:
  
    Turn off power to the management PC or laptop.
+
* Turn off power to the management PC or laptop.
    Connect one end of the console cable to the serial port adapter, plug the adapter into a serial port on the PC or laptop, and plug the other end of the cable into the console port on the Services Router.
+
* Connect one end of the console cable to the serial port adapter, plug the adapter into a serial port on the PC or laptop, and plug the other end of the cable into the console port on the Services Router.
    Turn on power to the PC or laptop.
+
* Turn on power to the PC or laptop.
    On the PC or laptop, start the terminal emulation program (such as Microsoft Windows HyperTerminal), select the COM port, and configure the following port settings: 9600 (bits per second), 8 (data bits), none (parity), 1 (stop bits), and none (flow control).
+
* On the PC or laptop, start the terminal emulation program (such as Microsoft Windows HyperTerminal), select the COM port, and configure the following port settings: 9600 (bits per second), 8 (data bits), none (parity), 1 (stop bits), and none (flow control).
    Press the POWER button on the router, and verify that the POWER LED turns green.
+
* Press the POWER button on the router, and verify that the POWER LED turns green.
    Wait for the system to boot, and when presented with a login prompt, log in as root, and press Enter at the Password prompt.
+
* Wait for the system to boot, and when presented with a login prompt, log in as root, and press Enter at the Password prompt.
  
 
     When you have been authenticated through the CLI, you enter the UNIX shell:
 
     When you have been authenticated through the CLI, you enter the UNIX shell:
Line 26: Line 28:
 
     root@%
 
     root@%
  
    At the % prompt, type the cli command and press Enter. The prompt changes to an angle bracket (>) when you enter CLI operational mode.
+
At the % prompt, type the cli command and press Enter. The prompt changes to an angle bracket (>) when you enter CLI operational mode.
    root@% cli root
+
 
 +
root@% cli root
  
    root>
+
root>
  
 
For complete instructions, see the Getting Started Guide for your router.
 
For complete instructions, see the Getting Started Guide for your router.
Step 2. Updating the JUNOS Software with the CLI
 
  
After starting up the Services Router, you might want to download the latest version of the JUNOS software from the Juniper Networks Web site and load it onto the router. You can use the CLI, but we recommend the J-Web interface for the download.
+
==Step 2. Updating the JUNOS Software with the CLI==
  
 
To update the JUNOS software with the CLI:
 
To update the JUNOS software with the CLI:
  
    Go to https://www.juniper.net/support, and follow the links to download the JUNOS software for J-series routers to an FTP server.
+
* Go to https://www.juniper.net/support, and follow the links to download the JUNOS software for J-series routers to an FTP server.
    Download the JUNOS software to the router with the CLI or J-Web interface:
+
* Download the JUNOS software to the router with the CLI or J-Web interface:
        root> request system software add validate unlink reboot source
 
  
For complete instructions, see the J-series Services Router Administration Guide.
+
root> request system software add validate unlink reboot source
Step 3. Adding Licenses with the CLI
+
 
 +
==Step 3. Adding Licenses with the CLI==
  
 
If you purchased one or more licenses, you received an envelope with instructions for obtaining license keys from the Web. To enable each license on the router, you must add the license key. You can add one or more license keys from the CLI.
 
If you purchased one or more licenses, you received an envelope with instructions for obtaining license keys from the Web. To enable each license on the router, you must add the license key. You can add one or more license keys from the CLI.
Line 57: Line 59:
  
 
For complete instructions, see the Getting Started Guide for your router.
 
For complete instructions, see the Getting Started Guide for your router.
Step 4. Configuring Basic Settings with the CLI
 
  
In CLI configuration mode, you use the set command to enable features, and the delete command to disable them. The commands you enter do not update the active configuration on the router until you use the commit command.
+
==Step 4. Configuring Basic Settings with the CLI==
 +
 
 +
From the CLI, enter configuration mode:
 +
 
 +
root> configure
 +
set system root-authentication plain-text-password
 +
exit
 +
exit
 +
shutdown -r now
 +
 
 +
Set interface
  
To configure basic settings with the CLI:
+
set interfaces me0 unit 0 family inet address 10.93.15.246/21
 +
set routing-options static route 0.0.0.0/0 next-hop  10.93.15.1/21
  
    From the CLI, enter configuration mode:
+
root# set interfaces fe-0/0/0 unit 0 family inet address 192.168.1.1/24
        root> configure
+
root# set interfaces fe-0/0/1 unit 0 family inet address 192.168.2.1/24
        root#
+
root# set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/24
    Set the IP addresses of the built-in Ethernet ports. For example:
+
root# set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/24
        On a J2300 router:
+
root# set interfaces ge-0/0/2 unit 0 family inet address 192.168.3.1/24
 +
root# set interfaces ge-0/0/3 unit 0 family inet address 192.168.4.1/24
  
            root# set interfaces fe-0/0/0 unit 0 family inet address 192.168.1.1/24
+
Set routing
            root# set interfaces fe-0/0/1 unit 0 family inet address 192.168.2.1/24
 
  
        On a J4350 or J6350 router:
+
set routing-options static route 192.168.1.254/24 next-hop 10.1.1.50
 +
set routing-options static route destination-prefix next-hop address
  
            root# set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/24
+
Set the hostname
            root# set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/24
 
            root# set interfaces ge-0/0/2 unit 0 family inet address 192.168.3.1/24
 
            root# set interfaces ge-0/0/3 unit 0 family inet address 192.168.4.1/24
 
  
    The unit number is the logical interface number. IP addresses are configured on the logical interface. Setting the protocol family to inet specifies the routing table of IPv4 addresses.
+
set system host-name Chicago
    Set a default route (default gateway) for IPv4 packets. For example:
 
        root# set routing-options static route 192.168.1.254/24 next-hop 10.1.1.50
 
    Configure one or more static routes:
 
        root# set routing-options static route destination-prefix next-hop address
 
    Set the hostname. For example:
 
        root# set system host-name Chicago
 
    Save your configuration settings and activate them on the Services Router:
 
        root# commit
 
  
For complete instructions, see the J-series Services Router Basic LAN and WAN Access Configuration Guide.
+
Save
  
 +
commit
 +
commit check
 +
commit full
  
 +
==Referensi==
  
 +
* https://www.juniper.net/documentation/software/jseries/junos93/jseries-install-quick-start/basic-connection-and-configuration-with-the-cli.html
  
 
==Pranala Menarik==
 
==Pranala Menarik==
  
 
* [[Juniper]]
 
* [[Juniper]]

Latest revision as of 17:59, 24 December 2018

sumber: https://www.juniper.net/documentation/software/jseries/junos93/jseries-install-quick-start/basic-connection-and-configuration-with-the-cli.html


For CLI access, you connect from your management PC or laptop to the Services Router through the console port. (For information about the CLI, see JUNOS CLI Basics.)

Step 1. Connecting, Logging In, and Starting the CLI

You are prompted for a username and password. The default username is root. Because no password is initially required, press Enter at the password prompt for a first-time login.

To access a Services Router with the JUNOS CLI:

  • Turn off power to the management PC or laptop.
  • Connect one end of the console cable to the serial port adapter, plug the adapter into a serial port on the PC or laptop, and plug the other end of the cable into the console port on the Services Router.
  • Turn on power to the PC or laptop.
  • On the PC or laptop, start the terminal emulation program (such as Microsoft Windows HyperTerminal), select the COM port, and configure the following port settings: 9600 (bits per second), 8 (data bits), none (parity), 1 (stop bits), and none (flow control).
  • Press the POWER button on the router, and verify that the POWER LED turns green.
  • Wait for the system to boot, and when presented with a login prompt, log in as root, and press Enter at the Password prompt.
   When you have been authenticated through the CLI, you enter the UNIX shell:
   routername (ttyd0)


   login: root
   Password:
   JUNOS 8.0R1 2006-07-01 01:59:49 UTC
   root@%

At the % prompt, type the cli command and press Enter. The prompt changes to an angle bracket (>) when you enter CLI operational mode.

root@% cli root
root>

For complete instructions, see the Getting Started Guide for your router.

Step 2. Updating the JUNOS Software with the CLI

To update the JUNOS software with the CLI:

  • Go to https://www.juniper.net/support, and follow the links to download the JUNOS software for J-series routers to an FTP server.
  • Download the JUNOS software to the router with the CLI or J-Web interface:
root> request system software add validate unlink reboot source

Step 3. Adding Licenses with the CLI

If you purchased one or more licenses, you received an envelope with instructions for obtaining license keys from the Web. To enable each license on the router, you must add the license key. You can add one or more license keys from the CLI.

To add a license key and enable a license:

   Follow the instructions in your license envelope to generate the license key from the Web site.
   Copy the license key onto the router with the CLI:
       Type the following command, and press Enter:
           root> request system license add terminal
       When prompted, copy and paste the license key from the Web site at the command line, separating multiple license keys with a blank line.
       To exit license key entry, press Ctrl+D.

For complete instructions, see the Getting Started Guide for your router.

Step 4. Configuring Basic Settings with the CLI

From the CLI, enter configuration mode:

root> configure
set system root-authentication plain-text-password
exit
exit
shutdown -r now

Set interface

set interfaces me0 unit 0 family inet address 10.93.15.246/21
set routing-options static route 0.0.0.0/0 next-hop  10.93.15.1/21
root# set interfaces fe-0/0/0 unit 0 family inet address 192.168.1.1/24
root# set interfaces fe-0/0/1 unit 0 family inet address 192.168.2.1/24
root# set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/24
root# set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/24
root# set interfaces ge-0/0/2 unit 0 family inet address 192.168.3.1/24
root# set interfaces ge-0/0/3 unit 0 family inet address 192.168.4.1/24

Set routing

set routing-options static route 192.168.1.254/24 next-hop 10.1.1.50
set routing-options static route destination-prefix next-hop address

Set the hostname

set system host-name Chicago

Save

commit
commit check
commit full

Referensi

Pranala Menarik