Common commands
# compare changes
show | compare# show specific block
show | find protocols# save config to file 'common'
save common# load config from file 'common'
load override/merge common
# commit changes
commit ? # show optionscommit check # check correctness of the config
commit confirmed <min> # automatically rollback if not confirmed recommended!!, default is 10# restore older config
# older file incrementing by 1 until the juniper.conf.9.gz file is reached.rollback 1# show interface terseshow interfaces so-2/0/0 terse# deactivate interface (means ignore configuration but interface is still up)
deactivate ae-1/0/1
activate ae-1/0/1# disable (the link will be down)
set fxp0 disable
delete fxp0 disable
route table
# show all routes
show route# show route of a specific ip
show route <ip># show static routes
show route protocol static# show route table lan
show route table lan
show route 0.0.0.0/0 exact# show forwarding table
#https://www.juniper.net/documentation/us/en/software/junos/routing-policy/bgp/topics/ref/command/show-route-forwarding-table.html
show route forwarding-table destination 10.3.0.1/24
show route forwarding-table table <table>
show route forwarding-table detail
# show forwarding-options next-hop-group# collect the neighbor information from bgp summary
show bgp summary# Display the routing information as it was received through a particular neighbor using a particular dynamic routing protocol.
show route receive-protocol bgp <ip>
filtering
# edit default route policy
edit policy-options policy-statement <export_profile> term default-route
set prefix-list <list-name>
set then accept
up
set term reject then reject
Files on the router
- /config : on router’s internal flash drive. It contains active and rollback configs(1,2,3)
- /var/db/config: on router’s hard drive. It contains rollback files from 4 to 9
- /var/tmp: holds various core files from routing engine
- /altroot: a copy of root file structure from internal flash drive
- /altconfig: a copy of /config file structure from internal flash drive
# file related commands
file ?file compare # compare files
file list /config(/? for wildcard) # list files
Redundancy on Routing Engine
# 20s non configurable for keeplive
# edit chassis
set redundancy failover on-loss-of-keepalives# adjust failover timer
set redundancy keepalive-time 30
Interfaces
Router’s inter- faces are located on a PIC. The PIC is located on a particular Flexible PIC Concentrator (FPC), which is inserted in a router’s chassis
Naming structure
<media-type>-<fpc>/<pic>/<port>.<unit>
- media type: A two character designator uniquely identifies the type of physical interface
- fpc: The physical slot in the chassis where the interface is located
- pic: The slot on the fpc contains the interface
- port: The location on the PIC where the interface port is located
- unit: The logical portion of the interface contains properties
Media type
- ae: Aggregated Ethernet interface
- fe: Fast Ethernet interface
- fxp: Management and Internal Ethernet interfaces
- ge: Gigabit Ethernet interface
Interface Properties
- Physical interface: determined by media type (Keeplives, MTU, Encapsulation, Frame Check Sequence)
- Logical interface: Layer 3 routing & Layer 2 transmission parameters
More on logical Interfaces
- defined in unit (from 0)
- non-VLAN Ethernet and Loopback provide only 1 logical interface
Common properties
- Protocol family
- Logical Layer 3 addressing: use to route to user packets in the network
- MTU
- Virtual circuit (Layer 2) addressing
Protocol Families
- inet: inet protocol family supports IPv4 packets
- inet6: allow support for IPv6 packets
- iso: The Intermediate System (IS) to IS routing protocol uses data link encapsulation by International Standards Organization(ISO)
- mpls: support for processing packets encoded with a Multi-protocol Label Switching (MPLS) label. The label allows the router to forward the data packet
Virtual circuit addressing
- VLAN tagging: Juniper software supports a subset of the IEEE 802.1Q standard for channelizing an interface into multiple logical interfaces. A VLAN allows many hosts to connect to an Ethernet switch while maintaining separate logical subnets and broadcast domains. Each Ethernet interface on a Juniper Networks router can support up to 1024 VLANs. Two routers share a VLAN value, allowing data packets to be processed by the correct logical interface.
commands in interface related operations
# show interfaces
show interfaces terse# show interfaces with ip
show interfaces terse | match inet# edit interface
edit interfaces ge-0/0/1# IPv4
set unit 0 family inet address 172.16.0.1/24
set description "xxx network"
static routing
# show static route
show route protocol static
# add static route
edit routing-options
set static route <ip>/<subnet> next-hop <ip>
ATM interface
# physical attrs
edit interfaces at-0/1/0
set atm-options vpi 0 maximum-vcs 200 # setup maxinum virtual circuits
set encapsulation atm-vpc
# logical attrs
set unit 100 point-to-point
set unit 100 family inet address 10.3.0.1/24
set unit 100 vci 0.100
IS-IS
The IS-IS routing protocol uses Connectionless Network Protocol (CLNP) packets to send updates to neighboring routers
edit interfaces at-0/2/0
set unit 100 family iso
MPLS
MPLS provides a mechanism for forwarding data packets using a label value instead of an IP address. No protocol addressing is required for MPLS.
edit interfaces at-0/2/0
set unit 100 family mpls
Interfaces related commands
# can view actual data packets entering and leaving the interfaces
show interfaces extensive# display per second statistics of the physical interface
monitor interface ae-1/0/1# print packet headers for information sent or received by the routing engine
monitor traffic interface so-2/0/0# send ICMP message
ping 10.3.0.2# ping ATM to test the connectivity of specific PVCs with the ping atm command
ping atm interface at-0/2/0 vci 100# traceroute
traceroute 10.3.0.2# BERT Bit Error Rate Test
edit interfaces t3-1/2/0
set t3-options bert-period 180
set t3-options bert-algorithm all-ones-repeating
set t3-options bert-error-rate 0# testing
test interface t3-1/2/0 t3-bert-start
test interface t3-1/2/0 t3-bert-stop
BGP
Network peering
https://www.kentik.com/kentipedia/what-is-internet-peering/
Network peering works by allowing devices on one network to exchange traffic directly with devices on another network
peer-as
https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/statement/peer-as-edit-protocols-bgp.html
peer-as is the neighbor in another AS
edit protocal bgp group <aws-dc>
set neighbor <neighbor ip> peer as <ASN>
// Verify
show bgp summary
show route advertising-protocol bgp <ip>
show route receive-protocol bgp <ip>