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
showchassisalarm Chassisalarmstatus
showchassiscraft-interface Informationcurrentlyoncraft display
set chassisdisplaymessage"M40eunit for swap" displaysauser definedmessageontheLCD craft interface
showchassisenvironment Environmental information& temperature
showchassistemperature-thresholds Displaystemperaturethresholds
showchassisrouting-engine Displaysinfoabout theRE, memory& CPU utilization
showchassishardware detail/frus/ext Hardwareinventory+serial numbers; frusshowsfans; ext showseeprom, flash/disk capacity
showchassisfpc displaysstatusof all FPCsinstalled(memheapshouldbe<80%!)
showchassisfpcdetail includesalsoSRAM/SDRAM availableMemandusage
showchassisfpcpic-satus Displaysinfofor all PICs
showchassispicfpc-slot 0pic-slot 1 Displaysinfoabout oneparticular PIC
showchassismac-addresses MAC address
showchassis[feb| scb| ssb| sfmslot ] displayssatusabout PFE systemcontrol board(temp, cpu%,DRAM)
System management
showhost nslookup show host www.cisco.com
showversion displayssoftwarerunningonthebox
showsystemsoftware detail displaysinstalledpackages
showsystemuptime uptimeof therouter
showsystemprocesses extensive/summary Showtheprocesstable
showsystemstatistics ip, icmp, Showprotocol statistics
showsystemconnections listsonlyactiveIP socketsonRE
showsystemusers Showuserscurrentlyloggedintothesystem
showsystemstorage displaystheamount of amount of freedisk spaceonfilesystem
root%df -k show system storage from Shell
showsystemboot-messages displayscontentsof boot log (boot-upmessages)
showsystemvirtual-memory displayscurrent memorystate
request systemreboot Restartsthesystem
request systemhalt Stopstherouter andpreparesit tobeshut down
request systemreboot Reboot thesystem
request systemsnapshot Saveconfigin/altconfigandsoftwarein/altroot beforeupgrade
request support information showtech
request systemsoftwareadd<pkgname> performsbsdpgkadd; alwaysusejbundle(4->5jinstall)
restart <process>[ gracefully, immediately, soft] Restart process
request chassisrouting-enginediagnosticsall (hidden) runsadiagnosticscript incompact-flash,hard-disk & memory
request systemstoragecleanup Freestoragespaceontherouter byrotatinglogfilesandproposingalist
of filesfor deletion. User input isrequiredfor filedeletion.
Configuration
configuration entersconfigurationmode
show displaysthecurrent configuration show protocols ospf
| match item filterstheoutput of thecommand show config | match firewall
| finditem filtersstartingwiththeregular expression show config | find firewall
| save<file> saveconfigurationas<file>
edit modifiesconfigurationstatements edit protocols ospf
set setsconfigurationstatements set chassis alarm sonet lo1 red
delete removesconfigurationstatements
exit existsedit modeandalsoconfigmode
commit save, validateandactivateacompleteconfig
commit check just check configdonot apply
commit confirmedx activatesconfigfor ax minutesandthenask for confirmation, x=10default
commit and-quit activatesconfigandexistsedit mode
commit synchronize activatesconfigonactiveRE andreplicatesit intobackupRE
commit full (hidden) signalstoall daemonsaSIGHUP (kill -1) whichforcesthemtoreadtheir configfiles(restartsall daemons)
root%mgd-l (hidden) from shell sameascommit full but fromshell
commit at activatesconfigat agiventime(scheduleacommit) commit at "18:00:00"
clear systemcommit Clear all pendingcommit requests
rollback 0 deletestheneweditedchangesandreturnstocurrent config
rollback returnstothelast commitedconfig
rollback + commit it will returntopreviouslysavedconfig. Onlyat thetoplevel!
loadmerge</var/home/user/config> combinesthecurrent configandthenewone
loadoverride</var/home/user/config> erasesthecandidateconfigandreplacesit with"luis"
loadmergeterminal copyandpasteportionsof theconfig, vanaf root config
loadfactory-default loadsthefactorydefault settingsconfig router# load override /packages/mnt/jbase/sbin/install/default-juniper.conf
show| compare comparesthecandidateconfigwiththerunningconfig
showsystemrollback 40 displaysarollback file
showsystemrollback compare032 showsdifferencesbetweenrollbacks0and32files
save savesconfigin/var/homedirectory save CJNR-reset
saveusername@host:filename savesconfiginremotesystemusingssh save [email protected]:SYD-AJNR-basic-intf
showconfigurationgroupsjunos-defaults (hidden) displaysonlycertainJ UNOS default settins(system/services/apps)
Managing files
start shell
/config flashdisk containsactiveconfigandrollbacks1,2& 3
/var/db/config harddisk containsrollback files4through49
/var/tmp harddisk containscorefilesgeneratedbythedaemonswhentheycrash
/var/log harddisk filesgeneratedbytheloggingandtraceoptions
/var/home harddisk containssubdirectoryper user
/altroot harddisk containsacopyof theroot filestructureformtheflashdrive request system snapshot
/altconfig harddisk containsacopyof the/configfilestructureontheflashdrive request system snapshot
filelist displaysall filesonthisuser homedirectory
filelist /config displaysall filesonthe/configdirectory
fileshow<file> displayscontent of <file>
filedelete deletesafilefromharddisk file delete /var/tmp/smpd.core
filecopysource destination copiesfilesfromoneRE totheother GRTAMSTC1>file copy /var/home/jinstall-6.2-domestic-signed.tgz re0:/var/home/lgomez
filecopyfilename ftp://hostname/filename ftp CopyFilesfromtheLocal Router toaRemoteSystem
root@host>filecopy/config/juniper.conf ftp://jvserver.uu.net/tmp/juniper.conf
root@host>filecopy/config/juniper.conf ftp://[email protected]/tmp/juniper.conf
filecopyfilenamescp://user@hostname/filename scp root@host>filecopy/config/juniper.conf scp://user@ssh-host/tmp/juniper.conf
filecopy ftp://hostname/filename filename ftp CopyFilesfromaRemoteSystemtothelocal router root@host>filecopy ftp://jvserver.uu.net/jbundle-package-name /var/tmp/jbundle-package-name
root@host>filecopy ftp://[email protected]/jbundle-package-name /var/tmp/jbundle-package-name
showsystemrollback 40 displaysarollback file
showsystemrollback compare032 showsdifferencesbetweenrollbacks0and32files
Logs locatedin/var/log
showlogmessages showsall thelogs, locationis/var/log
showlog file-name showslogsabout anspecificlogfile show log bgp-events.0
showlogcli showlogsabout cli commandsissued
showlogchassisd showlogsabout chassisprobs
showloginstall showlogsreleveant toaninstall J UNOS version
showlogdebug showdaemonlogs
showlogmessages? displaysall thefileswiththeir datesof thecollectedlogs
showloginventory showslogsabout inventory
monitor start file-name monitorslogsinreal time
monitor stop stopsmonitoring
helpsyslog explanationof logmeaning help syslog ASP SFW IP FRAGMENT ASSEMBLY TIMEOUT
Show interfaces
showinterfaces detail showsdetailedinfoabout aninterface
extensive showsall possibleinfoabout aninterface(verydetailed)
terse showsipinterfacebrief
description showsinterfacesdescription
media Displaymediainformation
statistics Displaystatisticsanddetailedinfo
routing Displayroutingstatus
monitor interfacex-x/x/x monitorsinterfacereal-timestatistics
monitor trafficinterfacex-x/x/x printspacket headerstoyour terminal screenfor infosent/receivedbytheRE. Nofilteringallowed!!
monitor trafficinterfacex-x/x/x write-file[file] (hidden) writesoutput tothiscommandtoafile, withL2headerspresent
all infoisstoredinafilesoyoucanusetcpdumptoreadit monitor traffic interface fe-0/0/0 write-file dump
%tcpdump-r Shell command readthecontentsof atcpdumpfile XR1.AMS6> start shell
% tcpdump -r dump icmp
monitor start <var/log/file> printslogfiletoyour terminal screen
showarp showsARP entries
clear interfacesstatisticsso-2/0/1 reset counters& statisticsfor thisparticular interface
showinterfacesdiagnosticsopticsso-1/0/0 displaysSONET signalingpower valuesandlaser Tx Rx
Routing
showroute showiproute
showrouteprotocol [static, isis] showiproutefor anspecificprotocol show route protocol static
showroutex.x.x.x extensive extensiveviewof aroute
showrouteadvertising-protocol
showroutereceiving-protocol
Forwarding
showrouteforwarding-tabledestinationx.x.x.x displaysrouteentriesinthemaster copyof theFT (onRE) XR1.AMS6> show route forwarding-table destination 192.168.20.1
clear routeforwarding-tablex.x.x.x clearsentriesfromtheFT (becareful! couldleadtoRIB/FIB inconsistencies!!)
SFM0(vty)#showrouteipprefix x.x.x.x Shell command displaysrouteentriesintothePFE FT (shouldbeidentical toRE FT)
Firewall
showfirewall showpacket/bytecountsfor all policingfilters
showfirewall log detail loginmemoryresident buffer/kernel cache(detail: packet length)
clear firewall [all|filter-name|counter-name] clearscounters
showinterfacesfilters displaysall firewall filtersonall interfaces
showinterfacespolicers displaysall firewall policersonall interfaces
showpolicer displaysall policers, whereit isusedandno. packetsprocessed
Management & Interface testing
ping icmpecho-request/echo-response
pingatminterface<intf>vci <nr> pingremoteatminterfaceusingoamcells
traceroute sendudp33434/ttl=1- receiveicmptime-exceeded
sendudp33435/ttl=2- receiveicmptime-exceeded