Rate this page:

Virtual Private Network

Interconnect VPN allows you to establish a virtual point-to-point connection to Twilio with IPsec tunnels that provide the functionality, security, and management policies of a private network. All you need is an IPsec VPN gateway with connection to the Internet.

Network Requirements

Your end

VPN Gateway

A network device (e.g. router, firewall) supporting IPsec protocol suite. The device needs to have an interface on the internet and be assigned an IPv4 address which is globally addressable/routable on the Internet.

Encryption Domain (IP routes)

One or more of your IP networks that will have access to Twilio. Your border devices (e.g. IP-PBX, SIP-PRI IAD, Session Border Controller, NAT gateway, etc.) will reside in these networks. in other words, these are the IP Addresses of the networks where you want them to communicate with Twilio through the IPsec tunnel.

Note that your Encryption Domain (IP routes) have to be globally unique ("public IPs") - as opposed to RFC 1918 address ranges - to avoid conflicts with other networks that Twilio platform is peered with. In other words, your IP routes have to be outside of the following ranges:

  • -
  • -
  • -


The computer system (physical hardware device or a virtual machine performing those tasks) that monitors and controls the flow of traffic in and out of your network (incoming and outgoing traffic). The firewall will have to allow your border devices to communicate with Twilio network.

IP Addresses

In order for various Twilio products to function properly, you need to allow all Twilio's IP addresses on your side and on your firewall. Please see here for further details.

Twilio's end

VPN Gateway

Twilio has VPN gateway(s) at each Twilio Interconnect Exchange location.

Encryption Domain (IP routes)

All Twilio signaling and media traffic will be initiated from fixed IP networks. Each Twilio Interconnect location has its own unique IP routes.

Twilio's VPN gateway and encryption domain details will be provided to you once you sign up for a VPN connection.

Twilio Interconnect VPN connection

Twilio will provision bandwidth for your connection at the Twilio Exchange location specified by you. See connection bandwidth and location options listed here. For high availability, we strongly recommend connecting to at least two of our geographically redundant Twilio Interconnect locations. For example, you can select a 100-Mbps connection in Ashburn, Virginia and a 100-Mbps connection in San Jose, California to create redundant connections to Twilio on both coasts of the United States. Similarly, this can be accomplished by having connections to London and Frankfurt in Europe and Singapore and Tokyo or Sydney in the APAC region.

IPsec Pre-shared Key

Twilio will issue a pre-shared key for IKE phase I authentication and send the key to you via a secure communication channel.

Configuring your private connection to Twilio

Step 1: Submit a provisioning request in Twilio Console

You will need to provide the following information:

  • Desired connection location and bandwidth
  • Your VPN Gateway IP
  • Your Encryption Domain (IP routes)

Step 2: Receive IPsec VPN configuration details from Twilio

You will be informed once your IPsec VPN has been configured. At that point your IPsec VPN configuration details including your PSK will be viewable in Twilio Console.

Step 3: Bring the IPsec tunnel up

Configure your VPN gateway using Twilio's IPsec VPN specification and your unique PSK from the above. Advertise Twilio IP routes to your internal network (i.e reverse route injection). This will allow your SIP-enabled elements route traffic to Twilio.

Next step

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Loading Code Sample...

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!