title: Juniper SRX Series Firewalls
breadcrumbs:
- title: Network
---
{% include header.md %}
Related Pages
{:.no_toc}
Using
{:.no_toc}
Setup
Initial Setup
- Connect to the switch using serial:
- RS-232 w/ RJ45, baud 9600, 8 data bits, no parity, 1 stop bits, no flow control.
- Log in:
- It should say "Amnesiac" above the login prompt as the name of the switch, to show that it's factory reset.
- Login as
root
with no password to enter the shell.
- Enter the Junos operational CLI by typing
cli
.
- Enter configuration mode:
- Enter:
configure
- Commit:
commit
- Exit:
exit
- Set host name:
set system host-name <host-name>
set system domain-name <domain-name>
- Enable auto snapshotting and restoration on corruption:
set system auto-snapshot
- Disable DHCP auto image upgrade:
delete chassis auto-image-upgrade
- Set new root password:
set system root-authentication plain-text-password
(prompts for password)
- (Optional) Commit new config:
commit
- Setup a non-root user:
set system login user <user> [full-name <full-name>] class super-user authentication plain-text-password
(prompts for password)
- Enable IPv6 forwarding (SRX):
- Enable:
set security forwarding-options family inet6 mode flow-based
- (Info) Verify (after commit):
show security flow status
- Setup SSH:
- Enable server:
set system services ssh
- Disable root login from SSH:
set system services ssh root-login deny
- Disable licensing and phone-home (for grey-market devices):
delete system license
delete system phone-home
- Set DNS servers:
- Delete default:
delete system name-server
- Set new (for each one):
set system name-server <addr>
- Set time:
- (Optional) Set time manually (UTC):
run set date <YYYYMMDDhhmm.ss>
- Set server to use while booting (forces initial time):
set system ntp boot-server <address>
- Set server to use periodically (for tiny, incremental changes):
set system ntp server <address>
- Set time zone:
set system time-zone Europe/Oslo
(example)
- (Info) After committing, use
show ntp associations
to verify NTP.
- (Info) After committing, use
set date ntp
to force it to update. This may be required if the delta is too large and the NTP client refuses to update.
- Configure SNMP:
- (Info) SNMP is extremely slow on the Juniper devices I've tested it on.
- Enable public RO access (or generate a secret community string):
set snmp community public authorization read-only
- (Optional) Set loopback addresses (if using routing):
set interfaces lo0.0 family inet address <address>/32
set interfaces lo0.0 family inet6 address <address>/32
- (Optional) Setup static IP routes:
- IPv4 default gateway:
set routing-options rib inet.0 static route 0.0.0.0/0 next-hop <next-hop>
- IPv6 default gateway:
set routing-options rib inet6.0 static route ::/0 next-hop <next-hop>
- (Optional) Disable dedicated management port and alarm (if any):
- Disable:
set int me0 disable
- Delete logical interface:
delete int me0.0
- Disable link-down alarm:
set chassis alarm management-ethernet link-down ignore
- Delete default interfaces configs (example):
wildcard range delete interface ge-0/0/[0-7]
- (Optional) Disable unused interfaces (example):
wildcard range set interface ge-0/0/[0-7] disable
set interface cl-1/0/0 disable
set interface dl0 disable
- (Optional) Setup LACP toward upstream/downstream switch:
- (Info) Make sure you allocate enough LAG interfaces and that the interface numbers are below some arbitrary power-of-2-limit for the device model. Maybe the CLI auto-complete shows a hint toward the max.
- Set number of available LAG interfaces:
set chassis aggregated-devices ethernet device-count <0-64>
- Delete old configs for member interface:
wildcard range delete interfaces ge-0/0/[0-1]
(example)
- Add member interfaces:
wildcard range set interfaces ge-0/0/[0-1] ether-options 802.3ad ae<n>
- Add some description to member interfaces:
wildcard range set interfaces ge-0/0/[0-1] description link:switch
- Enter LAG interface:
edit interface ae<n>
- Set description:
set desc link:switch
- Set LACP active:
set aggregated-ether-options lacp active
- Set LACP fast:
set aggregated-ether-options lacp periodic fast
- (Optional) Set minimum links:
aggregated-ether-options minimum-links 1
- Delete default security (zones, policies, NAT, screens).
delete security
- Commit configuration:
commit [confirmed]
- Exit config CLI:
exit
- Save the rescue config:
request system configuration rescue save
- Save the autorecovery info:
request system autorecovery state save
- Reboot the device to change forwarding mode and stuff (if changed):
request system reboot
Interface Setup
See Juniper EX.
Other Setup
- Configure sFlow:
- TODO
Theory
SRX-specific information, see the Junos page for general information.
Packet Forwarding Mode (Packet-based and Flow-based)
- Packet-based forwarding handles packets one by one, also called stateless forwarding (similar to router ACLs). This does not handle connection tracking and other advanced features.
- Flow-based forwarding handles packets as streams, also called stateful forwarding. This is the default for IPv4 (IPv6 forwarding is disabled by default).
- Commands:
- Configured using
set security forwarding-options family inet6 mode flow-based
(example).
- Run
show security flow status
to show forwarding modes.
L2 Forwarding Mode (Transparent and Switching)
- The default mode on most newer devices/versions is switching mode.
- Switching mode:
- Basically L3 mode. Pretty similar to L3 switches, with VLANs and RVIs.
- Uses IRB interfaces in security zones.
- Does not enforce policy on intra-VLAN traffic.
- Supports LACP.
- Transparent mode:
- Basically L2 mode.
- The firewall acts like an L2 switch connected inline in the infrastructure, allowing simple integration without modifying routing and protocols.
- Does not support STP, IGMP snooping, Q-in-Q, NAT and VPNs.
- Uses physical interfaces in security zones.
- Also called L2 transparent mode (L2TM).
- Commands:
- Configured using
set protocols l2-learning global-mode {transparent-bridge|switching}
.
- Show using
show ethernet-switching global-information
.
Security Zones
- On SRX firewalls, you assign interfaces to security zones. TODO All interfaces must be assigned a zone and a zone may have zero or multiple interfaces?
- Security zones are the main type of zone.
- Function zones are for special purposes. Only the management zone ("MGT") is currently supported and does not allow exchanging traffic with other zones.
- The default policy is to deny traffic both intra-zone and inter-zone.
{% include footer.md %}