JUNOS Cheatsheet
#
JUNOS is the operating system used by Juniper Networks devices, including routers and switches. This cheatsheet provides common commands and configurations for JUNOS.
Basic Commands
#
Command/Option | Example | Description |
---|
show version | show version | Display the JUNOS version and device info |
show configuration | show configuration | Display the current configuration |
show system uptime | show system uptime | Display the system uptime |
cli | cli | Enter the CLI mode |
commit | commit | Commit the current configuration |
rollback | rollback 1 | Rollback to a previous configuration |
Interface Configuration
#
Command/Option | Example | Description |
---|
edit interfaces | edit interfaces | Enter interface configuration mode |
set interface | set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/24 | Set IP address and subnet mask |
delete interface | delete interfaces ge-0/0/0 | Remove interface configuration |
show interfaces | show interfaces | Display interface status |
commit | commit | Apply the configuration changes |
VLAN Configuration
#
Command/Option | Example | Description |
---|
edit vlans | edit vlans | Enter VLAN configuration mode |
set vlan | set vlans VLAN10 vlan-id 10 | Create VLAN with ID 10 |
set interface | set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members VLAN10 | Add interface to VLAN |
show vlans | show vlans | Display VLAN configuration |
delete vlan | delete vlans VLAN10 | Remove VLAN configuration |
Routing Configuration
#
Command/Option | Example | Description |
---|
edit routing-options | edit routing-options | Enter routing options configuration mode |
set static-route | set routing-options static route 192.168.1.0/24 next-hop 192.168.1.1 | Configure a static route |
edit protocols | edit protocols ospf | Enter OSPF configuration mode |
set area | set protocols ospf area 0.0.0.0 | Configure OSPF area |
show routing-options | show routing-options | Display routing options configuration |
Access Control
#
Command/Option | Example | Description |
---|
edit firewall | edit firewall | Enter firewall filter configuration mode |
set filter | set firewall family inet filter MYFILTER term MYTERM then accept | Create a firewall filter |
show firewall | show firewall | Display firewall configuration |
delete filter | delete firewall family inet filter MYFILTER | Remove a firewall filter |
NAT Configuration
#
Command/Option | Example | Description |
---|
edit security | edit security | Enter NAT configuration mode |
set nat | set security nat source rule-set SOURCE_RULE_SET rule SOURCE_RULE match source-address 192.168.1.0/24 | Configure NAT rule |
show security nat | show security nat | Display NAT configuration |
Troubleshooting
#
Command/Option | Example | Description |
---|
ping | ping 8.8.8.8 | Test connectivity to a remote host |
traceroute | traceroute 8.8.8.8 | Trace the route to a remote host |
show interfaces | show interfaces | Display interface status |
show log | show log | Display system log |
Management
#
Command/Option | Example | Description |
---|
cli | cli | Enter CLI mode |
commit | commit | Apply the configuration changes |
rollback | rollback 1 | Rollback to a previous configuration |
reboot | reboot | Reboot the device |
This cheatsheet covers essential JUNOS commands for configuration, management, and troubleshooting of Juniper devices. For detailed command syntax and additional options, consult the Juniper documentation.