Laboratorio 2
Laboratorio 2
At its core, FortiGate is a firewall, so almost everything that it does to your traffic is related
to your firewall policies.
Field Value
Name LOCAL_SUBNET
Interface any
Type Subnet
IP/Netmask 10.0.1.0/24
5. Click OK.
The FortiGate GUI may ask to use the new policy list layout.
Click Cancel to continue using the classic layout. The new
policy list layout is ideal to improve performance when viewing
large list of firewall policies.
3. Right-click the Full_Access firewall policy, and then in the Set Status field,
select Disable.
Field Value
Name Internet_Access
Source LOCAL_SUBNET
Destination all
Schedule always
3. Leave all other settings at the default values, and then click OK to save the
changes.
www.google.com
www.cnn.com
www.bbc.com
2. Return to the browser tab with the Local-FortiGate GUI, and then click Policy &
Objects > Firewall Policy.
3. Right-click the Internet_Access policy, and then click Show matching logs.
4. Identify the log entries for your internet browsing traffic.
With the current settings, you should have a few log messages that have Accept (Start) in
the Result column. These are the session start logs.
When sessions close, a separate log entry lists the amount of data that was sent and
received.
5. In the Forward Traffic logs, click X to remove the Policy UUID filter.
When you remove the Policy UUID filter, the logs are displayed unfiltered. You will use the
logs in upcoming labs.
In this exercise, you will create a new firewall policy with more specific settings, such as the
source, destination, and service, and you will set the action to DENY. Then, you will move
this firewall policy above the existing firewall policies and observe the behavior that
reordering the firewall policies creates.
The firewall
address LINUX_ETH1
with
IP/netmask 10.200.1.
254/32 is
preconfigured for you,
and you will use this
address when you
create the firewall
policy.
2. Click Policy & Objects > Firewall Policy, and then click Create New.
Field Value
Name Block_Ping
Incoming port3
Interface
Field Value
Outgoing port1
Interface
Source LOCAL_SUBNET
Destination LINUX_ETH1
Service PING
Action DENY
Log <enable>
Violation
Traffic
ping 10.200.1.254
Stop and think!
4. On the Local-FortiGate GUI, click Policy & Objects > Firewall Policy.
On the Firewall
Policy page, if
the ID column is
visible, skip to step
8.
6. Click the settings icon, scroll down to the Select Columns section, select
the ID column, and then click Apply.
The ID column appears as the last column in the table.
7. Drag the ID column to the left of the Name column, so it becomes the first column
in the table.
Note the current ID values for both the Internet_Access and Block_Ping firewall policies.
8. In the ID column, drag the Block_Ping firewall policy up, and place it above
the Internet_Access firewall policy.
When you move the Block_Ping policy up, the ID value remains the same.
9. On the Local-Client VM, review the terminal window that is running the continuous
ping.
11. On the Local-FortiGate GUI, click Log & Report > Forward Traffic.
You should see many policy violation logs reporting the blocked ping.
In this exercise, you will examine how to configure a VIP for the Local-Client VM. Then, you
will create an egress-to-ingress firewall policy and apply the VIP. This allows internet
connections to the Local-Client VM. You will also verify the DNAT and SNAT behavior
using CLI commands.
Create a VIP
For DNAT on FortiGate, you use a VIP as the destination address field of a firewall policy.
You will configure the VIP to map the Local-Client VM (10.0.1.10) to 10.200.1.200, which is
part of the port1 subnet. To refer to the lab diagram, see Network Topology on page 1.
To create a VIP
1. Connect to the Local-FortiGate GUI, and then log in with the username admin and
password password.
2. Click Policy & Objects > Virtual IPs, and then click Create New.
Field Value
Name VIP-
INTERNAL-
Field Value
HOST
Interface port1
This port is
connected to the
internet with IP
address
10.200.1.1/24.
External IP 10.200.1.200
address/range
This IP address
is in the same
range as the
port1 subnet.
4. Click OK.
Create a Firewall Policy
You will configure a new firewall policy using the VIP that you just created as the
destination address.
1. On the Local-FortiGate GUI, click Policy & Objects > Firewall Policy.
Field Value
Name Web-Server-Access
Incoming port1
Interface
Outgoing port3
Interface
Source all
Destinatio VIP-INTERNAL-
n HOST
You will also test how the source address is translated by the VIP when traffic leaves the
Local-Client VM.
1. On the Remote-Client VM, open a browser, and then browse to the following URL:
http://10.200.1.200
3. Enter the following command to check the destination NAT entries in the session
table:
You will notice that the destination address 10.200.1.200 is translated to 10.0.1.10, which
is the mapping you configured in the VIP.
Test SNAT
As a result of the VIP (which is a static NAT), FortiGate uses the VIP external address as
the NAT IP address when performing SNAT for the internal-to-external direction of the
traffic, provided the matching outgoing firewall policy has NAT enabled. That is, FortiGate
doesn't use the egress interface address.
To test SNAT
1. Return to the Local-FortiGate CLI session, and then enter the following command
to clear any existing sessions:
This clears the session to the Local-FortiGate from the Local-Client VM.
3. On the Local-Client VM, open a few browser tabs, and then connect to a few
websites, such as:
www.fortinet.com
www.yahoo.com
www.bbc.com
This is a behavior for SNAT when using a static NAT VIP. That is, when you enable NAT in
a policy, the external address of a static NAT VIP takes precedence over the destination
interface IP address, if the source address of the connections matches the VIP internal
address.
Currently, Local-FortiGate translates the source IP address of all traffic generated from the
Local-Client VM to 10.200.1.200 because the internal address of the VIP matches the
address of Local-Client, and the VIP is a static NAT VIP.
In this exercise, you will examine how to create an IP pool, apply it to the ingress-to-egress
firewall policy, and verify the SNAT address using CLI commands.
Create an IP Pool
You will create an IP pool from the range of public IP addresses available on the egress
port (port1).
To create an IP pool
1. Connect to the Local-FortiGate GUI, and then log in with the username admin and
password password.
Name INTERNAL-HOST-
EXT-IP
External IP 10.200.1.100-
Range 10.200.1.100
4. Click OK.
Field Value
NAT <enable>
Field Value
6. Click the + sign that appeared when you clicked Use Dynamic IP Pool, and then in
the section on the right, click INTERNAL-HOST-EXT-IP.
7. Click OK.
3. On the Local-Client VM, open a few browser tabs, and then connect to a few
websites, such as:
www.fortinet.com
www.yahoo.com
www.bbc.com
4. On the Local-FortiGate CLI, enter the following command to verify the SNAT
address that the sessions are using: