FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Andy_G
Staff
Staff
Article Id 197346

Article

Description

When setting up a Virtual IP on the FortiGate for a mail server, there can be issues with mail being sent outbound through the firewall when NAT is configured.

If you have a port translation on your external mail server IP address rather than full port translation, the mail coming back out will have the NAT translation of the firewall rather than the desired Virtual IP.

Scope
  • FortiGate units running FortiOS 2.8 or FortiOS 3.0
Solution

To enable proper address translation using the virtual IP, use an IP Pool.

First, create an address entry for the email server.

To create an address

  1. Go to Firewall> Address.
  2. Select Create New.
  3. Add the IP for the email server with a netmask of 255.255.255.255.
  4. Select OK.

Next, create an IP Pool with the email server address.

To create an IP Pool

  1. In FortiOS 2.8, go to Firewall> IP Pool.
    In FortiOS 3.0, go to Firewall> Virtual IP> IP Pool.
  2. Select Create New.
  3. Enter a name for the IP Pool.
  4. Set the interface to the external interface of the FortiGate unit.
  5. Enter the IP address range. In this case, it will be a single address of the email server. Do not include the netmask.
  6. Select OK.

Create a firewall policy for this NAT translation.

To create a firewall policy

  1. Go to Firewall> Policy.
  2. Select Create New and complete the following:
    Source Internal
    Address Name The address created for the mail server.
    Destination All
    Address Name All
    Schedule Always
    Service SMTP
    Action Accept
  3. Select the NAT Checkbox and select Dynamic IP Pool.
  4. Select the IP Pool you created from the drop-down list.
  5. Select OK.

Ensure that the new rule is listed BEFORE the Internal to External Allow Any Rule for normal traffic to ensure that the FortiGate unit translates the email traffic before the normal Internet traffic.

See also the related article "How do I configure a Virtual IP?"