blob: fa94c2222940a230406615bb1bebe82f5bc6fad2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
# VyOS High Availability (HA) Deployment on Azure
This document describes how to deploy VyOS in a High Availability (HA) configuration on Azure using Terraform and Azure Route Server to provide sub-second failover.
## Why Use HA on Azure?
This module provides a robust, repeatable foundation for building **resilient network architectures** in Azure. By combining VyOS routing features with Terraform and Azure-native services, it enables:
- Rapid deployment of cloud edge routers.
- Full control over BGP route advertisement and filtering.
- Realistic HA and disaster recovery simulations.
- Seamless integration with hybrid or multi-cloud infrastructure.
The architecture includes:
- Two VyOS routers in a Transit VNet, configured with BGP.
- Azure Route Server for dynamic route distribution.
- Site-to-Site VPN connections to a simulated on-premises VyOS router.
- An Ubuntu VM for connectivity and routing validation.
- A Data VNet for testing and diagnostics.
## Key Features
- **High Availability**: Dual VyOS routers for redundancy and failover.
- **Dynamic Routing**: BGP-based routing via Azure Route Server.
- **Hybrid Connectivity**: Site-to-Site VPN integration with a simulated on-prem VyOS.
- **Testing Environment**: Includes Ubuntu VM for verification and diagnostics.
- **Modular & Flexible**: Easily configurable via variables.
## HA Architecture Diagram
:::{figure} /_static/images/cloud-azure-ha-architecture.png
:alt: VyOS HA topology diagram
:::
This deployment architecture simulates a real-world enterprise network scenario for testing and validation purposes.
## Terraform Automation
To streamline and standardize the process, we developed a Terraform project that automates the deployment of VyOS in High Availability (HA) mode on Azure.
This Terraform project automates the deployment of:
- Two VyOS instances in HA mode.
- Azure Route Server.
- A Transit VNet and a Data VNet containing a test Ubuntu VM for connectivity validation.
## Prerequisites
Ensure you have:
- Active Azure subscription:
```none
az account set --subscription "<subscription ID or name>"
```
- Azure CLI installed:
<https://learn.microsoft.com/en-us/cli/azure/install-azure-cli>
- Logged in with Azure credentials:
```none
az version
az login
```
- Azure Resource Group (RG) created:
```none
az group create --name demoResourceGroup --location westus
az group list
az group show --name demoResourceGroup
```
- Terraform installed:
<https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli>
- SSH key generated:
```none
ssh-keygen -t rsa -b 4096 -f keys/vyos_custom_key.pem
chmod 400 keys/vyos_custom_key.pem
```
## Usage
All variables are defined in `variables.tf`. Adjust them to match your environment.
Terraform Workflow:
```none
terraform init
terraform fmt
terraform validate
terraform plan
terraform apply
```
On completion, run:
```none
terraform output
```
This displays the management IP and connectivity test results.
To clean up:
```none
terraform destroy
```
## Management
SSH into VyOS:
```none
ssh adminuser@<vyos_public_ip> -i keys/vyos_custom_key.pem
```
## GitHub Repository
You can clone or download the Terraform project and use them in your environment:
<https://github.com/vyos/vyos-automation/tree/main/Terraform/Azure/azure-ha-deployment-with-configs>
|