Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring Security Zones and Policies for SRX Series

    This example shows how to set up a new zone and add three servers to that zone. Then you provide communication between a host (PC) in the trust zone to the servers in the newly created zone and also facilitate communication between two servers within the zone.

    To meet this requirement, you need an interzone security policy to allow traffic between two zones and an intrazone policy to allow traffic between servers within a zone.

    Requirements

    This example uses the following hardware and software components:

    • An SRX210
    • Junos OS Release 12.1X44-D10

    Overview

    This example uses the network topology shown in Figure 1.

    Figure 1: Topology for Security Policy Configuration

    Topology for Security Policy Configuration

    In this example, you perform the following tasks:

    • Move the ge-0/0/1.0 interface, which was part of trust zone, to the DMZ zone and assign IP address 192.168.2.1/24. Change ge-0/0/1 from family ethernet-switching (factory configuration setting) to family inet.
    • Assign IP address 192.168.1.2/24 to the host connected to the fe-0/0/2.0 interface in the trust zone.
    • Set up two HTTP servers (Server-HTTP-1 and Server-HTTP-2) and one SMTP server and assign IP addresses 192.168.2.2/24 ,192.168.2.3/24, and 192.168.2.4/24 respectively in the DMZ zone.
    • Configure an address book and create addresses for use in the policy as shown in Table 1.

      Table 1: Address Books Configuration

      Zones

      Address Book

      Server IP Address-

      DMZ

      Server-HTTP-1

      192.168.2.2/24

      Server-HTTP-2

      192.168.2.3/24

      Server-SMTP

      192.168.2.4/24

      Trust

      PC-Trust

      192.168.1.2/24

    • Create security policies as shown in Table 2.

      Table 2: Security Policy Configuration

      Policy Name

      From Zone

      To Zone

      Action

      permit-mail-trust-DMZ

      Trust

      DMZ

      Permit SMTP traffic

      permit-http-in-DMZ

      DMZ

      DMZ

      Permit HTTP traffic

    Configuration

    CLI Quick Configuration

    To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

    delete interfaces ge-0/0/1 unit 0 family ethernet-switchingset interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/24set security zones security-zone DMZ interfaces ge-0/0/1 host-inbound-traffic system-services allset security zones security-zone DMZ address-book address Server-HTTP-1 192.168.2.2/24 set security zones security-zone DMZ address-book address Server-HTTP-2 192.168.2.3/24 set security zones security-zone DMZ address-book address Server-SMTP 192.168.2.4/24 set security zones security-zone DMZ address-book address-set DMZ-address-set-http address Server-HTTP-1set security zones security-zone DMZ address-book address-set DMZ-address-set-http address Server-HTTP-2set security zones security-zone trust address-book address PC-Trust 192.168.1.2/32set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match source-address PC-Trustset security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match destination-address Server-SMTPset security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match application junos-smtp set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ then permitset security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match source-address DMZ-address-set-httpset security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match destination-address DMZ-address-set-httpset security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match application junos-httpset security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ then permit

    .

    To configure security zones and policies:

    1. Delete the interface ge-0/0/1 from family ethernet-switching (factory configuration) and assign an IP address.

      [edit]user@srx210-host# delete interfaces ge-0/0/1 unit 0 family ethernet-switchinguser@srx210-host# set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/24
    2. Configure a new security zone (DMZ) and assign interfaces.
      [edit]user@srx210-host# set security zones security-zone DMZ interfaces ge-0/0/1 host-inbound-traffic system-services all
    3. Create address books in the DMZ zone.
      [edit]user@srx210-host# set security zones security-zone DMZ address-book address Server-HTTP-1 192.168.2.2/32 user@srx210-host# set security zones security-zone DMZ address-book address Server-HTTP-2 192.168.2.3/32 user@srx210-host# set security zones security-zone DMZ address-book address Server-SMTP 192.168.2.4/32
    4. Create address sets in the DMZ zone to group HTTP server addresses together.
      [edit]user@srx210-host# set security zones security-zone DMZ address-book address-set DMZ-address-set-http address Server-HTTP-1user@srx210-host# set security zones security-zone DMZ address-book address-set DMZ-address-set-http address Server-HTTP-2
    5. Create address books in the trust zone.
      [edit]user@srx210-host# set security zones security-zone trust address-book address PC-Trust 192.168.1.2/32
    6. Create an interzone policy to permit SMTP traffic from the trust zone to the DMZ zone.
      [edit]user@srx210-host# set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match source-address PC-Trustuser@srx210-host# set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match destination-address Server-SMTPuser@srx210-host# set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ match application junos-smtp user@srx210-host# set security policies from-zone trust to-zone DMZ policy permit-mail-trust-DMZ then permit
    7. Create an intrazone policy to permit HTTP traffic between the two servers in the DMZ zone.
      [edit]user@srx210-host# set security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match source-address DMZ-address-set-httpuser@srx210-host# set security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match destination-address DMZ-address-set-httpuser@srx210-host# set security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ match application junos-httpuser@srx210-host# set security policies from-zone DMZ to-zone DMZ policy permit-http-in-DMZ then permit

    Results

    From configuration mode, confirm your configuration by entering the show security zones and show security policies commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

    [edit]user@srx210-host# show security zones security-zone DMZ
    address-book {address Server-HTTP-1 192.168.2.2/24;address Server-HTTP-2 192.168.2.3/24;address Server-SMTP 192.168.2.4/24;address-set DMZ-address-set-http {address Server-HTTP-1;address Server-HTTP-2;}}interfaces {ge-0/0/1.0 {host-inbound-traffic {system-services {all;}}}}
    [edit]user@srx210-host# show security policies from-zone trust to-zone DMZ
    policy permit-mail-trust-DMZ {match {source-address PC-Trust;destination-address Server-SMTP;application junos-smtp;}then {permit;}}
    [edit]user@srx210-host# show security policies from-zone DMZ to-zone DMZ
    policy permit-http-in-DMZ {match {source-address DMZ-address-set-http;destination-address DMZ-address-set-http;application junos-http;}then {permit;}}

    If you are done configuring the device, enter commit from configuration mode.

    Verification

    Verifying Policy Configuration

    Purpose

    Verify information about security policies.

    Action

    You can pass traffic between servers in different zones and verify the traffic data by using the show security flow session command from operational mode.

    For samples of the show security flow session command output, see show security flow session.

    Modified: 2016-05-23