
To configure a virtual IP in Fortigate for IPv4, you need to create a virtual IP address and bind it to an interface. This can be done in the GUI by navigating to System > Network > Interface and selecting the interface you want to bind the virtual IP to.
A virtual IP can be created on a Fortigate device by going to System > Network > Virtual IP. From there, you can select the protocol (IPv4 or IPv6) and enter the virtual IP address.
In the IPv4 configuration, you can also specify the subnet mask and default gateway for the virtual IP. This is done in the same Virtual IP page where you create the virtual IP address.
Readers also liked: Azure Create Virtual Network
Configuring Virtual IP
Configuring a Virtual IP (VIP) on a FortiGate device is a straightforward process that requires attention to a few key details.
To configure a VIP for NAT46, you'll need to enter a single IP address in both fields in the standard IPv4 format. This address is usually the public address of the server.
For NAT64, the process is similar, with the same IP address entered in both fields, also in standard IPv4 format.
If you're only forwarding traffic for a specific port or port range, be sure to enable port forwarding.
You'll also need to select the protocol from TCP or UDP, depending on your needs.
To configure the external service port, enter the first port in the range in the first field, and the second field will auto-populate with the same number. You can then edit the second field to extend the range if needed.
Similarly, configure the map to port setting by entering the first port in the range in the first field, and the second field will auto-populate.
Here's a summary of the steps:
- Disable/Enable Port Forwarding
- Select the Protocol (TCP or UDP)
- Configure the External Service Port
- Configure the setting Map to Port
By following these steps, you'll be able to configure a Virtual IP on your FortiGate device.
Troubleshooting
Troubleshooting a virtual IP in FortiGate can be a bit tricky, but don't worry, I've got some tips to help you out.
First, check if the virtual IP is properly configured. This includes verifying that the VIP is set to the correct IP address and subnet mask, and that the VIP is associated with the correct interface.
Make sure the VIP is not in conflict with any other IP addresses on the network. You can check the FortiGate's routing table to see if the VIP is being used by another device.
If you're still having issues, try resetting the VIP to its default settings. This can often resolve any configuration-related problems.
Problem
One problem remains unsolved: if you have more than one interface on which the virtual IP must be used, while some connections are policy routed to another ISP.
You must set the interface inside the virtual IP to "Any" to make it work with the other ISP. However, this won't work with some connections.
Configuring several virtual IPs with the same external/mapped IPs and different interfaces is not possible due to configuration restrictions.
In this case, you can use some more security policy entries with IP pools to solve the problem.
Readers also liked: How Do Virtual Events Work
Issue

Troubleshooting can be a real challenge, especially when it comes to complex network configurations. In this section, we'll explore a common issue that can arise with Virtual IP (VIP) objects.
Many VIPs were configured but not all of them were used in the security policy, leaving some with a reference counter of 0. This can lead to inconsistent behavior and make troubleshooting even more difficult.
A global rule allows basic Internet usage with source-NAT of "Use Outgoing Interface Address". This can cause confusion, as it may seem like the VIP is not being used at all.
Only those servers which VIP was used in the policy (even though on other rules!) used the correct virtual IP for outgoing connections. This highlights the importance of carefully reviewing security policies.
All servers which VIP was not used in the policy simply used the mere interface IP address. This can be a major issue, especially if the interface IP address is not the intended IP address.
Note that in any case a global policy rule was used for outgoing connections, not that one which used the VIP object. This means that the VIP must only be referenced once in the complete security policy.
A different take: Azure Virtual Network Dns Servers
Workaround

A workaround was created to resolve the issue, but it has its limitations. It involves configuring a dummy rule for incoming connections to reference the VIP object at least once in the security policy rule set.
This workaround allows outgoing connections from internal servers to be correctly source-NATed to their corresponding virtual IPs. However, it's essential to note that global policy rules must not be altered to use different IP pools or the like.
The "Central NAT" could potentially solve this issue, but it would require additional configurations. Each inside host would need its own IP pool with a single untrust IP address referenced in the central NAT rule.
Furthermore, each security policy would need a clone of itself, one with the "Central NAT" and one with the "Use Outgoing Interface Address".
Intriguing read: Azure Virtual Desktop Security
FortiGate Guides
In FortiGate, you can disable or enable optional filters, which is a good starting point for configuring your Virtual IP (VIP). To do this, follow the instructions in the "FortiGate Guides" section.
On a similar theme: Fortigate Setup Ssl Vpn
Disabling or enabling optional filters is a straightforward process that can help you troubleshoot issues with your VIP configuration.
You can also create a VIP which works perfectly, allowing traffic from the inside to the external VIP IP. But, you may encounter issues with connecting to the VIP using an IPsec VPN to the Fortinet, as mentioned in the comment section of the "FortiGate Guides" section.
Jan-Pieter experienced this issue, where he couldn't connect to the VIP using an IPsec VPN to the Fortinet, despite being able to ping and connect to all hosts and the ftg from the VPN normally.
The IPsec ipspace is part of one of the internal ip spaces, and creating firewall rules doesn't seem to resolve the issue. However, other IP's on the same subnet can normally connect to the VIP using the wan1 public IP.
Here's a list of possible solutions to consider:
- Check the IPsec VPN configuration to ensure it's properly set up.
- Verify that the VIP is correctly configured and reachable from the IPsec VPN.
- Check the firewall rules to ensure they're allowing traffic to the VIP from the IPsec VPN.
Creating a Virtual IP
Creating a virtual IP in FortiGate is a straightforward process that can be completed in a few steps. You'll need to navigate to the Policy & Objects section, specifically the Virtual IPs page.
To start, go to Policy & Objects > Virtual IPs and select Create New. A dropdown menu will be displayed, and you should select Virtual IP from the options.
The next step is to choose the type of VIP you want to create, which depends on the IP addressing involved. You can choose from four options: IPv4, IPv6, NAT46, or NAT64. These options determine which type of IP network is on the external and internal interfaces of the FortiGate unit.
Here are the available options and their descriptions:
- IPv4 – IPv4 on both sides of the FortiGate Unit.
- IPv6 – IPv6 on both sides of the FortiGate Unit.
- NAT46 – Going from an IPv4 Network to an IPv6 Network.
- NAT64 – Going from an IPv6 Network to an IPv4 Network.
Once you've selected the type of VIP, you can proceed to input a unique identifier for the Virtual IP in the Name field. You can also add any additional information in the Comments field. The Color of the icons that represent the object in the GUI can be changed by clicking on the [Change] link and choosing from the 32 available colors.
Frequently Asked Questions
What is the priority of virtual IP in FortiGate?
In FortiGate, virtual IP (VIP) port forwarding priority is determined from top to bottom. VIPs are only checked if they are applied on at least one firewall policy.
Featured Images: pexels.com


