Description
This article describes how to configure port forwarding using FortiGate Virtual IPs.
Scope
FortiGate.
Solution
Add Virtual IPs to enable port forwarding.
To forward TCP or UDP ports received by the FortiGate external interface to an internal server, follow these two steps.
This example describes how to configure port forwarding to allow access to an internal Windows server PC with the Remote access protocol which uses the default port of 3389.
To add a virtual IP that forwards RDP packets.
Example configuration in the CLI:
config firewall vip
edit test
set extip 67.22.22.22
set mappedip 192.168.11.247
set extintf port1
set portforward enable
set extport 3389
set mappedport 3389
next
end
Now all that’s left is to define a firewall policy that accepts RDP traffic from the Internet and forwards it to the internal Windows Server PC.
To add a firewall policy with a virtual IP.
Example configuration in the CLI:
config firewall policy
edit 0
set name RDP
set srcintf port1
set dstintf port2
set action accept
set srcaddr all
set dstaddr test
set schedule always
set service ALL
set logtraffic all
next
end
Note: There was a change made to the behavior of the IP Pool and VIP after upgrading FortiOS to v6.4, v7.0, v7.2, and v7.4. For more information, refer to Technical Tip: IP pool and virtual IP behavior changes in FortiOS 6.4, 7.0, 7.2, and 7.4.
Related article:
Technical Tip: How to configure port forwarding wh... - Fortinet Community
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.