Do Migrateasatosrx
Do Migrateasatosrx
It’s rather obvious to those in IT that hardware gets old. Many platforms, such as the
Cisco ASA firewall, have finite life spans, so it’s time to migrate to the SRX Series and
start using its advanced security services. This Day One book walks you step-by-step
through a best practice change process that will ease, and actually simplify, a migration
from ASA to SRX.
Day One: Migrate Cisco ASA to Juniper SRX Series documents a detailed migration plan
that will help you familiarize yourself with the Junos OS and the SRX Series. This book
also includes dozens of configuration detail comparisons that will make any cutover, in
the lab or in production, successful.
Relax, kick back, and learn about how to create a successful ASA to SRX migration path
that can be used repeatedly in your network or the networks of your clients.
“This book is an excellent foundation for migrating from Cisco ASA to Juniper SRX for your
organization’s next-generation security platform.”
Clay Haynes, JNCIE-SEC #69
“Quintessential reading for the engineer migrating from ASA to SRX. Full of best practices
and tips as you upgrade your security.”
Nick Ryce, Senior Network Architect, Fluency, JNCIE-ENT #232
IT’S DAY ONE AND YOU HAVE A JOB TO DO, SO LEARN HOW TO:
n Replace aging ASA devices with the SRX Series.
n Understand the differences between ASA named interfaces and Junos OS zones.
n Move from the ASA policy-based VPN towards the SRX Series route-based VPN.
ISBN 978-1-941441-41-1
51600
9 781941 441411
Day One: Migrate Cisco ASA to
Juniper SRX Series
Chapter 3: NAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
© 2016 by Juniper Networks, Inc. All rights reserved. About the Authors
Juniper Networks and Junos are registered trademarks of Martin Brown is a Network Security Engineer for a tier 1
Juniper Networks, Inc. in the United States and other service provider based in the UK, and a Juniper
countries. The Juniper Networks Logo and the Junos Ambassador with knowledge that covers a broad range
logo, are trademarks of Juniper Networks, Inc. All other of network devices. Martin started his career in IT 20
trademarks, service marks, registered trademarks, or years ago supporting Macintosh computers, became an
registered service marks are the property of their MCSE in 1999, and has since progressed to networking,
respective owners. Juniper Networks assumes no supporting most of the major manufacturers including
responsibility for any inaccuracies in this document. Cisco, F5, Checkpoint, and of most importance, Juniper.
Juniper Networks reserves the right to change, modify,
transfer, or otherwise revise this publication without Rob Jeffery is the Technical Director at a specialist IT
notice. Security VAR & MSSP based in the UK, and has being a
Juniper Networks Ambassador since 2013. After
Published by Juniper Networks Books spending 8 years working within the hospitality industry,
Authors: Martin Brown and Rob Jeffery Rob retrained and quickly rose through the ranks. With a
Technical Reviewers: Clay Haynes, Nick Ryce, vast range of troubleshooting and deployment experience
Chris Jones across Check Point, Fortinet, Cisco, Logrhythm, F5 and
Editor in Chief: Patrick Ames of course, Juniper.
Copyeditor and Proofer: Nancy Koerbel
Community Marketing Manager: Julie Wider Authors Acknowledgments
Martin Brown: I would like offer my thanks to my
ISBN: 978-1-941441-41-1 (paperback) former manager, David Hunnam, who was a great
Printed in the USA by Vervante Corporation. mentor and who offered me a fantastic opportunity to
grow and better myself. Without his support I would not
ISBN: 978-1-941441-42-8 (ebook) be where I am today and as such, I would like to dedicate
this book to his memory.
Version History: v1, September 2016
2 3 4 5 6 7 8 9 10 Rob Jeffrey: I would like to thank my co-author, Martin,
for constantly pestering me to get my parts of the book
http://www.juniper.net/dayone finished, my fellow Ambassadors for taking the time to
provide a technical review, and most importantly, I
would like to thank Julie Wider; without her the Juniper
Networks Ambassador program would not exist and I
would not have had the opportunity to co-author this
book.
v
Get the ebook edition for iPhones and iPads from the iTunes Store.
Search for Juniper Networks Books.
Get the ebook edition for any device that runs the Kindle app
(Android, Kindle, iPad, PC, or Mac) by opening your device’s
Kindle app and going to the Kindle Store. Search for Juniper
Networks Books.
Purchase the paper edition at either Vervante Corporation (www.
vervante.com) for between $12-$28, depending on page length.
Note that most ebook devices can also view PDF files.
Information Experience
This Day One book is singularly focused on one aspect of networking
technology that you might be able to do in one day. There are other
sources at Juniper Networks, from white papers to webinars to online
forums such as J-Net (forums.juniper.net).
TIP It’s highly recommended that you peruse the available technical docu-
mentation in order to become fully acquainted with the initial configura-
tion process of Junos devices, and to get a better understanding of the
configuration process flow. The technical documentation can be located
at www.juniper.net/documentation.
vii
Preface
These days almost every company, organization, and entity has some
sort of connection to the global Internet. It is almost impossible to
exist without it. And you can make a pretty accurate assumption that
any company connected to the Internet will have a firewall in order to
protect its network and the data it carries.
But firewalls do get old and it should be pretty obvious to those in IT
that while the operating systems and software can be updated, their
platforms have a finite life span and will need to be replaced. Such is
the case with the many Cisco ASA firewalls. At some point you will
replace the ASAs, and when you do we suggest migrating to the
Juniper Networks SRX Series Services Gateways. This book will help
you to make the transition with a step-by-step, best practice approach,
because we, like you, know that such hardware migrations can be a
complex and drawn out process.
There are many things you need to consider in such a migration. How
easy will it be to replace the hardware? What about the speed and
capacity of the hardware? For example, if you are replacing a firewall
that allows 100,000 concurrent connections over 1Gb links, it would
be unwise to replace it with a smaller 100Mb firewall capable of only
50,000 concurrent connections, regardless of the price.
In the hypothetical test case created for this book, an organization
called Acme is replacing their older ASAs, running version 9.2.4 of the
ASA software, with a new next-generation firewall, the SRX Series.
Acme is preparing for the future, upgrading the perimeter for more
cloud-delivered services, and essentially strengthening their security
posture.
Acme chose the new SRX Series because its throughput is higher than
the ASA, and it is available at a more favorable price. In addition,
Acme has several QFX and EX switches in the core and access layers,
so the engineers who will be deploying the new firewall already speak
Junos, and those who don’t can use this book to help them learn how.
Figure P.1 illustrates Acme’s network topology. The existing ASA
connects to a router, which in turn connects to the Internet. The router
is a customer edge (CE) router managed by Acme’s service provider,
and as such does not utilize a firewall.
ix
NOTE While Acme has an inside firewall, it is neither an SRX Series nor an
ASA, as best practice dictates that when ‘dual skinning’ an Internet
edge, the inside and outside firewalls should be from different vendors,
therefore this firewall will not be touched during the migration to the
new SRX Series.
In the core of the network are several servers that are used for manag-
ing network devices:
ACS/TACACS
Syslog
SNMP
NTP
NOTE The version of ASA software used in this book is 9.2.4. Note that
prior to version 8.3, the NAT statements were very different. The
version of Junos OS on the SRX Series is the JTAC recommended
version recommended while this book was being written, however,
most of the commands used in this book are version neutral,
applicable to almost any version of Junos.
name-server {
208.67.222.222;
208.67.220.220;
}
services {
ssh;
telnet;
xnm-clear-text;
web-management {
http {
interface vlan.0;
}
https {
system-generated-certificate;
interface vlan.0;
}
}
dhcp {
router {
192.168.1.1;
}
pool 192.168.1.0/24 {
address-range low 192.168.1.2 high 192.168.1.254;
}
propagate-settings ge-0/0/0.0;
}
}
syslog {
archive size 100k files 3;
user * {
any emergency;
}
file messages {
any critical;
authorization info;
}
file interactive-commands {
interactive-commands error;
}
}
max-configurations-on-flash 5;
max-configuration-rollbacks 5;
license {
autoupdate {
url https://ae1.juniper.net/junos/key_retrieval;
}
}
## Warning: missing mandatory statement(s): ‘root-authentication’
}
interfaces {
ge-0/0/0 {
unit 0;
}
ge-0/0/1 {
unit 0 {
family ethernet-switching {
vlan {
members vlan-trust;
}
14 Day One: Migrate Cisco ASA to Juniper SRX Series
<snip> #All remaining interfaces are part of the same VLAN as interface ge-0/0/1
vlan {
unit 0 {
family inet {
address 192.168.1.1/24;
}
}
}
}
protocols {
stp;
}
security {
screen {
ids-option untrust-screen {
icmp {
ping-death;
}
ip {
source-route-option;
tear-drop;
}
tcp {
syn-flood {
alarm-threshold 1024;
attack-threshold 200;
source-threshold 1024;
destination-threshold 2048;
timeout 20;
}
land;
}
}
}
nat {
source {
rule-set trust-to-untrust {
from zone trust;
to zone untrust;
rule source-nat-rule {
match {
source-address 0.0.0.0/0;
}
then {
source-nat {
interface;
}
}
}
}
}
}
policies {
from-zone trust to-zone untrust {
policy trust-to-untrust {
match {
source-address any;
Chapter 1: Nameifs and Zones 15
destination-address any;
application any;
}
then {
permit;
}
}
}
}
zones {
security-zone trust {
host-inbound-traffic {
system-services {
all;
}
protocols {
all;
}
}
interfaces {
vlan.0;
}
}
security-zone untrust {
screen untrust-screen;
interfaces {
ge-0/0/0.0 {
host-inbound-traffic {
system-services {
dhcp;
tftp;
}
}
}
}
}
}
}
vlans {
vlan-trust {
vlan-id 3;
l3-interface vlan.0;
}
}
Zones and policies are discussed in more detail in Chapter 2, and the
VLAN vlan-trust will be deleted later in this chapter, but for now, let’s
delete the Dynamic Host Configuration Protocol (DHCP) server
configuration and remove the DNS servers. This is done by entering
the following commands:
delete system name-server
delete system services dhcp
16 Day One: Migrate Cisco ASA to Juniper SRX Series
TIP If, after entering these commands, an error appears stating that the
command isn’t recognized, chances are the user is in the default “shell”
mode. This is typical when a user logs in as the default “root” user. To
enter exec mode, use the cli command. To enter configuration mode,
use the configure command.
Once the DNS and DHCP information has been loaded use the
following command:
delete security nat
NOTE New NAT statements that are more relevant to our situation will be
discussed and configured in Chapter 3.
To set the same option on the SRX Series, use the following:
set system host-name Acme-INTERNET-FW
set system domain-name acme.com
It may seem trivial to set the host name, but the SRX Series uses the
hostname in the prompt, so engineers can know quite easily which
SRX Series device they are connected to, and which one they are
adding a configuration to. This might seem redundant if you’re in the
lab and the SRX Series is right next to your laptop, but it’s very useful
if you are configuring the SRX Series via a terminal server. Including
the hostname in the prompt provides a simple sanity check that can
prevent you from configuring the wrong device and a lot of embarrass-
ment.
Specifying IP Addresses
Now that the basic configuration steps have been performed and the
unwanted default configuration has been removed, let’s turn our
attention to configuring the IP address. Figure 1.1 depicts the Layer 3
topology with the subnets currently connected to the ASA, and which
will be connected soon to the SRX Series.
Chapter 1: Nameifs and Zones 17
You can see that the ASA currently has three interfaces configured, and
the interface configuration on the ASA reveals the following informa-
tion:
interface Gi0/0
nameif INTERNET
security-level 0
ip address 203.0.113.10 255.255.255.0
interface Gi0/1
nameif DMZ
security-level 50
ip address 172.23.7.1 255.255.255.0
interface Gi0/2
nameif INSIDE
security-level 100
ip address 10.100.1.1 255.255.255.0
The SRX Series to be configured in this scenario will use the same
interfaces: ge-0/0/0, ge-0/0/1, and ge-0/0/2. The addresses assigned to
these interfaces will also remain the same. The difference, however, is
that the ASA uses named interfaces or nameifs. The SRX Series doesn’t
have any concept of named interfaces and instead uses zones.
The ASA also has the option mtu <interface-name> 1500 configured,
therefore care should be taken to include this information on the SRX
Series.
18 Day One: Migrate Cisco ASA to Juniper SRX Series
One major difference between ASA and SRX Series interfaces is that
almost all Junos devices require the IP addresses or Ethernet switching
information to be added to the sub-interfaces, regardless of whether or
not only one sub-interface is in use. The default sub-interface is called
unit 0 and it is reflected in the following configuration, which sets the
maxium transmission unit (MTU) size followed by the IP address:
NOTE Until a rule is applied to the named interface, the ASA has the
option to use security levels, with traffic coming from a higher level
interface being able to access devices on a lower level interface, but
dropping traffic going from a lower level interface to a higher level
interface. The SRX Series does not use security levels and as a
result, rules always need to be applied.
While you could just delete the zones and then create new zones, it
actually requires fewer steps to rename the existing zones and then
create our third zone thereafter. To rename a zone, an administra-
tor simply needs to use the rename command; in this instance,
rename the zone trust to the zone name INSIDE:
And the default VLAN can be removed from the zone like this:
TIP Note that INSIDE is in all upper case letters. This is a common best
practice within the industry because uppercase stands out more
when reading a device configuration, and any engineer looking at
the configuration will know that uppercase is a label, whereas any
lowercase will be a command or an option.
You may also notice that this is in contrast to the zone names that
are applied by default to the SRX Series, as these are entered in
lower case. This is another reason why the default labels need to be
changed, so that they become uppercase.
Next, rename the zone untrust to INTERNET using the commands
similar to those you used when the zone “trust” was renamed:
To create the zone “DMZ” and assign interface ge-0/0/1.0 to the zone,
run the following:
DoS Protection
When an SRX Series is booted to factory defaults, the Junos OS creates
a rather useful piece of configuration called a screen. This screen will
attempt to protect the SRX Series from DoS attacks such as the “Ping
of Death” and “Syn-Flood” attacks. The default screen settings look
like this:
rename security policies from-zone trust to-zone untrust to from-zone INSIDE to-zone
INTERNET
The policy itself will be removed, and a more relevant policy will be
added in the next chapter.
If your SRX Series has created a default VLAN, then now would be a
good time to remove the Layer 3 interface that is associated with it.
Later on, if your organization’s security policy dictates, you can create
an unused VLAN, assign all unused ports to this unused VLAN, and
completely remove the default VLAN. For now, however, only the
Layer 3 interface will be removed:
Even though the Layer 3 interface has been removed, the default
VLAN will still reference this interface under the VLAN configuration,
therefore it should be removed as well, otherwise the commit will fail:
After you’ve set the password for the root user, Junos will prompt you
to enter the password and then ask you to confirm the password:
[edit]
root# set system root-authentication plain-text-password
New password:
Retype new password:
It is of the utmost importance that the password used is a complex
password, which only a few administrators know, because root user is
allowed full access to the entire system, including the underlying
operating system.
TIP It’s best practice to create a second user immediately, and to use that
second user to administer your device. Never use the root user unless it
is absolutely necessary.
[edit]
root# commit
commit complete
Chapter 1: Nameifs and Zones 23
[edit]
root@Acme-INTERNET-FW#
Note how the prompt has changed from root# to root@Acme-INTERNET-
FW#, displaying the host name of the device.
Next, the routing table should be checked for the presence of the static
route, ensuring it points to the correct next hop:
Finally, let’s perform a simple ping test to ensure the SRX Series can
reach the next hop. The issue is, the current firewall is live and you
cannot have the SRX Series on the same subnet as the ASA or you will
suffer from an IP address conflict. You could, of course, use another
address, but if your ISP will not issue another public IP address for test
purposes, then this will not be an option. So, in this case, the SRX
Series has been connected to a lab environment in order to perform
limited testing prior to migrating onto the live network:
root@Acme-INTERNET-FW> ping 203.0.113.1
PING 203.0.113.1 (203.0.113.1): 56 data bytes
64 bytes from 203.0.113.1: icmp_seq=0 ttl=255 time=3.426 ms
64 bytes from 203.0.113.1: icmp_seq=1 ttl=255 time=3.221 ms
24 Day One: Migrate Cisco ASA to Juniper SRX Series
As you can see, the ping test has been successful, so let’s move on to the
next phase of the migration: creating the firewall rules.
Chapter 2
Now that the interfaces have been given IP addresses, the SRX
Series is pretty much behaving like a router you might have at
home. All traffic is being allowed out but nothing is being allowed
back in. To correct this, policies need to be added that mirror
those currently configured on the ASA.
But before examining the existing policies, let’s first look at what
the policies are trying to achieve.
In order to restrict traffic flows, Access Control Lists (ACLs) have been
applied to all three interfaces. ACLs are made up of multiple entries
called Access Control Entries (ACEs). In order to make administration
easier, the ACLs have been given the same name as the interface to
which they are attached, for example the ACL applied to the INTER-
NET interface has the name INTERNET_ACL. Figure 2.2 shows the
five VLANs that are reachable via the Inside interface.
Included are four VLANs for various departments within the company,
and the Management VLAN for managing network devices and
servers.
The second interface is connected to the DMZ. In the DMZ are three
hosts – a web server, an email server, and a proxy server – as shown in
Figure 2.3.
All hosts on the INSIDE interface need to be able to access all of these
servers, but only on the applicable ports; for example, the web server
would only expect HTTP, HTTPS, and FTP traffic.
At Acme, the hosts on the inside are only allowed to access the Internet
via the proxy server, with the exception of the Management VLAN. It
seems the network engineers have convinced their manager to allow
unrestricted access to the Internet directly from this VLAN without
Chapter 2: ACEs, ACLs, and Firewall Filters 27
going through the proxy. The reason for this is that if the proxy server
went down they could still download patches and use the Internet to
search for fixes. (This happens a lot.) Anyway, Figure 2.4 depicts the
VLAN setup.
You can see in Figure 2.4 that the interface connected to the Internet
must allow for traffic coming from the branch office. This traffic
should be coming via a VPN tunnel, but nonetheless, it has to be
allowed in. Figure 2.4 shows the branch and the subnet in use. The
policy must also allow Internet users to access the corporate web server
and email servers to connect to the corporate email server.
28 Day One: Migrate Cisco ASA to Juniper SRX Series
Next are the objects that refer to the servers in the DMZ, the email
server, the web server, and the proxy server:
object network E-MAIL_SERVER
host 172.23.7.8
And the last object refers to the VLAN in use in the branch office:
object network MK-BRANCH
subnet 10.200.0.0 255.255.240.0
To create the same entry under the zone SERVERS, the command
would be as follows:
set security zones security-zone SERVERS address-book address DB-SERVER 192.168.1.3/32
Chapter 2: ACEs, ACLs, and Firewall Filters 29
TIP Note that the prefix of /32 is at the end of the command. This denotes
that the entry is a host entry. If the entry was for a whole subnet, then
the keyword wildcard-address would be used along with a different
prefix such as /24. Alternatively, an address range from a start IP
address to an end IP address can also be specified.
The question you are undoubtedly asking is: what is the advantage of
using a global address book entry as opposed to a zone-based entry?
The answer is quite simple. If an entry is added to the global address
book, then this entry is available to any policy created later on.
Zone-based entries are only available under that policy. The other
reason to use global entries is because address book entries under
zones cannot be used in NAT commands, whereas global entries are
allowed.
NAT statements are used in Chapter 3, so it would be better to specify
global address book entries. Creating the address book entries for the
servers, the management VLAN, and the branch VLAN is relatively
straightforward. To create these address book entries to match the
ASA objects and groups, use the following commands:
set security address-book global address PROXY-SERVER 172.23.7.10/32
set security address-book global address WEB-SERVER 172.23.7.11/32
set security address-book global address E-MAIL-SERVER 172.23.7.8/32
Creating the address book entry for the corporate VLANs is slightly
different as, on the ASA, the object group could be created and the
individual subnets could be added as required. Unfortunately, address
book entries only allow a single host or subnet. So thankfully there is a
simple solution – create a separate VLAN address book, like this:
set security address-book global address FINANCE-VLAN wildcard-address 10.100.1.0/22
set security address-book global address SALES-VLAN wildcard-address 10.100.4.0/22
set security address-book global address MARKETING-VLAN wildcard-address 10.100.7.0/22
set security address-book global address RandD-VLAN wildcard-address 10.100.10.0/22
ACLs have an implicit deny at the end – when there are no entry
matches the traffic is automatically denied. This traffic is not auto-
matically logged, however, so at the end of the ACLs you may notice
deny ip any any log, which tells the ASA to log any access attempts that
were denied.
The access list associated with the DMZ interface needs to allow the
proxy server access to the Internet because it is furnishing Internet
access requests on behalf of the clients on the INSIDE. The three
servers in the DMZ also need to access servers in the Management
VLAN for the purposes of time synchronization, sending syslog
messages, and sending SNMP traps, therefore the ACL DMZ_acl is
configured as follows:
access-list DMZ_acl extended permit tcp object E-MAIL_SERVER any4 eq smtp
access-list DMZ_acl extended permit tcp object PROXY-SERVER any4 eq http
access-list DMZ_acl extended permit tcp object PROXY-SERVER any4 eq https
access-list DMZ_acl extended permit tcp object PROXY-SERVER any4 eq ftp
access-list DMZ_acl extended permit tcp object PROXY-SERVER object MANAGEMENT-NETWORK eq snmp
access-list DMZ_acl extended permit tcp object E-MAIL_SERVER object MANAGEMENT-NETWORK eq snmp
access-list DMZ_acl extended permit tcp object WEB-SERVER object MANAGEMENT-NETWORK eq snmp
access-list DMZ_acl extended permit udp object PROXY-SERVER object MANAGEMENT-NETWORK eq ntp
access-list DMZ_acl extended permit udp object E-MAIL_SERVER object MANAGEMENT-NETWORK eq ntp
access-list DMZ_acl extended permit udp object WEB-SERVER object MANAGEMENT-NETWORK eq ntp
access-list DMZ_acl extended permit udp object PROXY-SERVER object MANAGEMENT-NETWORK eq syslog
access-list DMZ_acl extended permit udp object E-MAIL_SERVER object MANAGEMENT-NETWORK eq syslog
access-list DMZ_acl extended permit udp object WEB-SERVER object MANAGEMENT-NETWORK eq syslog
The ASA is told to apply ACLs to the named interfaces using the
following commands:
access-group INTERNET_acl in interface INTERNET
access-group DMZ_acl in interface DMZ
access-group INSIDE_acl in interface INSIDE
application any;
}
then {
permit;
}
}
There are now no policies configured in the SRX Series, and all in all,
six separate policies need to be created. Let’s begin by creating the first
policy for traffic going from the zone INSIDE to the zone DMZ.
TIP Bear in mind that the ACLs on the ASA would be for all traffic,
whereas with the SRX Series, only traffic going between those zones
need be specified.
The first policy should allow HTTP, HTTPS, and FTP traffic going
from the corporate VLANs to the proxy and web servers, then allow
SMTP traffic from the corporate VLANs to the email server, and finally
allow the management VLAN to be able to access any address:
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match source-address CORP-VLAN
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match destination-address PROXY-
SERVER
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match destination-address WEB-
SERVER
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match application junos-http
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match application junos-https
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY match application junos-ftp
set security policies from-zone INSIDE to-zone DMZ policy WEB-AND-PROXY then permit
set security policies from-zone INSIDE to-zone DMZ policy E-MAIL match source-address CORP-VLAN
set security policies from-zone INSIDE to-zone DMZ policy E-MAIL match destination-address E-MAIL-SERVER
set security policies from-zone INSIDE to-zone DMZ policy E-MAIL match application junos-smtp
set security policies from-zone INSIDE to-zone DMZ policy E-MAIL then permit
set security policies from-zone INSIDE to-zone DMZ policy MANAGEMENT match source-address MANAGEMENT-
NETWORK
set security policies from-zone INSIDE to-zone DMZ policy MANAGEMENT match destination-address any-ipv4
set security policies from-zone INSIDE to-zone DMZ policy MANAGEMENT match application any
set security policies from-zone INSIDE to-zone DMZ policy MANAGEMENT then permit
Notice that the web server and proxy server are grouped together
under the same policy term. It is perfectly acceptable to group multiple
destinations together under one policy term – Junos treats these as OR
as opposed to AND. The application sets the port and again, these can
be grouped together under the same policy term and would be treated
as an OR statement.
The next policy should allow traffic from the Management VLAN to
Chapter 2: ACEs, ACLs, and Firewall Filters 33
set security policies from-zone INSIDE to-zone INTERNET policy DENY match source-address any-ipv4
set security policies from-zone INSIDE to-zone INTERNET policy DENY match destination-address any-ipv4
set security policies from-zone INSIDE to-zone INTERNET policy DENY match application any
set security policies from-zone INSIDE to-zone INTERNET policy DENY then deny
set security policies from-zone INSIDE to-zone INTERNET policy DENY then log session-init
The third policy that needs to be created allows traffic from the servers
in the DMZ access to the Management VLAN:
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match source-address E-MAIL-
SERVER
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match source-address WEB-SERVER
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match source-address PROXY-
SERVER
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match destination-address
MANAGEMENT-NETWORK
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match application junos-ntp
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match application junos-syslog
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT match application junos-snmp-
agentx
set security policies from-zone DMZ to-zone INSIDE policy ALLOW-MANAGEMENT then permit
The fourth policy allows the email server and proxy server access to
relevant services on the Internet. The email server will only be allowed
to access SMTP, whereas the proxy server can access HTTP, HTTPS,
and FTP:
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-E-MAIL match source-address E-MAIL-
SERVER
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-E-MAIL match destination-address
any-ipv4
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-E-MAIL match application junos-smtp
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-E-MAIL then permit
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY match source-address PROXY-SERVER
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY match destination-address any-ipv4
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY match application junos-http
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY match application junos-https
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY match application junos-ftp
set security policies from-zone DMZ to-zone INTERNET policy ALLOW-PROXY then permit
The fifth policy must allow Internet users access to the corporate web
server via FTP, HTTP, and HTTPS, and access to the email server using
SMTP. It is important to note that the branch office users will also
need to access these servers. As the source address is set to any-ipv4,
however, they will automatically be allowed access. But a rule allow-
ing access to the proxy server should still be included:
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER match source-address any-ipv4
34 Day One: Migrate Cisco ASA to Juniper SRX Series
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER match destination-address WEB-
SERVER
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER match application junos-http
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER match application junos-https
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER match application junos-ftp
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER then permit
set security policies from-zone INTERNET to-zone DMZ policy E-MAIL-SERVER match source-address any-ipv4
set security policies from-zone INTERNET to-zone DMZ policy E-MAIL-SERVER match destination-address
E-MAIL-SERVER
set security policies from-zone INTERNET to-zone DMZ policy E-MAIL-SERVER match application junos-smtp
set security policies from-zone INTERNET to-zone DMZ policy E-MAIL-SERVER then permit
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY match source-address MK-BRANCH
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY match destination-address
PROXY-SERVER
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY match application junos-http
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY match application junos-https
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY match application junos-ftp
set security policies from-zone INTERNET to-zone DMZ policy BRANCH-TO-PROXY then permit
The sixth and final policy is to allow access from the branch office into
the corporate network:
set security policies from-zone INTERNET to-zone INSIDE policy BRANCH-OFFICE match source-address MK-
BRANCH
set security policies from-zone INTERNET to-zone INSIDE policy BRANCH-OFFICE match destination-address
CORP-VLAN
set security policies from-zone INTERNET to-zone INSIDE policy BRANCH-OFFICE match application any
set security policies from-zone INTERNET to-zone INSIDE policy BRANCH-OFFICE then permit
set security policies from-zone INTERNET to-zone INSIDE policy DENY match source-address any
set security policies from-zone INTERNET to-zone INSIDE policy DENY match destination-address any
set security policies from-zone INTERNET to-zone INSIDE policy DENY match application any
set security policies from-zone INTERNET to-zone INSIDE policy DENY then deny
set security policies from-zone INTERNET to-zone INSIDE policy DENY then log session-init
NAT
If the new SRX Series firewall were to be made live right now, you
would have full reachability inside your own network. Users would
be able to access the email server, web server, and even the proxy
server, but that’s as far as it would go. There would be no reachabil-
ity to the global interconnected networks, and users wouldn’t be able
to access websites or to send or receive external email.
As you should have already figured out, the simple reason there is no
connectivity outside the corporate network is because the servers and
the clients are all using IP addresses from the RFC1918 address
space.
TIP If Acme wanted to, it could configure servers in the DMZ with public
IP addresses, but that would be a security risk, as attackers would
know one of the address ranges in use inside the network. Apart
from saving IPv4 addresses, NAT can help to obfuscate the addresses
in use inside your LAN.
The final server is a proxy server. This allows clients inside the net-
work to access the Internet and as such it must accept requests from
HTTP, HTTPS, and FTP, and pass on these requests to outside the
network. As the traffic from the proxy server leaves the ASA, it must
be translated to an outside address. Return traffic will be directed at
the public IP address of the proxy server, which will then be translated
back to the private IP address. Figure 3.1 shows the three servers in the
DMZ and how each of these would NAT to the external addresses.
You can see in Figure 3.1 that the web server has been given the IP
address of 172.23.7.8 and this translates to the public address
192.0.2.8. The email server has been allocated the IP address
172.23.7.11, which is mapped to the public address of 192.0.2.11, and
finally the proxy server has the address of 172.23.7.11, which the ASA
translates to 192.0.2.11 as the traffic goes out to the Internet.
The first seven NATs covered in this chapter are related to public access
to the FTP, web and secure web server, and the mail server in order to
allow the proxy server access to web servers, secure web servers, and
FTP servers on the Internet. The next NAT is slightly different because
having a proxy server in the LAN suggests that the proxy server will
furnish Internet access requests on behalf of clients, but it provides
restricted access and controls so that employees cannot just download
copyrighted information or material that isn’t safe for work. The type
of NAT in use here is a one-to-one static NAT.
The Management VLAN doesn’t access the Internet via the proxy, but
instead has direct access for reasons that were discussed in Chapter 2.
With the previous NATs, a single external IP address was mapped to a
single internal IP address. The Management VLAN, however, is a /24
subnet, meaning that there are potentially 253 hosts that require 253
external NAT addresses. It is unlikely that the IT director would ever
sign off on such a cost, therefore, in this case, the NAT would be a
NAT overload where the entire subnet is set to NAT to a single outside
address. Figure 3.2 provides a graphical representation of what the
final NAT achieves.
38 Day One: Migrate Cisco ASA to Juniper SRX Series
If you recall from Chapter 2, you needed to state the from zone and to
zone. In NAT configurations, zones are still referenced, but where the
firewall policy might say something like:
set security policies from-zone INTERNET to-zone DMZ policy WEB-SERVER
In a static NAT statement, the rule set only states a from zone, rather
like:
set security nat static <rule-name> from zone <zone-name>
Source and destination NATs require entry of the from and to zones,
which segues to the next point – Junos allows for multiple types of
NAT, and each has a different application. Table 3.1 helpfully lists
these different types of NATs and their typical uses.
Chapter 3: NAT 39
Destination NAT Destination NATs translate the destination address to a pool of addresses; for
example, a client on the Internet accessing a web server inside your LAN. The
request will be forwarded to one of several web servers, which will see the real
source address, but the Internet client will never know the real IP address of the
server to which its traffic was directed.
Double NAT Double NATs are not used too often, as they translate both the source and
destination addresses. They could be used where two companies merge and
have overlapping address spaces, or where a client in one organization is trying
to access servers in another.
Static NAT Static NATs are for one-to-one mapping where the inside address is fixed
directly to an outside address. Typically this would be where an outside client
is accessing an inside resource such as an FTP server. Again, the client will
never know the real address of the server.
Acme’s Junos solution will use two NATs: the source and the static.
The web server, including the secure web server and FTP server, and
the mail server traffic, will be set to use static NATs. This is because
static NATs translate on the destination only, therefore these rules will
be set as coming from the zone INTERNET. The match statements will
reference the destination port in addition to the destination address
and the then statement will tell the SRX Series which real IP address it
will map to on the inside. First the rule set will be named FROM-INTER-
NET, then the from zone is set as INTERNET:
To create the static NAT statements for only these servers, the follow-
ing commands will be used. The first rule named WEB-SERVER will be for
unencrypted web server traffic:
set security nat static rule-set FROM-INTERNET rule WEB-SERVER match destination-address 192.0.2.11/32
set security nat static rule-set FROM-INTERNET rule WEB-SERVER match destination-port 80
set security nat static rule-set FROM-INTERNET rule WEB-SERVER then static-nat prefix 172.23.7.11/32
set security nat static rule-set FROM-INTERNET rule WEB-SERVER then static-nat prefix mapped-port 80
The next rule sets a NAT for web server traffic on port 443. This rule
is named SECURE-WEB-SERVER.
TIP If you keep the description relevant to what the rule is doing, it will
help when it comes to troubleshooting:
40 Day One: Migrate Cisco ASA to Juniper SRX Series
set security nat static rule-set FROM-INTERNET rule SECURE-WEB-SERVER match destination-address
192.0.2.11/32
set security nat static rule-set FROM-INTERNET rule SECURE-WEB-SERVER match destination-port 443
set security nat static rule-set FROM-INTERNET rule SECURE-WEB-SERVER then static-nat prefix 172.23.7.11/32
set security nat static rule-set FROM-INTERNET rule SECURE-WEB-SERVER then static-nat prefix mapped-port
443
Rule FTP-SERVER translates traffic destined for the FTP server, but to the
same IP address as used for WEB-SERVER and SECURE-WEB-SERVER:
set security nat static rule-set FROM-INTERNET rule FTP-SERVER match destination-address 192.0.2.11/32
set security nat static rule-set FROM-INTERNET rule FTP-SERVER match destination-port 21
set security nat static rule-set FROM-INTERNET rule FTP-SERVER then static-nat prefix 172.23.7.11/32
set security nat static rule-set FROM-INTERNET rule FTP-SERVER then static-nat prefix mapped-port 21
The final static rule is for allowing outside access to the inside address
of the mail server aptly named E-MAIL-SERVER:
set security nat static rule-set FROM-INTERNET rule E-MAIL-SERVER match destination-address 192.0.2.8/32
set security nat static rule-set FROM-INTERNET rule E-MAIL-SERVER match destination-port 25
set security nat static rule-set FROM-INTERNET rule E-MAIL-SERVER then static-nat prefix 172.23.7.8/32
set security nat static rule-set FROM-INTERNET rule E-MAIL-SERVER then static-nat prefix mapped-port 25
There are two rule sets created for the source NATs. The first rule set is
from the zone INSIDE to the zone INTERNET and as such will be given the
name FROM-INSIDE. The second rule set will be named FROM-DMZ and will
be from the zone DMZ to the zone INTERNET. Unlike static NATs, you do
need to mention the from zone and the to zone:
set security nat source rule-set FROM-INSIDE from zone INSIDE
set security nat source rule-set FROM-INSIDE to zone INTERNET
Once the pools have been created and the rule sets have specified the
from and to zones, the NAT source statements can be created. The first
is for the Management VLAN. In this statement, the destination has to
be set and as this is for any traffic, the address 0.0.0.0/0 is specified:
Chapter 3: NAT 41
set security nat source rule-set FROM-INSIDE rule MAN-NAT match source-address 10.255.1.0/24
set security nat source rule-set FROM-INSIDE rule MAN-NAT match destination-address 0.0.0.0/0
set security nat source rule-set FROM-INSIDE rule MAN-NAT then source-nat pool MAN-OUTSIDE
The next rule set tells the SRX Series to translate packets from the
proxy server address of 172.23.7.10 to the pool PROXY-SERVER, which
has the address 192.0.2.10. The difference here is that you do not
want the SRX Series to translate all packets, just those related to FTP,
HTTP, and HTTPS, so therefore three rules are created, one for each
port. The rule for HTTP traffic is created first:
set security nat source rule-set FROM-DMZ rule PROXY-SERVER-WEB match source-address 172.23.7.10/32
set security nat source rule-set FROM-DMZ rule PROXY-SERVER-WEB match destination-address 0.0.0.0/0
set security nat source rule-set FROM-DMZ rule PROXY-SERVER-WEB match destination-port 80
set security nat source rule-set FROM-DMZ rule PROXY-SERVER-WEB then source-nat pool PROXY-SERVER
So if this command was run for the rule E-MAIL-SERVER, there should be
evidence of the SRX Series attempting to translate the packet to the
inside address. Let’s check:
root@Acme-INTERNET-FW> show security nat static rule E-MAIL-SERVER
42 Day One: Migrate Cisco ASA to Juniper SRX Series
Static NAT rule: E-MAIL-SERVER Rule-set: FROM-INTERNET
Rule-Id : 4
Rule position : 4
From zone : INTERNET
Destination addresses : 192.0.2.8
Destination ports : 25 - 25
Host addresses : 172.23.7.8
Host ports : 25 - 25
Netmask : 32
Host routing-instance : N/A
Translation hits : 8
Successful sessions : 0
Number of sessions : 0
As you can see, there were eight attempts before the device timed out.
There were zero successful sessions because there was no device behind
the SRX Series (in the lab) to respond to the session request.
Testing the source NAT rules is a little trickier because, again, there are
no devices on the inside or outside yet. You can still check the configu-
ration by running the show security nat source summary command:
root@Acme-INTERNET-FW> show security nat source summary
Total port number usage for port translation pool: 64512
Maximum port number for port translation pool: 8388608
Total pools: 2
Pool Address Routing PAT Total
Name Range Instance Address
MAN-OUTSIDE 192.0.2.9-192.0.2.9 default yes 1
PROXY-SERVER 192.0.2.10-192.0.2.10 default no 1
Total rules: 4
Rule name Rule set From To Action
MAN-NAT FROM-INSIDE INSIDE INTERNET MAN-OUTSIDE
PROXY-SERVER-WEB FROM-DMZ DMZ INTERNET PROXY-SERVER
PROXY-SERVER-SECURE FROM-DMZ DMZ INTERNET PROXY-SERVER
PROXY-SERVER-FTP FROM-DMZ DMZ INTERNET PROXY-SERVER
You can see that the command lists the pools, the rule set, and the rule
name. The Action column lists the pool that NAT will use when it is
hit.
Now that the NATs have been added, users should be able to access the
Internet, send and receive emails, and upload files, and in return,
clients on the Internet should be able to access the corporate website,
send emails, and upload files, while the users in the Management
VLAN can do whatever they like. But aren’t we forgetting something?
What about the users in the branch office? They require a site-to-site
VPN connection from the branch office into the headquarters, and this
is exactly what the Chapter 4 covers.
Chapter 4
Site-to-Site VPN
ASA Configuration
The ASA configuration is not as hierarchical and structured as the SRX
Series configuration, so when translating the configuration, you need to
jump around a little through different sections of the configuration.
Below is the full configuration as it would appear on the ASA.
TIP In the following configuration steps the relevant ASA commands are
shown with the corresponding SRX Series commands:
access-list SITE-TO-SITE-VPN_acl extended permit ip 10.0.0.0 255.0.0.0 10.200.0.0
255.255.240.0
access-list SITE-TO-SITE-VPN_acl extended permit ip 172.23.7.0 255.255.255.0 10.200.0.0
255.255.240.0
The following commands define the IKE proposal and this is where
you define the authentication method that will be referenced in the IKE
policy. In terms of the ASA configuration, the following relates directly
to the crypto ike policy:
set security ike proposal Acme-IKE-PROP authentication-method pre-shared-keys
set security ike proposal Acme-IKE-PROP dh-group group5
set security ike proposal Acme-IKE-PROP authentication-algorithm sha1
set security ike proposal Acme-IKE-PROP encryption-algorithm aes-128-cbc
Next you define the IKE policy, within the policy in which you defined
the previously configured IKE proposal. While you are only using one
proposal in this configuration, multiple proposals can be referenced:
46 Day One: Migrate Cisco ASA to Juniper SRX Series
SRX
set security ike policy Acme-IKE-POLICY mode main
set security ike policy Acme-IKE-POLICY proposals Acme-IKE-PROP
set security ike policy Acme-IKE-POLICY pre-shared-key ascii-text
SRX
set security ike gateway Acme-IKE-GW ike-policy Acme-IKE-POLICY
set security ike gateway Acme-IKE-GW address 198.51.100.12
set security ike gateway Acme-IKE-GW external-interface ge-0/0/0.0
ASA
crypto ipsec ikev1 transform-set AcmeVPN-TSET esp-aes esp-sha-hmac
crypto ipsec security-association lifetime seconds 3600
crypto ipsec security-association pmtu-aging infinite
SRX
Now the final stage is to take our IKE, IPsec policies, and tunnel
interface and combine them to build the VPN tunnel. You’ll note that
there are two groups of almost identical commands, the difference
being the remote networks.
SRX
Next you define the local and remote networks. First how you did so
with the ASA and then what to do on the SRX Series:
ASA
access-list SITE-TO-SITE-VPN_acl extended permit ip 10.0.0.0 255.0.0.0 10.200.0.0
255.255.240.0
access-list SITE-TO-SITE-VPN_acl extended permit ip 172.23.7.0 255.255.255.0 10.200.0.0
255.255.240.0
SRX
set security ipsec vpn Acme-VPN ike proxy-identity local 10.200.0.0/20
set security ipsec vpn Acme-VPN ike proxy-identity remote 10.0.0.0/9
Now define the IPsec policy previously created and set the tunnel to
establish immediately, by default, whenever some form of traffic is
initiated by the VPN:
set security ipsec vpn Acme-VPN ike ipsec-policy Acme-IPSEC-POLICY
set security ipsec vpn Acme-VPN establish-tunnels immediately
Device Management
If the SRX Series were migrated at this point, there would be full
connectivity. The VPN would be up to allow the branch office to
connect to headquarters, and users in the headquarters would be
able to surf the Internet, and so on. However, if this device were to
go live right now, it stands to face an increased risk of being
compromised from an attack, and the reason for this is because
the device hasn’t been hardened.
In an era where IT systems and services are suffering from an
increased number of attacks, it is essential that all network devices
are configured to defend themselves against unauthorized access.
This need is increased when the network device is Internet-facing
like this SRX Series will be.
On this SRX Series, restrictions must be put in place to prevent
anyone from outside Acme from being able to administer this
device. In addition, access from inside the organization should be
restricted to the management subnets, for internal Acme reasons.
Figure 5.1 shows a sample of some of the VLANs inside Acme.
50 Day One: Migrate Cisco ASA to Juniper SRX Series
So the SRX Series needs to be configured to only allow access from the
Management VLAN, and this access should be restricted to SSH and
HTTPS for configuration purposes, and to SNMP for monitoring.
Access from telnet and unencrypted HTTP must be denied. Let’s
harden the SRX Series using your available ASA knowledge.
CAUTION At this point it would be a very bad idea to issue a commit to this SRX
Series, primarily because the filter does not specify other allowed
traffic, such as SSH, and you could quite easily lock yourself out of the
device, therefore the commit will be issued at the end of this chapter.
52 Day One: Migrate Cisco ASA to Juniper SRX Series
The SRX Series by default allows management via HTTP and HTTPS,
but only from the default VLAN. The default configuration is shown
here:
[edit system services]
root@Acme-INTERNET-FW# show
ssh;
telnet;
xnm-clear-text;
web-management {
http {
interface vlan.0;
}
https {
system-generated-certificate;
interface vlan.0;
Where the ASA specified that SSH should only be allowed on the
INSIDE interface, technically this has already been done on the SRX
Series. When the security zones were configured, the zone trust was
renamed as the zone INSIDE. When this was done, the following
options were moved across to the zone INSIDE too:
root@Acme-INTERNET-FW> ...curity zones security-zone INSIDE
host-inbound-traffic {
system-services {
all;
}
protocols {
all;
}
}
This option allows all traffic directed at the SRX Series to be accepted
by the routing engine unless the firewall filter assigned to interface lo0.0
denies the traffic. At the same time, there is no such option set on the
INTERNET and DMZ interfaces, so not even a ping is allowed by
default, and that’s why it was necessary earlier to set the host-inbound-
traffic system-services ping option on the ge-0/0/0.0 interface.
Restricting which IP addresses can access this device must be done via
the same firewall filter that was created earlier. This simply means
adding another term called DEVICE-MANAGE to the filter PROTECT-SRX:
set firewall family inet filter PROTECT-SRX term DEVICE-MANAGE from source-address
10.255.1.0/24
set firewall family inet filter PROTECT-SRX term DEVICE-MANAGE from protocol tcp
set firewall family inet filter PROTECT-SRX term DEVICE-MANAGE from destination-port ssh
set firewall family inet filter PROTECT-SRX term DEVICE-MANAGE from destination-port https
set firewall family inet filter PROTECT-SRX term DEVICE-MANAGE then accept
Let’s assume the Acme IT director would like a list of any unauthorized
addresses that have tried to access this device and a count of how many
attempts have been made. Therefore, another term with the name
DENY-MANAGE will be created, which encompasses HTTP, HTTPS, telnet,
and SSH. As the source address is not specified, this filter will apply to
all addresses not covered in previous terms:
set firewall family inet filter PROTECT-SRX term DENY-MANAGE from protocol tcp
set firewall family inet filter PROTECT-SRX term DENY-MANAGE from destination-port ssh
set firewall family inet filter PROTECT-SRX term DENY-MANAGE from destination-port https
set firewall family inet filter PROTECT-SRX term DENY-MANAGE from destination-port http
set firewall family inet filter PROTECT-SRX term DENY-MANAGE from destination-port telnet
set firewall family inet filter PROTECT-SRX term DENY-MANAGE then count ACCESS-DENIED
set firewall family inet filter PROTECT-SRX term DENY-MANAGE then log
set firewall family inet filter PROTECT-SRX term DENY-MANAGE then reject
54 Day One: Migrate Cisco ASA to Juniper SRX Series
At the end of this term, you can see the action of reject is used along
with a log and a count, which will send the counts to a counter called
ACCESS-DENIED. The alternative option to reject is discard. The
difference between these options is that discard silently ignores the
packet whereas reject will send a response back to the client stating
that this request wasn’t allowed.
One issue with using reject is that when an attacker tries to access an
address they would not be allowed access, but because they get a reply
they know that the IP address they attempted to access was in use, and
as a result know they can attack it. This doesn’t matter as much in our
case as the only interface SSH, HTTP, HTTPS, and telnet traffic can
come in on is ge-0/0/2.0.
There is one major issue that must be addressed. This filter has an
implicit deny. This means that any traffic that isn’t specifically allowed
by this filter will be denied, which includes SNMP traffic or dynamic
routing protocols that may be in use. This means that the filter should
end with a term allowing all other traffic access to the device. If no
source, destination, or protocol is set, then this term will match all
traffic not mentioned in previous terms:
set firewall family inet filter PROTECT-SRX term EVERYTHING-ELSE then accept
mation:
ntp authentication-key 123 md5 T1m3-Fl135
ntp authenticate
ntp trusted-key 123
ntp server 10.255.1.25 key 123 source INSIDE prefer
Login Authentication
Although it is possible to administer the device without a username
and password on the ASA, it is certainly not ideal, as this is a major
security risk. With the SRX Series, you are forced to enter a password
for the root user when you perform the initial configuration on the
SRX Series. Although the SRX Series has the option of a root user, that
doesn’t mean it’s a good idea to continue to use this user account,
primarily because this account gives an administrator full access to the
underlying operating system.
In either case, as part of corporate security requirements, Acme
requires a local account to be created. This account is named acmead-
min and is set with a complex password of $$B1llY4ll, and in the case
of the ASA had Cisco’s privilege 15 rights, therefore the ASA had the
following configuration added:
username acmeadmin password $$B1llY4ll privilege 15
After pressing the Enter key, the Junos OS prompts the administrator
to enter the password and then re-enter the password. Unlike the ASA,
the password in Junos OS is hidden as it is typed when the username is
created.
Using this local administrator account, however, does have some
56 Day One: Migrate Cisco ASA to Juniper SRX Series
drawbacks. The first drawback is keeping track of who has made what
changes. As you will see later, when a commit is performed within the
Junos OS the messages sent to logs are quite verbose, and the user that
performed the commit is included within the messages. The better
option would be to have each user use their own username, which
brings us to the second drawback.
If the network team is of a reasonable size, and if the organization has
a large number of devices, adding a username when someone joins the
team or removing a username from devices when an engineer leaves
can be quite time intensive. The most sensible option would be to leave
a single local administrator account and use an Access Control Server
(ACS) to authenticate administrator accounts from a central location.
With an ACS server, the username and password only need to be set on
that server and the network devices connect to the ACS server to
perform authentication. The local user account is there as a backup in
case the ACS server in inaccessible. There are two types of ACS
servers: RADIUS and TACACS+. Acme use a TACACS+ server with
the IP address of 10.155.1.30. The ACS server needs to be configured
with a secret which the network device will use to prove to the ACS
server it is an authorized device. The secret on the ASA is set to
5up3r53c43t:
aaa-server TACACS-SERVER protocol tacacs+
aaa-server TACACS-SERVER host 10.255.1.30 5up3r53c43t
Typically, the secret should be set differently for each device, however
as the ASA is being replaced by the SRX, and as such the host name
and IP address remains the same, the secret on the SRX should be set to
the same secret in use on the ASA. This command sets this on the SRX
along with the IP address of the ACS server:
set system tacplus-server 10.255.1.30 secret 5up3r53c43t
After the TACACS+ server has been configured, the device needs to be
told to use that AAA server. With the ASA there were multiple compo-
nents that need to be authenticated, SSH, the WebGUI, and the enable
password. This means three statements need to be added to tell the
ASA to use the ACS server for all of these connection options:
aaa authentication ssh console TACACS-SERVER LOCAL
aaa authentication http console TACACS-SERVER LOCAL
aaa authentication enable console TACACS-SERVER LOCAL
After authentication – which verifies that someone is who they say they
are – comes authorization, which determines what the user can do,
assuming the authentication check confirms that the user is permitted
to access that device. The authorization options are set on the ACS
Chapter 5: Device Management 57
server and are not covered in this book, but the commands to tell the
ASA to use AAA authorization are below:
aaa authorization command TACACS-SERVER LOCAL
aaa authorization exec authentication-server
To tell the Junos OS to authenticate using the ACS server, you need to
set the authentication order, otherwise Junos OS will continue to
authenticate using the local username. The keyword of tacplus tells
Junos OS to use the TACACS+ server first, then the keyword of
password tells Junos OS to use the local usernames should the ACS
server be unreachable or if it times out. Should authentication fail, the
Junos OS does not fall back to the local user name, which is similar to
the way the ASA handles authentication:
set system authentication order [tacplus password]
Authorization on the SRX Series is slightly different. Junos OS uses
classes that are associated with the username. These classes are created
within Junos OS. By default, three classes are created: super-user,
operator, and read-only.
Therefore, with the SRX Series, the ACS only needs to tell the SRX
Series which of these classes any authenticated user belongs to, and this
is done by the use of templates:
set system login user remote-super-users full-name “Template for super-users” uid 2012 class
super-user
set system login user remote-operator full-name “Template for Operators” uid 2013 class
super-user
set system login user remote-read-only full-name “Template for read-only” uid 2014 class
read-only
MORE? While this book can’t provide all the information on how to configure
the ACS server for Junos OS authorization, the following knowledge-
based article may prove useful for engineers wishing to study this topic
in a little more detail: https://kb.juniper.net/InfoCenter/index?page=co
ntent&id=KB17269&actp=search.
58 Day One: Migrate Cisco ASA to Juniper SRX Series
When configuring the SRX Series, the syslog level needs to be specified
with the host IP address. In addition, the facilities that are being
monitored, such as ports or configuration changes, need to be speci-
fied. It’s possible to specify different facilities for different log servers,
but Acme wants all facilities to go to the same syslog server, so here,
the keyword any is specified after the host IP address:
set system syslog host 10.255.1.20 any info
Finally, you need to tell Junos OS which traps to send to the SNMP
server. The ASA was set to send all traps, and the SRX Series doesn’t
allow this option, but you can clearly see there are several other
options for your consideration in the following output:
[edit]
root@Acme-INTERNET-FW# set snmp trap-group SNMP categories ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don’t inherit configuration data from these groups
authentication Authentication failures
chassis Chassis or environment notifications
chassis-cluster Clustering notifications
configuration Configuration notifications
link Link up-down transitions
> otn-alarms OTN alarm trap subcategories
remote-operations Remote operations
rmon-alarm RMON rising and falling alarms
routing Routing protocol notifications
services Services notifications
> sonet-alarms SONET alarm trap subcategories
startup System warm and cold starts
vrrp-events VRRP notifications
Let’s assume that Acme wants the server to receive events related to
authentication failure, chassis information (such as power supply
health, interface information), operations performed remotely, routing
failures, when the device is reloaded, any configuration changes made,
and any service failures. The following commands do just that:
set snmp trap-group SNMP categories authentication
set snmp trap-group SNMP categories chassis
set snmp trap-group SNMP categories link
set snmp trap-group SNMP categories remote-operations
set snmp trap-group SNMP categories routing
set snmp trap-group SNMP categories startup
set snmp trap-group SNMP categories configuration
set snmp trap-group SNMP categories services
60 Day One: Migrate Cisco ASA to Juniper SRX Series
Now that the traps have been set, the configuration that allows the
SNMP server to send SNMP get requests can be added. The first com-
mand in the following configuration sets the device to accept SNMP
requests only from the inside interface, which is interface ge-0/0/2.0.
The next command sets the community name as NOT-PUBLIC with the
permissions being set as read-only. And the final command specifies that
Junos OS will only accept requests from a particular subnet or IP
address; in this case, access is restricted to the IP address of the SNMP
server:
set snmp interface ge-0/0/2.0
set snmp community NOT-PUBLIC authorization read-only
set snmp community NOT-PUBLIC clients 10.155.1.40/32
Now that the necessary commands have been entered, the configuration
can be committed before moving on to test whether everything will
work as expected prior to moving the device into the live environment.
So far so good, the SRX Series rejects the ping and we get a request
timeout, so now we can move on and test connectivity. Let’s assume
that the testing of denying telnet was successful, and instead an SSH
session will be tested from a device with the IP address of 10.0.0.118, as
shown in Figure 5.2.
TIP When the migration from the ASA to the SRX Series is being per-
formed, this fingerprint issue will need to be taken into consideration
for any client that has connected to the ASA via SSH.
Most clients will have a record of the fingerprint associated with the IP
address 10.100.1.1, which is currently associated with the ASA and
these clients will be connected to the SRX Series, post migration.
Therefore, any client that previously performed administration for the
ASA will need to remove the fingerprint from their SSH databases
before they can successfully connect to the SRX Series.
In this case, the SRX Series has synced correctly. The command show
ntp status can also be used to check which NTP server was used,
should multiple NTP server statements have been configured:
root@Acme-INTERNET-FW> show ntp status
status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg,
version=”ntpd 4.2.0-a Sat Sep 26 04:37:05 UTC 2015 (1)”,
processor=”octeon”, system=”JUNOS12.1X46-D40.2”, leap=00, stratum=2,
precision=-17, rootdelay=3.235, rootdispersion=3.150, peer=8532,
refid=10.255.1.25,
reftime=db5a20f0.b4409274 Sat, Aug 13 2016 22:42:56.704, poll=6,
clock=db5a212f.640620a7 Sat, Aug 13 2016 22:43:59.390, state=3,
offset=0.000, frequency=0.000, jitter=0.855, stability=0.000
Chapter 5: Device Management 63
V3 Input:
Unknown security models: 0, Invalid messages: 0
Unknown pdu handlers: 0, Unavailable contexts: 0
Unknown contexts: 0, Unsupported security levels: 0
Not in time windows: 0, Unknown user names: 0
Chapter 2: SNMP and the Health of Your Network 27
Unknown engine ids: 0, Wrong digests: 0, Decryption errors: 0
Output:
Packets: 1897, Too bigs: 0, No such names: 0,
Bad values: 0, General errors: 0,
Get requests: 0, Get nexts: 0, Set requests: 0,
Get responses: 1885, Traps: 12
66