Juniper Commands v2
Juniper Commands v2
Juniper Commands v2
Furthermore, care must be taken at the time to use Shell commands!! (only under JTAC supervision)
COMMAND Description Example
Chassis Management
System management
Configuration
Managing files
start shell
/config flashdisk contains active config and rollbacks 1,2 & 3
/var/db/config harddisk contains rollback files 4 through 49
/var/tmp harddisk contains core files generated by the daemons when they crash
/var/log harddisk files generated by the logging and traceoptions
/var/home harddisk contains subdirectory per user
/altroot harddisk contains a copy of the root file structure form the flash drive request system snapshot
/altconfig harddisk contains a copy of the /config file structure on the flash drive request system snapshot
file list displays all files on this user home directory
file list /config displays all files on the /config directory
file show <file> displays content of <file>
file delete deletes a file from hard disk file delete /var/tmp/smpd.core
file copy source destination copies files from one RE to the other GRTAMSTC1> file copy /var/home/jinstall-6.2-domestic-signed.tgz re0:/var/home/lgomez
root@host> file copy /config/juniper.conf ftp://jvserver.uu.net/tmp/juniper.conf
file copy filename ftp://hostname/filename ftp Copy Files from the Local Router to a Remote System
root@host> file copy /config/juniper.conf ftp://[email protected]/tmp/juniper.conf
file copy filename scp://user@hostname/filename scp root@host> file copy /config/juniper.conf scp://user@ssh-host/tmp/juniper.conf
file copy ftp://hostname/filename filename ftp Copy Files from a Remote System to the local router root@host> file copy ftp://jvserver.uu.net/jbundle-package-name /var/tmp/jbundle-package-name
root@host> file copy ftp://[email protected]/jbundle-package-name /var/tmp/jbundle-package-name
show system rollback 40 displays a rollback file
show system rollback compare 0 32 shows differences between rollbacks 0 and 32 files
Show interfaces
Routing
Forwarding
show route forwarding-table destination x.x.x.x displays route entries in the master copy of the FT (on RE) XR1.AMS6> show route forwarding-table destination 192.168.20.1
clear route forwarding-table x.x.x.x clears entries from the FT (be careful! could lead to RIB/FIB inconsistencies!!)
SFM0 (vty)# show route ip prefix x.x.x.x Shell command displays route entries into the PFE FT (should be identical to RE FT)
Firewall
BERT test
set t3-options bert-period 120 BERT test duration
set t3-options bert-algorithm all-ones-repeating BERT test pattern
set t3-options bert-error-rate 0 BERT test error rate
test interface t3-1/2/0 t3-bert-start Starts BERT test
test interface t3-1/2/0 t3-bert-stop Stops BERT test
show interfaces t3-1/2/0 extensive | find bert
Policy
test policy <policy-name> 0/0 Pass all routes (0/0) through the policy as test
COMMAND
JTAC support info
start shell
root% df -k
root% mgd -l
% sysctl -a | grep bootdev
Resetting cards
restart ….
#deactivate protocols ospf
% which rpd
% ps ax | grep rpd
Core Files
RE & Redundancy
PFE
SFM0/FEB/CFEB
file copy
root% dd if=/dev/rad3 of=/dev/null bs=1k count=1
show system storage
% sysctl -a | grep bootdev
% sysctl -w machdep.bootdevs=pcmcia-flash,compact-flash,disk,lan
request chassis routing-engine diagnostics all (hidden)
request system snapshot
request system software add validate /var/tmp/jinstall-6.4R3-domestic.tgz
request system reboot
Shell Commands
i) Kernel related
% sysctl -a
% sysctl -a | grep dump
% sysctl -a | grep bootdev
% sysctl -w
boot: /boot/loader
Description
collects shoversion, uptime, hardware, processes, pfe stats, fpc detail, boot messages, memory, buffers, stats, etc
Displays info about a file. If you specify a particular PCB you will
determine what PROCESS is actually using one particular port
(get the PCB from the netstat -Aa command listed port)
copies files from one place to the other (i.e. between REs)
Checks there is no removable media inserted.
displays the amount of amount of free disk space on file system
shows boot devices
alters the order of the booting devices
runs a diagnostic script in compact-flash,hard-disk & memory
Save config in /altconfig and software in /altroot before upgrade
Installs JUNOS package, validating against potential config errors
Reboot the system
% sysctl -w machdep.bootdevs=pcmcia-flash,compact-flash,disk,lan
Show commands
Show commands
show ospf neighbor view status of OSPF neighbors, priority, dead intervals, FSM state
show ospf neighbor extensive view detailed info about an ospf neighbor (area, option
fields, DR, BDR...)
clear ospf neighbor [192.168.254.225] restarts an adjacency or all
show ospf statistics view basic ospf statistics, number of Hellos, DD
LSRs, LSUs, LSAcks. OSPF packet types + LSA rexmit
show ospf interface view status of an interface, Area, DR, BDR, Neighbors,
State (DR, BDR, DRother, PtoP, Down)
show ospf interface extensive ...also cost, MTU
show ospf route abr The results of the SPF algorithm, LSA type, metric...
asbr
extern
show route protocol ospf viet ospf routes in inet.0 (routing table) show route protocol ospf 192.168/16 terse
show ospf database view the LSA database per area, Seq no./Age/Checksum, Options
show ospf database summary view how many LSA types per area (usefull!!)
show ospf database brief view the LSA database briefly described
clear ospf database purge deletes de database and restarts adjacencies, purge floods LSA with maxage
show ospf database router view the LSA specific type database
network
netsummary
asbrsummary
extern
nssa
show ospf database router advertising-router 10.0.3.3 detail view LSAs advertised by a paricular router ID show ospf database router advertising-router 10.0.3.4 detail
show ospf database router area 0 extensive view the LSA database in a particular area
LSA header (opt bits, ID, advertis rtr)
LSA type content (V E B bits and all packet)
show ospf database area 0 lsa-id extensive view one particular LSA in detail show ospf database area 0 lsa-id 192.168.1.1 extensive
show ospf log displays how often the SPF is being initiated
Show commands
show isis adjacency view status of ISIS adjacencies, Level, state, SNPA, Hold time
show isis adjacency extensive restart capability, piority, circuit type, ip address
clear isis adjacency clears and restarts an adjacency
show isis interface displays the interfaces that are operational for isis
show isis interface details interface, level, circuit ID, DR Level 1/2, Metric
show isis hostname verifies the dynamic hostname resolution of system ID values
show isis spf log displays history of SPF calculations, why it was performed
show isis statistics verifies which isis PDUs are being transmitted/received
(IIH, LSP, CSNP, PSNP) and number of SPF runs
show isis route displays the results of the SPF calculations before the
routes are places into the routing table.
show route protocol isis view routes in inet.0
show isis database displays LSPs on the database, including sequence, checksum,
lifetime and attributes
show isis database detail displays advertised prefixes, metrics, origin for each route
show isis database GRTMADPE2 detail
show isis database extensive [level 1 | 2] … plus LSP headers and all TVL details
monitor traffic interface so-0/0/0 size 1514 detail Monitor IS-IS messages
Show commands
show bgp summary peers, ASN, Flaps, routes active/received/damped + total/active paths
show bgp group view the configured peer groups
show bgp neighbor detailed info about bgp peers
(AS number, hold time, router IDs, prefixes, NLRI support, capabilities
and received routes, no of input/output packets, state...)
show route next-hop database shows the bgp next-hop dB
show route protocol bgp RIB shows the Local-RIB database as part of inet.0, next-hop, metric1/2 AS-path
show route protocol bgp terse shows next-hop but not protocol next-hop
show route receive-protocol bgp RIB shows the Adjacency-RIB-In table.
(routes received by a peer before a routing policy is applied)
show route advertising-protocol bgp RIB shows the Adjacency-RIB-Out table
(routes being advertised to a peer after routing policy is applied)
show route detail 10.10.1/24 all of the BGP attributes of this route, metric=MED, metric2=IGP cost
show route hidden shows routes with unreachable next-hops
clear bgp neighbor soft inbound to regain routes not in Adj-Rib-In (keep none or loops)
monitor traffic interface fe-0/0/0 size 4096 detail Monitors BGP messages
COMMAND Description Example
Show commands
IGMP
show igmp interface shows state, querier (DR for that segment), version (default 2) and IGMP timers
show igmp group shows the multicast groups joined
show igmp statistics shows igmp message statistics
PIM
show pim interface lists configured PIM interfaces -- mode (default sparse), state (DR, ptp), neighbors
show pim neighbors detail shows info about pim neighboring routers
show pim statistics shows pim messages being sent or received
show pim join extensive shows current state of pim joins, multicast group address & interface used to forward streams. Also rpt or stp tree in use
displays (*,G) and (S,G) states and also RPF interface info
clear pim join flushes join states!
show pim source detail shows active multicast sources and their RPF intf.
also multicast groups serviced by these source
show pim rps extensive shows the RP addresses, how it was learned and which groups are served
show pim bootstrap shows the BSR election process and state
RPF
show multicast usage to view packets/bytes seen for every multicast group address
show multicast rpf !!!! to view the RPF table used during multicast forwarding, similar to inet.0
displays source prefix, from which protocol was learned & the uptsream interface
show multicast route to verify multicast group addresses and their sources (S,G)
extensive also displais NHID which are a numerical reference to the OIL
show route table inet.1 as above with protocol and preference (S,G)
show multicast next-hops displays the multicast outgoing interface list (OIL), mapping of NHid to interfaces
show nhdb id … extensive next-hop database with IFL-list
MSDP
show multicast rpf inet summary displays what table multicast uses (inet.0 by default)
COMMAND Description Example
Show commands
show mpls interface shows status of an mpls interface and admin groups (colors)
show mpls lsp verify the establishment of the LSP at ingress, egress or transit level AND the label in/out/Pushed values
show mpls lsp extensive history of LSP, paths and RRO is shown
show mpls lsp ingress extensive show the originated LSPs at ingress. Also secondary paths are showed and fast reroute
show mpls lsp transit show transit LSPs
show ted database extensive Examines the info in the TE database, including all IGP extensions
(admin groups -colors-, BW priority reservations)
RSVP
show rsvp interface shows status of RSVP interfaces, Active resv, Subscription rate, Bandwidth allocations
show rsvp neighbor shows RSVP neighbors which has an LSP active, also Hello-interval
show rsvp session detail shows ingress/egress/transit sessions and the label in/out values assigned!!! RRO, Style, ERO and also bypass LSPs
show rsvp session ingress detail shows also the links used by detour paths and their status
show rsvp version shows RSVP version, soft-state refresh timer, keep-multiplier (hello & soft-state use same)
show route table mpls.0 shows MPLS switching table (label values)
show route table inet.3 shows LSP table. RSVP info is installed here
LDP
L3 VPN COMMANDS
Show commands
show route table vpn-a detail shows this particular VRF table, containing watch for the inner (VPN) & outer (LSP) labels
* all routes learned from CE
* all routes imported from l3vpn.bgp table coming from other PEs
show route table vpn-a hidden If LSP is missing between PEs, VPN IPv4 routes will be visible but with and invalid NH
show route forwarding-table vpn vpn-a shows a VRF forwwarding table (note the double push operation)
show route table bgp.l3vpn.0 houses all VPN IPv4 routes learned from all PEs
DEFAULT: only store routes with a matched RT
"keep all" knob: store all MBGP routes even if there is no matched RT
show route advertising-protocol bgp x.x.x.x view routes sent to other PEs
show route receive-protocol bgp x.x.x.x view routes received from other PEs
show arp displays ARP entries in both inet.0 and VRF tables
clear arp vpn vpn-a clears ARP entries off the VRP table
show ospf interface instance vpn-a displays all configured OSPF interfaces on this VRF
show ospf neighbor instance vpn-a displays all OSPF neighbors on this VRF
show ospf database instance vpn-a displays the LSDB for this particular VRF
L2 VPN COMMANDS
show l2vpn connections extensive shows states of layer 2 vpns connections (site to site)
show route table vpn-a detail shows contents of a VFT, including L2 NLRI = RD + Site ID + label offset
* local site L2 NLRIs advertised to other PEs [L2VPN]
* remote site L2 NLRIs coming from other PEs [BGP]
show route table bgp.l2vpn.0 houses all L2 VPN NLRIs with at least one matching RT
show route advertising-protocol bgp x.x.x.x view L2 VPN NLRIs sent to other PEs
show route receive-protocol bgp x.x.x.x view L2 VPN NLRIs received from other PEs
show route table mpls.o detail shows MPLS switching table entries for L2 VPNs
(displays VRF interfaces to label -double push operation- mappings)
((which VRF interface is mapped to which LSP))
show route forwarding-table family mpls view FT entries for L2 VPN connections
ping mpls l2vpn instance vpn-a remote-site-id 2 local-site-id 1 test the l2vpn connection site to site (PE to PE)
ping mpls l2vpn interface fe-0/0/0.512 test the l2vpn local interface
show l2circuit connections extensive shows states of layer 2 circuits connections (site to site)
show ldp neighbor detail check if neighbor relationship is successful between PEs
(use of extended neighbor discovery has worked)
show ldp database detail check the presence of a FEC associated with the l2circuit
COMMAND
Show commands
shows what CoS parameters are in effect for a given interface. Number of queues
i.e. which scheduler map, classifier, rewrite is applied
shows listing of cos bits to simbolic name mapings: DSCP, inet-prec, exp…
shows mappings between simbolic names and dscp values (unless configured, default will apply)
shows mappings between simbolic names and IP prec values
shows mappings between simbolic names and EXP values
Filter: lo0-in
Counters:
Name Bytes Packets
denied-traffic 3480 61
Policers:
Name Packets
police-icmp-icmp 132
syslog {
file filtering {
firewall info;
}
COMMAND
Show commands
shows output of xml tags. What variables are consulted for the display
Example
COMMAND Description Example
Show commands