feat: rebranded from vpn-router to linux-manager.
This commit is contained in:
1 parent
8efe21bfa6
commit
85a1ffa21f
238 files changed
+5010
-3761
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# GCP example
|
||||
|
||||
Deploys `vpn-router` on a GCE instance: a two-NIC router (external/WAN and internal/protected,
|
||||
Deploys `linux-manager` on a GCE instance: a two-NIC router (external/WAN and internal/protected,
|
||||
each its own VPC network), a demo protected `workload` subnet in the internal network routed
|
||||
through it, and cloud-init that installs and configures the package on first boot. See the
|
||||
repository's top-level [README](../../README.md) for what the package itself does, and
|
||||
@@ -11,9 +11,9 @@ repository's top-level [README](../../README.md) for what the package itself doe
|
||||
- A GCP project and credentials Terraform can pick up (`gcloud auth application-default login`
|
||||
or a service account).
|
||||
- An SSH key pair for `admin_ssh_public_key`.
|
||||
- A build of the `vpn-router` package published to the repository at `repo_url` (default: the
|
||||
- A build of the `linux-manager` package published to the repository at `repo_url` (default: the
|
||||
project's Gitea Debian registry). See [../../debian-package](../../debian-package) for
|
||||
`build.sh`/`publish.sh`. That repository must allow anonymous reads, since the router pulls
|
||||
`build.sh`/`publish.sh`. That repository must allow anonymous reads, since the server pulls
|
||||
the package with no credentials configured.
|
||||
|
||||
## Usage
|
||||
@@ -25,7 +25,7 @@ export TF_VAR_psk='change-me' # keep secrets out of tracked files
|
||||
```
|
||||
|
||||
`platform = gcp` and `mode = auto` are hard-coded into the cloud-init template call in
|
||||
`router.tf`: the router has exactly two NICs, and on GCP the system default route always goes
|
||||
`router.tf`: the server has exactly two NICs, and on GCP the system default route always goes
|
||||
out NIC0 (the external one here) while a secondary NIC only reaches its own subnet unless
|
||||
policy-routed - exactly the case `mode = auto` is designed to detect reliably. See the
|
||||
top-level README's "What mode decides" section.
|
||||
@@ -39,10 +39,10 @@ needs no separate subnet association - the route in `internal` already covers bo
|
||||
|
||||
```sh
|
||||
ssh <admin_username>@$(terraform output -raw router_public_ip)
|
||||
systemctl status vpn-router-setup
|
||||
systemctl status linux-manager-setup
|
||||
swanctl --list-sas
|
||||
```
|
||||
|
||||
Set `deploy_workload_vm = true` and re-apply to add a VM on the `workload` subnet (no public
|
||||
IP - reach it via the router or IAP) for confirming that its traffic to `remote_cidrs` actually
|
||||
flows through the router.
|
||||
IP - reach it via the server or IAP) for confirming that its traffic to `remote_cidrs` actually
|
||||
flows through the server.
|
||||
@@ -1,9 +1,9 @@
|
||||
output "router_public_ip" {
|
||||
description = "Public IP address of the router VM."
|
||||
description = "Public IP address of the server VM."
|
||||
value = google_compute_address.ext.address
|
||||
}
|
||||
|
||||
output "router_internal_ip" {
|
||||
description = "Private IP address of the router's internal NIC - the next hop to use in routes configured outside this Terraform run (another route, or an on-prem device) that need to reach remote_cidrs through this router."
|
||||
description = "Private IP address of the server's internal NIC - the next hop to use in routes configured outside this Terraform run (another route, or an on-prem device) that need to reach remote_cidrs through this router."
|
||||
value = google_compute_instance.router.network_interface[1].network_ip
|
||||
}
|
||||
@@ -12,9 +12,11 @@ locals {
|
||||
repo_gpg_key = data.http.repo_gpg_key.response_body
|
||||
ubuntu_codename = var.ubuntu_codename
|
||||
|
||||
# Contents of /etc/vpn-router/vpn-router.json.
|
||||
# Contents of /etc/linux-manager/linux-manager.json.
|
||||
config = {
|
||||
general = { platform = "gcp", mode = "auto" }
|
||||
router = { enabled = true }
|
||||
vpn = { enabled = true }
|
||||
wan = { local_fqdn = var.local_fqdn }
|
||||
local = { cidrs = local.local_cidr_list }
|
||||
site_to_site = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
project_id = "vpn-router-poc"
|
||||
project_id = "linux-manager-poc"
|
||||
region = "europe-central2"
|
||||
zone = "europe-central2-a"
|
||||
name = "vpn-router-example"
|
||||
name = "linux-manager-example"
|
||||
admin_ssh_public_key = "ssh-ed25519 AAAA... you@example.com"
|
||||
|
||||
local_fqdn = "router.example.com"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
project_id = "my-gcp-project"
|
||||
region = "europe-central2"
|
||||
zone = "europe-central2-a"
|
||||
name = "vpn-router-example"
|
||||
name = "linux-manager-example"
|
||||
admin_ssh_public_key = "ssh-ed25519 AAAA... you@example.com"
|
||||
|
||||
local_fqdn = "router.example.com"
|
||||
|
||||
+12
-12
@@ -16,13 +16,13 @@ variable "zone" {
|
||||
variable "name" {
|
||||
description = "Base name used to derive resource names."
|
||||
type = string
|
||||
default = "vpn-router-example"
|
||||
default = "linux-manager-example"
|
||||
}
|
||||
|
||||
variable "admin_username" {
|
||||
description = "Admin username created on both VMs via SSH key metadata."
|
||||
type = string
|
||||
default = "vpnrouter"
|
||||
default = "linuxmanager"
|
||||
}
|
||||
|
||||
variable "admin_ssh_public_key" {
|
||||
@@ -31,18 +31,18 @@ variable "admin_ssh_public_key" {
|
||||
}
|
||||
|
||||
variable "machine_type" {
|
||||
description = "Machine type for the router."
|
||||
description = "Machine type for the server."
|
||||
type = string
|
||||
default = "e2-small"
|
||||
}
|
||||
|
||||
variable "local_fqdn" {
|
||||
description = "FQDN of the router, used as the IKE identity and, when dns_managed_zone is set, as the name of the A record created for it."
|
||||
description = "FQDN of the server, used as the IKE identity and, when dns_managed_zone is set, as the name of the A record created for it."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "dns_managed_zone" {
|
||||
description = "Name of an existing Cloud DNS managed zone to create local_fqdn's A record in, pointing at the router's public IP. local_fqdn must be a name within that zone's DNS name. Leave empty to skip - local_fqdn is then just a label with nothing making it resolve."
|
||||
description = "Name of an existing Cloud DNS managed zone to create local_fqdn's A record in, pointing at the server's public IP. local_fqdn must be a name within that zone's DNS name. Leave empty to skip - local_fqdn is then just a label with nothing making it resolve."
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
@@ -129,37 +129,37 @@ variable "wireguard_listen_port" {
|
||||
}
|
||||
|
||||
variable "deploy_workload_vm" {
|
||||
description = "Deploy a bare VM on the workload subnet, for manually verifying routing through the router."
|
||||
description = "Deploy a bare VM on the workload subnet, for manually verifying routing through the server."
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "repo_url" {
|
||||
description = "Base URL of the Debian package repository the router pulls vpn-router from."
|
||||
description = "Base URL of the Debian package repository the server pulls linux-manager from."
|
||||
type = string
|
||||
default = "https://gitea.koszewscy.waw.pl/api/packages/koszewscy/debian"
|
||||
}
|
||||
|
||||
variable "ubuntu_codename" {
|
||||
description = "Ubuntu release codename of the router VM's image, used to select the apt repo component."
|
||||
description = "Ubuntu release codename of the server VM's image, used to select the apt repo component."
|
||||
type = string
|
||||
default = "noble"
|
||||
default = "resolute"
|
||||
}
|
||||
|
||||
variable "ext_subnet_cidr" {
|
||||
description = "CIDR of the router's external (WAN-facing) subnet, in its own VPC network."
|
||||
description = "CIDR of the server's external (WAN-facing) subnet, in its own VPC network."
|
||||
type = string
|
||||
default = "10.0.1.0/24"
|
||||
}
|
||||
|
||||
variable "int_subnet_cidr" {
|
||||
description = "CIDR of the router's internal (protected-network-facing) subnet, in its own VPC network."
|
||||
description = "CIDR of the server's internal (protected-network-facing) subnet, in its own VPC network."
|
||||
type = string
|
||||
default = "10.0.2.0/24"
|
||||
}
|
||||
|
||||
variable "workload_subnet_cidr" {
|
||||
description = "CIDR of the demo protected workload subnet, in the same VPC network as int_subnet_cidr and routed through the router."
|
||||
description = "CIDR of the demo protected workload subnet, in the same VPC network as int_subnet_cidr and routed through the server."
|
||||
type = string
|
||||
default = "10.0.3.0/24"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bare VM on the workload subnet, for manually verifying that its traffic to
|
||||
# remote_cidrs flows through the router. Off by default so a plain apply
|
||||
# stays to just the router.
|
||||
# remote_cidrs flows through the server. Off by default so a plain apply
|
||||
# stays to just the server.
|
||||
|
||||
resource "google_compute_instance" "workload" {
|
||||
count = var.deploy_workload_vm ? 1 : 0
|
||||
|
||||
Reference in new issue
Block a user