Configure Virtual Appliance·续1

  1. In the terminal prompt of your Proxmox server, run the script with elevated privileges:
bash ./proxmox_mconn_vm.sh
  1. You will be prompted to create a new Cloudflare One Virtual Appliance. Select yes to proceed.
  2. Enter your license key.

Note

You cannot use the same license key twice, or reuse a key once the virtual machine has been registered with Cloudflare. Generate a new key for every new Cloudflare One Virtual Appliance from the Connectors page.

The script applies default settings and configures the virtual machine for Cloudflare One Virtual Appliance. After the script finishes, adjust the VM for your environment. The new VM has all network interface cards (NICs) on the same bridge, and only the first NIC has an active link.

  1. In the Hardware settings for the new VM, select the NIC you want to use with Cloudflare One Virtual Appliance.
  2. Select the network bridge that corresponds to the physical NIC on your host machine. This bridge allows the network adapter in the virtual machine to communicate through the NIC in the host, as if it were directly connected to the physical network.
  3. (Optional) Configure your VLAN setting if needed.

VLAN tagging

Cloudflare One Virtual Appliance supports creating subinterfaces through the use of 802.1Q VLAN tagging ↗︎.

Use VLAN ID 0 when:

  • Connected to a Port Group or Distributed Port Group that is associated with a specific VLAN.
  • Connected to a Port Group or Distributed Port Group that is configured as a trunk that requires untagged packets.

You can also configure subinterfaces on the Cloudflare One Virtual Appliance by associating the network interface with a Port Group or Distributed Port Group trunk and specifying a VLAN ID in addition to the port associated with the network interface (VLAN ID 1-4094).

Refer to Proxmox documentation ↗︎ for more information.

  1. Make sure the hardware settings match the minimum requirements for running Cloudflare One Virtual Appliance. Make changes to the RAM and CPU if needed.
  2. Continue setup in your Cloudflare dashboard.

1. Obtain the Cloudflare One Virtual Appliance script

Download the Cloudflare One Virtual Appliance helper script for libvirt/KVM to your host. The script deploys the virtual machine with the appropriate settings for Cloudflare One Virtual Appliance. For details on system requirements, refer to Prerequisites.

The deployment assumes the use of libvirt. The virtual machine manager graphical interface is not required. The VM uses the OVMF_CODE.fd file from the ovmf package on Debian or Ubuntu.

The script can be deployed multiple times to create several instances of a Cloudflare One Virtual Appliance, in different locations or on the same host. You consume one license key for each instance created. Generate a license key for each instance from the Connectors page. For example, to deploy 10 Cloudflare One Virtual Appliances, generate 10 license keys.

curl -OL https://assets.magic-wan-connector.cloudflare.com/stable/libvirt_mconn_vm.sh

2. Deploy the Cloudflare One Virtual Appliance on libvirt/KVM

The following instructions assume you already have libvirt installed with sufficient resources. For details, refer to Prerequisites.

  1. In the terminal prompt of your host, run the script with elevated privileges. The script takes one optional argument, the name of the VM. If you do not provide a name, the VM defaults to vmconn:
sudo bash ./libvirt_mconn_vm.sh
  1. When prompted, enter a name for the VM. This name is used for the VM definition, the disk name, and the nvram file name. If the name already exists, the script exits with an error and you must use a different name.
  2. Select the storage pool for the VM disk.
  3. Choose whether to enable the graphics console in addition to the serial console.
  4. Enter your license key.

Note

You cannot use the same license key twice, or reuse a key once the virtual machine has been registered with Cloudflare. Generate a new key for every new Cloudflare One Virtual Appliance from the Connectors page.

The script deploys the virtual machine with the appropriate settings. NICs are named based on the defined PCI path of each NIC. Changing the PCI path of a NIC breaks functionality. NICs are configured in an inactive state with the default network source.

  1. Configure the NICs for your environment. Configure the WAN-associated NICs as macvtap devices to avoid potential connectivity issues.
  2. Continue setup in your Cloudflare dashboard.

Set up Cloudflare dashboard

Create a new profile

You need to create a profile for your appliance before connecting it to the Internet.

To create a profile:

  1. Go to the Connectors page. Go to Connectors ↗
  2. Go to the Appliances tab > Profiles > Create a new profile.
  3. In Name, enter a descriptive name for your Cloudflare One Virtual Appliance. Optionally, you can also add a description for it.
  4. You need to decide if you want to turn on high availability for the Cloudflare One Virtual Appliance. For details, refer to About high availability configurations.
  5. Select Create and continue.
  6. Select Add Appliance. This will display a list of devices associated with your account. For a Virtual Appliance to appear you need to:
  7. VMware: Have already obtained your OVA package and license keys if you are installing on VMware.
  8. Proxmox: Have already obtained your Virtual Appliance Script and license keys if you are installing on Proxmox. For details, refer to Configure a virtual machine and select the appropriate tab.
  9. If you have more than one Cloudflare One Virtual Appliance, choose the one that corresponds to the on-ramp you are creating. Cloudflare One Virtual Appliance devices are identified by a serial number, also known as a service tag. Use this information to choose the right Cloudflare One Virtual Appliance.
    Select Add Appliance when you are ready to proceed.
  10. Cloudflare One Virtual Appliance will be added to your account with an Interrupt window defined. The interrupt window is the time period when the Cloudflare One Virtual Appliance software can update, which may result in interruption to existing connections. You can change this later. Refer to Interrupt window for more details on how to define when the Cloudflare One Virtual Appliance can update its systems.
  11. Select Continue to proceed to creating your WAN and LAN networks.

Create a WAN

When you have more than one anycast IP configured in your account (set up during your Cloudflare WAN (formerly Magic WAN) onboarding), Cloudflare One Virtual Appliance will automatically create at most two tunnels per WAN port. This improves reliability and performance, and requires no additional configuration on your part.

  1. In WAN configuration, select Create. You can create one or more wide area networks (WANs) ↗︎. Configuring multiple WANs will create multiple IPsec tunnels (one IPsec tunnel per WAN port). This allows Cloudflare One Virtual Appliance to load balance traffic over WANs of equal priority. It also allows Cloudflare One Virtual Appliance to failover between circuits according to their health. Refer to WAN settings for more details. Note

This is not the same as a high availability (HA) configuration. HA configurations need two Cloudflare One Virtual Appliance devices to work. For details, refer to About high availability configurations. 2. In Interface name, enter a descriptive name for your WAN. 3. Interface number needs to correspond to the virtual network interface on the Virtual Appliance instance you have set up in VMware. Following our example from the previous steps, you need to choose port 1 since that is what corresponds to the eno1 port we set up in VMware. 4. In VLAN ID, enter a number between 0 and 4094 to specify a VLAN ID. 5. In Priority, choose the priority for your WAN. Lower numbers have higher priority. For details on how Cloudflare calculates priorities, refer to Traffic steering. 6. In Health check rate configure the health check frequency for your site. Options are low, mid, and high. For details, refer to Update tunnel health checks frequency. 7. Addressing: Select DHCP. This is needed the first time you set up your Cloudflare One Virtual Appliance to successfully download all settings to the machine and activate it. If you need a static IP address in your network environment: 1. Continue the set up flow to activate your Cloudflare One Virtual Appliance. 2. Refer to WAN with a static IP address. If you choose a static IP, you also need to specify the static IP and gateway addresses. 8. Select Save when you are finished.

Note

You will need your account ID and API token to use the API.

Make a POST request using the API to create a WAN.

The static_addressing object is optional. Omit it if you are using DHCP. If you are using static addressing, add the secondary_address parameter when your site is in high availability (HA) mode.

Example:

curl https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}/wans \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
    "name": "<YOUR_WAN_NAME>",
    "physport": 1,
    "priority": 0,
    "vlan_tag": 0
}'

Create a LAN

  1. In LAN configuration, select Create.
  2. Enter a descriptive name for your LAN in Interface name.
  3. Interface number needs to correspond to the virtual LAN interface on the Virtual Appliance instance you have set up in VMware. Following our example from the previous steps, you need to choose port 2 since that is what corresponds to the eno2 port we set up in VMware.
  4. In VLAN ID, specify a VLAN ID to create virtual LANs.
  5. In Static addressing > Static address give your Cloudflare One Virtual Appliance's LAN interface its IP address. You can also enable the following options if they suit your use case:
  6. This is a DHCP server: If your Cloudflare One Virtual Appliance is a DHCP server.
  7. This is a DHCP relay: If your Cloudflare One Virtual Appliance is a DHCP relay.
  8. (Optional) In Directly attached subnet > Static NAT prefix, enter a CIDR prefix to enable NAT (network address translation). The prefix you enter here should be the same size as the prefix entered in Static addressing. For example, both networks have a subnet mask of /24: 192.168.100.0/24 and 10.10.100.0/24.
  9. (Optional) If your LAN contains additional subnets behind a layer 3 router, select Add routed subnet under Routed subnets to add them:
  10. Prefix: The CIDR prefix for the subnet behind the L3 router.
  11. Next hop: The address of the L3 router to which the Cloudflare One Virtual Appliance should forward packets for this subnet.
  12. Static NAT prefix: Optional setting. If you want to enable NAT for a routed subnet, supply an "external" prefix for the overlay-facing side of the NAT to use. It must be the same size as Prefix.
    For details, refer to Routed subnets.
  13. Select Save.
  14. Select Done to finish your configuration. Tunnels and static routes will be automatically created for your Cloudflare One Virtual Appliance, once it boots up.