Configuring FortiGate for SIP over TLS
After Configuring FortiFone softclient for mobile settings on FortiVoice, perform the following procedures to configure a FortiGate device for SIP over TLS:
- Import the downloaded FortiVoice server certificate for SIP over TLS
- Configure system settings for SIP over TLS
- Create virtual IP addresses for SIP over TLS
- Configure VoIP profile and NAT traversal settings for SIP over TLS
- Create an inbound firewall policy for SIP over TLS
- Create an outbound firewall policy for FortiVoice to access the Android or iOS push server
If your FortiVoice deployment is using SIP over TCP or UDP instead, go to Configuring FortiGate for SIP over TCP or UDP.
Import the downloaded FortiVoice server certificate for SIP over TLS
Perform the following steps to import the downloaded FortiVoice server certificate. The downloaded certificate is from Export the FortiVoice server certificate for SIP over TLS.
- On FortiGate, go to System > Certificates.
- Click Import and select Local Certificate.
- Update the following fields in the Import Certificate dialog:
- In Type, click PKCS #12 Certificate.
- In Certificate with key file, click Upload.
- Locate the FortiVoice server certificate. This is the file from Export the FortiVoice server certificate for SIP over TLS.
- Click Open.
- In Password, enter the password associated with the FortiVoice server certificate.
- Click OK.
- Verify that the list of certificates now includes the newly imported FortiVoice server certificate.
Configure system settings for SIP over TLS
- On FortiGate, go to System > Feature Visibility.
- Under Additional Features, enable Multiple Security Profiles and VoIP.
- Click Apply.
Create virtual IP addresses for SIP over TLS
- On FortiGate, go to Policy & Objects > Virtual IPs.
- Click Create New and select Virtual IP.
- Create virtual IPs for the following services that map to the IP address of the FortiVoice:
- External SIP TLS port of FortiVoice
- External HTTPS port of FortiVoice. The HTTPS port is used for the softclient login, call logs, and contacts download from the FortiVoice phone system.
- To create a virtual IP group, click Create New and select Virtual IP Group.
- Add the two newly created virtual IPs.
Configure VoIP profile and NAT traversal settings for SIP over TLS
- On FortiGate, open the CLI Console from the GUI banner.
- Create a VoIP protection profile and enable hosted NAT traversal (HNT) and restricted HNT source address. If the FortiVoice softclient is behind a non-SIP-aware firewall, HNT addresses the SDP local address problem. Enable SSL full inspection and refer to the imported FortiVoice server certificate for example, FortiVoiceSIPServer.
This VoIP protection policy with hosted NAT traversal enabled will be added to the inbound firewall policy to prevent potential one way audio issues caused by NAT.
VoIP profile command example for SIP over TLS
config voip profile
edit "SIP_IN"
config sip
set hosted-nat-traversal enable
set ssl-mode full
set ssl-server-certificate "FortiVoiceSIPServer"
end
next
end
- For SIP over TLS, the recommendation is to use the default SSL port for SIP (TCP 5061). Enter the following commands:
- Edit the FortiGate interface connecting to the internet and set it to external. The SIP application layer gateway (ALG) with hosted NAT traversal requires an external port to work. Enter the following commands:
config system settings
set sip-tcp-port 5061
end
config system interface
edit wan1
set external enable
next
end
Create an inbound firewall policy for SIP over TLS
- On FortiGate, go to Policy & Objects > Firewall Policy and click Create New.
- Set Incoming Interface to the internet-facing interface.
- Set Outgoing Interface to the internal/LAN interface.
- Set Source to all.
- Set Destination to the virtual IP group created in Create virtual IP addresses for SIP over TLS.
- Set Schedule to always.
- Set Service to ALL.
- Disable NAT.
- Enable VoIP and select the VoIP profile created in Configure VoIP profile and NAT traversal settings for SIP over TLS.
Create an outbound firewall policy for FortiVoice to access the Android or iOS push server
FortiVoice requires outbound access to the Android and iOS push servers.
If FortiGate has an outbound firewall policy that allows FortiVoice to access everything on the internet, then you do not need to create an additional firewall policy. You have completed the FortiGate configuration for SIP over TLS. Go to Installing and configuring the FortiFone softclient for mobile.
If FortiGate does not have an outbound firewall policy that allows FortiVoice to access everything on the internet, perform the steps to create the FQDN addresses and the specific outbound firewall policies to allow FortiVoice to access the Android and iOS push servers.
To create FQDN addresses for Android and iOS push servers
- On FortiGate, go to Policy & Objects > Addresses and click Create New.
- In Name, enter a name for the Android push server address.
- In Type, select FQDN.
- In FQDN, enter fcm.googleapis.com.
- Click OK.
- Click Create New.
- In Name, enter a name for the iOS push server address.
- In Type, select FQDN.
- In FQDN, enter gateway.push.apple.com.
- Click OK.
To use the Android and iOS push server addresses in an outbound firewall policy
- On FortiGate, go to Policy & Objects > Firewall Policy and click Create New.
- In Incoming interface, enter the port connected to FortiVoice.
- In Outgoing interface, enter the WAN port.
- In Source, select all.
- In Destination, select the FQDN addresses that you created for the Android and iOS push servers.
- Configure the rest of the policy, as needed.
- Click OK.
You have completed the configuration of FortiGate for SIP over TLS.
- Go to Installing and configuring the FortiFone softclient for mobile.