This is a draft cheat sheet. It is a work in progress and is not finished yet.
Interface Naming
FCP [Flexible PIC concentrator] |
| The actual card itself |
PIC [Physical Interface Card] |
| interface card within a Line Card |
Port |
| The port number on the card |
ge |
| 1 gig |
xe |
| 10 gigs |
et |
| 40 gigs |
ge-0/1/1 |
| Gig, line card |
fxp0 |
| is the name of the mgmt interface |
The text fpc 0 refers to the line card on this device, whilst you might remember that PIC is an interface card within this line card.
CLI Junos OS
Junos is set up in a directory fashion like Linux distributions |
Results can be viewed in one of two ways |
Set View | Line by line as in Linux distributions |
Hierarchy View | Code writing type display |
Understanding Hierarchy [Directory] Structure
Level 1 | version |
Level 2 | system |
Level 3 | chassis |
The chassis hierarchy is where you configure physical device settings for your Junos device. This is also where you can configure device settings for your vMX. |
Level 4 | interfaces |
Level 5 | protocols |
Up - will back up one level in the directory
Top - will move to the root directory
Sub Hierarchies
host name |
root-authentication |
log in |
All sub hierarchies—it will be indented once to the right, when compared to the top-level hierarchies.
Show Command Level of Information Returned
show interface |
descriptions |
|
terse |
IP and interface state |
|
brief |
|
detail |
|
extensive |
wildcard search |
ex-0/1/* |
Extending the Commands with a Pipe
Pipes help narrow search results |
| count |
|
| find |
|
| save |
You can use multiple pipes in one search |
show interfaces xe-0/1/* | match "physical | count" |
after pipe goes in quotes |
Keyboard Shortcuts
ctrl-a |
| beginning of the command line |
ctrl-e |
| end of the command line |
ctrl-k |
ctrl-w |
| deletes the word |
Logs
Create syslog file |
| set system syslog file CONFIG_CHANGES.txt change-log any |
Edit the properties of syslog file |
| set system syslog file CONFIG_CHANGES.txt archive size 1M files 4 no-world-readable |
Read log file |
| show log CONFIG_CHANGES.txt |
Rerad log files in real time |
| monitor start messages |
|
| monitor stop messages |
|
|
Show Command Basic System Information
show configuration | display set |
| This displays the full device config |
show system uptime |
| Displays current time, last system boot |
show system information |
| Displays the model, OS family, OS version & hostname |
show route |
| Displays the routing table |
show system users |
| Displays currently logged in users |
show configuration system services | display set |
| Displays running services |
show configuration system login |display set |
| will display any users built on this device |
show configuration interfaces | display set |
show configuration interfaces ge-0/0/2 | display set |
show configuration protocols | display set |
Configuration Mode Levels
employee@router_1 > configure |
creates a duplicate [candidate] file multiple people can edit the same candidate record |
employee@router_1 > configure private |
each editor has their own copy of the candidate record however, users can still save on top of each other |
employee@router_1 > configure exclusive |
locks the candidate record; no one else can modify |
Configuration Mode
employee@ROUTER_1 > |
configure |
employee@ROUTER_1# |
In Configuration Mode |
commit check |
| verifies syntax |
show | compare |
| displays the differences between the 2 configs |
rollback |
| returns to the previous configuration |
commit confirmed 20 |
| commits config must confirm in 20 minutes or auto rollback |
commit confirmed w/ no time |
| Defaults to 10 minutes |
commit and-quit |
commit comment |
| allows user to ad comments to config file |
|
show |
| must add the word "run" to any command at this level |
commit at "18:00:00" |
| sets time for commit |
commit at " 2023-10-06 14:00:00" |
| sets commit day and time |
clear system commit |
|
Example |
Change device name |
| set host-name ROUTER_1 |
LLDP - Link Layer Discovery Protocol
show lldp neighbors | |
hostname |
|
port name |
|
MAC |
|
POE ability |
|
Vendor |
All devices must have LLDP configured for this to work |
Troubleshooting
disable port |
| set interfaces ge-0/0/2 disable |
enable |
| set interfaces ge-0/0/2 enable |
commit and-quit |
Troubleshooting
show configuration system syslog |
| messages & interactive-commands |
|
show log messages |
|
show log interactive-commands |
|
shoe log interactive-commands | match "word" |
script logging is indicated by the word "netconf" |
Narrow log results |
show log interactive-commands | match lab | last 15 |
|
show log interactive-commands | match "word 1" "word 2" |
|
show log messages | match "down|error" |
|
Send a syslog |
|
By default, logs are stored in /var/log
|