junosreference · 3 | p a g e junos reference guide adding ports to the ae ..... 8

12
1 | Page Junos Reference Guide JUNOsReference

Upload: others

Post on 17-Apr-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

1 | P a g e

Junos Reference

Guide

JUNOsReference

Page 2: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

2 | P a g e

Junos Reference

Guide Contents Help commands ............................................................................................................................................ 4

Rescue Configuration .................................................................................................................................... 4

Basic Configuration ................................................................................................................................... 4

Show commands ....................................................................................................................................... 4

Rollback ......................................................................................................................................................... 4

Default Behavior ....................................................................................................................................... 4

Basic Configuration ................................................................................................................................... 4

Show Commands ...................................................................................................................................... 4

Password Recovery ....................................................................................................................................... 5

Procedure .................................................................................................................................................. 5

Initial Configuration ...................................................................................................................................... 6

SSH and FTP ............................................................................................................................................... 6

Hostname .................................................................................................................................................. 6

Set Root Password .................................................................................................................................... 6

Configuring an interface ............................................................................................................................... 7

Layer 2 ....................................................................................................................................................... 7

Layer 3 ....................................................................................................................................................... 7

Disable and Enable .................................................................................................................................... 7

Show commands ....................................................................................................................................... 7

Configuring Vlans .......................................................................................................................................... 7

Basic configuration .................................................................................................................................... 7

Adding interfaces ...................................................................................................................................... 7

Show Commands ...................................................................................................................................... 7

Rapid Spanning Tree Protocol (RSTP) ........................................................................................................... 8

Basic Configuration ................................................................................................................................... 8

Show Commands ...................................................................................................................................... 8

Configuring Routed Virtual Interfaces (RVI).................................................................................................. 8

Basic Configuration ................................................................................................................................... 8

Show Commands ...................................................................................................................................... 8

Configuring an Aggregated Ethernet Interface ............................................................................................. 8

Basic Configuration ................................................................................................................................... 8

Page 3: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

3 | P a g e

Junos Reference

Guide Adding Ports to the AE .............................................................................................................................. 8

Configuring the AE .................................................................................................................................... 8

Show Commands ...................................................................................................................................... 9

Configuring Trunk Ports ................................................................................................................................ 9

Basic configuration .................................................................................................................................... 9

Adding Vlans ............................................................................................................................................. 9

Show Commands ...................................................................................................................................... 9

Static Route ................................................................................................................................................... 9

Basic Configuration ................................................................................................................................... 9

Show Commands ...................................................................................................................................... 9

OSPF .............................................................................................................................................................. 9

Basic Configuration ................................................................................................................................... 9

Defining Area Types ................................................................................................................................ 10

Passive Interface ..................................................................................................................................... 10

Show Commands .................................................................................................................................... 10

Authentication ........................................................................................................................................ 10

BFD .......................................................................................................................................................... 10

Virtual Link .............................................................................................................................................. 10

Static2OSPF redistribution example ....................................................................................................... 10

BGP .............................................................................................................................................................. 11

Default Behavior: .................................................................................................................................... 11

Basic Configuration ................................................................................................................................. 11

Route Aggregation .................................................................................................................................. 11

Show Commands .................................................................................................................................... 11

Defining a policy .......................................................................................................................................... 11

Basic Configuration ................................................................................................................................. 11

Policy Example ........................................................................................................................................ 12

Page 4: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

4 | P a g e

Junos Reference

Guide

Help commands #help apropos

Displays help about a text string contained in a statement or command name.

#help reference

Provides assistance with configuration syntax by displaying summary information for the

statement.

#help syslog

Displays information on specific syslog events.

#help tip

Random tips for using the CLI

#help topic

Displays usage guidelines for configuration statements.

Rescue Configuration

Basic Configuration

#request system configuration rescue save

#request system configuration rescue delete

Show commands

>file show /config/rescue.conf.gz

Rollback

Default Behavior

Saves previous commits between with file values between 0-49

0 is the most recent commit

Basic Configuration

#rollback <0-49>

#commit

#rollback rescue

#commit

Show Commands

>show | compare rollback <0-49>

Page 5: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

5 | P a g e

Junos Reference

Guide

Password Recovery

Procedure

1. Power off your switch by unplugging the power cord or turning off the power at the wall switch.

2. Insert one end of the Ethernet cable into the serial port on the management device and connect the other end to the console port on the back of the switch.

3. On the management device, start your asynchronous terminal emulation application (such as Microsoft Windows Hyperterminal) and select the appropriate COM port to use (for example, COM1).

4. Configure the port settings as follows:

Bits per second: 9600 Data bits: 8 Parity: None Stop bits: 1 Flow control: None

5. Power on your switch by plugging in the power cord or turning on the power atthe wall switch.

6. When the following prompt appears, press the Spacebar to access the switch's bootstrap loader command prompt:

Hit [Enter] to boot immediately, or space bar for command prompt. Booting [kernel] in 1 second...

7. At the following prompt, type boot -s to start up the system in single-user mode:

loader> boot -s

8. At the following prompt, type recovery to start the root password recovery procedure:

Enter full path name of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery

A series of messages describe consistency checks, mounting of filesystems, and initialization and checkout of management services. Then the CLI prompt appears.

9. Enter configuration mode in the CLI:

user@switch> cli

Page 6: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

6 | P a g e

Junos Reference

Guide 10. Set the root password. For example:

user@switch# set system root-authentication plain-text-password

11. At the following prompt, enter the new root password. For example:

New password: juniper1 Retype new password:

12. At the second prompt, reenter the new root password.

13. If you are finished configuring the network, commit the configuration.root@switch# commit

commit complete

14. Exit configuration mode in the CLI.

root@switch# exit

15. Exit operational mode in the CLI.

root@switch> exit

16. At the prompt, enter y to reboot the switch.

Reboot the system? [y/n] y

Initial Configuration

SSH and FTP

#set system services ssh

#set system services ftp

Hostname

#set system host-name<Hostname>

Set Root Password

#set system root-authentication plain-text-password

Page 7: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

7 | P a g e

Junos Reference

Guide

Configuring an interface

Layer 2

#edit interfaces

#set <interface> unit 0 family Ethernet-switching

#set <interface> unit 0 family Ethernet-switching port-mode access

#set <interface> ether-options link-mode (full-duplex|half-duplex)

#set <interface> ether-options speed (100m|1g|10g)

#set <interface> ethernet-switching vlan members <Vlan ID>

Layer 3

#set interface <interface> unit 0 family inet address <IP address/mask>

Disable and Enable

#set interfaces <interface> disable

#delete interfaces <interface> disable

Show commands

>show interface s terse

>show interfaces terse | match <interface>

>show interfaces <interface> terse

>show interfaces <interface>

>show interfaces <interface> extensive

Configuring Vlans

Basic configuration

#edit vlans

#set <Vlan Name> vlan-id <Vlan ID>

Adding interfaces

#edit vlans

#set <Vlan Name> vlan-id <Vlan ID> interfaces <Interface>

Show Commands

>show vlans

>show Ethernet-switching interfaces

>show Ethernet-switching table

Page 8: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

8 | P a g e

Junos Reference

Guide Rapid Spanning Tree Protocol (RSTP)

Basic Configuration

#set protocols rstp

Show Commands

>show spanning-tree bridge

>show spanning-tree interface

>show spanning-tree interface <interface> detail

>show ethernet-switching interfaces

Configuring Routed Virtual Interfaces (RVI)

Basic Configuration

#edit interfaces

#set vlan unit <#> family inet address <IP Address/Mask>

#top edit vlans

#set <Vlan Name> L3-interface vlan.<#>

Show Commands

>show interfaces vlan terse

>show configuration routing-instances

Configuring an Aggregated Ethernet Interface

Basic Configuration

#set chassis aggregated-devices Ethernet device-count <#>

Adding Ports to the AE

#edit interfaces

#set ae<#> unit 0 family ethernet-switching

#set <Interface> ether-options 802.3ad ae<#>

Configuring the AE

#set interfaces ae<#> unit 0 family inet address <IP address/Mask>

#set interfaces ae<#> aggregated-ether-options lacp active

Page 9: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

9 | P a g e

Junos Reference

Guide Show Commands

>show interfaces terse

>show interfaces ae<#> terse

Configuring Trunk Ports

Basic configuration

#edit interfaces

#set <interface> unit 0 family Ethernet-switching port-mode trunk

Adding Vlans

#edit interfaces

#set <interface> unit 0 family Ethernet-switching vlan members <Vlan ID>

#set <interface> unit 0 family Ethernet-switching vlan members all

Show Commands

>show vlans

>show Ethernet-switching interfaces

>show Ethernet-switching table

Static Route

Basic Configuration

#set routing-options static route <Destination> next-hop <nexthopIP>

Show Commands

>show route protocol static

>show Ethernet-switching interfaces

>show Ethernet-switching table

>show router forwarding-table destination <Destination IP>

OSPF

Basic Configuration

#edit protocols ospf

#set area <Area ID> interface <Interface>

Page 10: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

10 | P a g e

Junos Reference

Guide Defining Area Types

#set area<Area ID> stub

#set area<Area ID> stub default-metric 1

#set area<Area ID> nssa

#set area <Area ID> nssa default-lsa default-metric 1

Passive Interface

#edit protocols ospf

#set area <Area ID> interface <Interface> passive

Show Commands

>show ospf neighbor

>show route protocol ospf

>show router forwarding-table destination <Destination IP>

>show route <Destination IP>

Authentication

#edit protocols ospf area <Area ID>

#set interface <interface> authentication md5 1 key <Key>

BFD

#edit protocols ospf area 0 interface <Interface> bfd-liveness-detection

#set minimum-interval <interval>

#multiplier <value>

Virtual Link

#edit protocols ospf area <area id> virtual-link

#set neighbor-id <Neighbor IP> transit-area <Transit area ID>

Static2OSPF redistribution example

policy-statement static2ospf{

term match-internal-static{

from{

protocol static;

route-filter 192.168.0.0/16 orlonger;

}

then {

metric 100;

external{

type 2;

Page 11: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

11 | P a g e

Junos Reference

Guide }

accept;

}

}

}

BGP

Default Behavior:

Accept all routes advertised from established BGP peers

Send all EBGP peers all BGP-received routes that area active in the routing table

IBGP-learned routes area not advertised to IBGP peers

Basic Configuration

#edit protocols bgp

#set group <groupname> local-address <Source Address or Loopback>

#set group <groupname> type (internal|external)

#set group <groupname> peer-as <AS number>

#set group <groupname> neighbor <Neighbor IP>

Route Aggregation

#set routing-options aggregate route <Aggregate Route IP>

Show Commands

>show bgp summary

>show bgp neighbor

>show router advertising-protocol bgp <Neighbor IP>

>show route receive-protocol bgp <Neighbor IP>

>show bgp neighbor <Neighbor IP>

>show router forwarding-table destination <Destination IP>

Defining a policy

Basic Configuration

#set policy-options prefix-list <Prefix list Name> <IP/mask>

#edit policy-options policy-statement <Statement Name>

Page 12: JUNOsReference · 3 | P a g e Junos Reference Guide Adding Ports to the AE ..... 8

12 | P a g e

Junos Reference

Guide #edit term <Term Name>

#set from prefix-list-filter <Prefix list Name> (orlonger|exact| Refer to options available)

#set then reject

Policy Example

prefix-list internal-prefixes{

172.20.4.0/22;

}

policy-statement block-internal-routes{

term internal-routes{

from{

prefix-list-filter internal-prefixes orlonger;

}

then reject;

}

}

policy-statement send-internal-routes-only{

term accept-internal-routes{

from {

prefix-list-filter internal-prefixes exact;

}

then accept;

}

term reject-all{

then reject;

}

}