Static virtual IPs
Mapping a specific IP address to another specific IP address is usually called Destination NAT (DNAT). When this central NAT table is not used, FortiOS calls this a Virtual IP address (VIP). DNAT, or VIP, is used to map an external IP address to an IP address or address range. The mapping can include all TCP/UDP ports or, if port forwarding is enabled, it only refers to the specific configured ports. As the central NAT table is disabled by default, the term VIP is usually used.
VIPs are typically used to NAT external or public IP addresses to internal or private IP addresses. Using a VIP between two internal interfaces made up of private IP addresses is possible, but rare, because the two networks can just use the IP addresses of the networks without any address translation. Using a VIP for traffic going from the inside to the internet is supported, but unlikely to be required.
To create a virtual IP using the GUI:
- In Policy & Objects > Virtual IPs.
- Click Create New and select Virtual IP.
- Select a VIP Type based on the IP versions used:
- If IPv4 is on both sides of the FortiGate unit, select IPv4.
- If IPv6 is on both sides of the FortiGate unit, select IPv6.
- If traffic goes from an IPv4 network to an IPv6 network, select NAT46.
- If traffic goes from an IPv6 network to an IPv4 network, select NAT64.
- Enter a unique name for the virtual IP and fill in the other fields.
To create a virtual IP using the CLI:
config firewall vip edit "Internal_WebServer" set extip 10.1.100.199 set extintf "any" set mappedip "172.16.200.55" next end
To apply a virtual IP to policy using the CLI:
config firewall policy edit 8 set name "Example_Virtual_IP_in_Policy" set srcintf "wan2" set dstintf "wan1" set srcaddr "all" set dstaddr "Internal_WebServer" set action accept set schedule "always" set service "ALL" set nat enable next end