VyOS

Last updated Apr 21, 2026 This tutorial provides configuration information and a sample template for using a VyOS device with an IPsec configuration.

Notes

  • vti <NAME_OF_VTI_INTERFACE> - Specifies the virtual tunnel interface of the IPsec tunnel.
  • esp-group <NAME_OF_ESP_GROUP> - Encrypts traffic through the tunnel using a particular ESP policy or profile.
  • ike-group <NAME_OF_IKE_GROUP> - Exchanges keys using a particular IKE policy or profile.
  • The IP addresses of the IPsec tunnel interfaces on both ends of the tunnel should be a pair of private IP addresses (RFC 1918) on the same /31 or /30 subnet, specifying a point-to-point link.
  • The IPsec tunnel endpoint on this VyOS router is the <IP_ADDR_OF_UPLINK_INTF_TO_INTERNET/WAN>.
  • The IP address of the IPsec tunnel endpoint on the Cloudflare side is one of the anycast IP addresses assigned to your account, available in Leased IPs ↗︎.
  • This router is configured to initiate the IPsec tunnel connection.

Configuration parameters

Phase 1

  • Encryption
  • AES-GCM with 128-bit or 256-bit key length
  • Integrity
  • SHA512

Phase 2

  • Encryption
  • AES-GCM with 128-bit or 256-bit key length
  • Integrity
  • SHA512
  • PFS group
  • DH group 20 (348-bit random ECP group)

Configuration template

set interfaces vti <name of the vti interface> address
'<PRIVATE_IP_ADDRESS_OF_IPSEC_TUNNEL_INTERFACE>'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> compression 'disable'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> lifetime '86400'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> mode 'tunnel'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> pfs 'enable'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> proposal 1 encryption 'aes256gcm128'
set vpn ipsec esp-group <NAME_OF_ESP_GROUP> proposal 1 hash 'sha512'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> close-action 'none'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> dead-peer-detection action 'restart'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> dead-peer-detection interval '30'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> dead-peer-detection timeout '120'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> ikev2-reauth 'no'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> key-exchange 'ikev2'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> lifetime '28800'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> mobike 'disable'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> proposal 1 dh-group '20'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> proposal 1 encryption 'aes256gcm128'
set vpn ipsec ike-group <NAME_OF_IKE_GROUP> proposal 1 hash 'sha512'
set vpn ipsec ipsec-interfaces interface '<UPLINK_INTF_TO_INTERNET/WAN>'
set vpn ipsec logging log-level '2'
set vpn ipsec options disable-route-autoinstall
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> authentication id '<IPSEC_ID_STRING_IN_RESULT_OF_PSK_KEY-GEN_VIA_CF_API>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> authentication pre-shared-secret '<PSK_KEY_STRING_GENERATED_VIA_CF_API>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> authentication remote-id '<CF_ANYCAST_IP>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> connection-type 'initiate'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> ike-group '<NAME_OF_IKE_GROUP>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> ikev2-reauth 'no'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> local-address '<IP_ADDR_OF_UPLINK_INTF_TO_INTERNET/WAN>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> vti bind '<NAME_OF_VTI_INTERFACE>'
set vpn ipsec site-to-site peer <CF_ANYCAST_IP> vti esp-group '<NAME_OF_ESP_GROUP>'

Was this helpful?

YesNo

On this page

VyOS - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/vyos/#page","headline":"VyOS","description":"Connect VyOS to Cloudflare WAN.","url":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/vyos/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/vyos/og.png?v=4d8a6e3d05ae9b67","dateModified":"2026-04-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Connect Yamaha RTX Router to Cloudflare WAN. title: Yamaha RTX Router image: https://developers.cloudflare.com/cloudflare-wan/configuration/third-party/yamaha/og.png?v=221e2c7242db6d45


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/cloudflare-wan/llms.txt
Use this file to discover all available pages before exploring further.