Skip to content

Commit 4a892ce

Browse files
committed
Fix hetzner vpc networking
1 parent d82a84e commit 4a892ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

terraform/hcloud-wireguard/main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,24 @@ resource "hcloud_network" "main" {
6666
name = "main"
6767
ip_range = "10.42.0.0/16"
6868

69+
# NOTE: Make sure to `ip route del 10.42.0.0/16 dev wg0` on the wg server.
70+
# The wireguard interface should only route traffic for the wireguard subnet.
6971
expose_routes_to_vswitch = true
7072
}
7173

7274
resource "hcloud_network_subnet" "robot" {
7375
network_id = hcloud_network.main.id
7476
type = "vswitch"
7577
network_zone = "eu-central"
76-
ip_range = "10.42.10.0/24"
78+
ip_range = "10.42.2.0/24"
7779
vswitch_id = "70675"
7880
}
7981

8082
resource "hcloud_network_subnet" "wg" {
8183
network_id = hcloud_network.main.id
8284
type = "cloud"
8385
network_zone = "eu-central"
84-
ip_range = "10.42.0.0/24"
86+
ip_range = "10.42.1.0/24"
8587
}
8688

8789
resource "hcloud_server" "wg" {
@@ -100,7 +102,7 @@ resource "hcloud_server" "wg" {
100102
}
101103
network {
102104
network_id = hcloud_network_subnet.wg.network_id
103-
ip = "10.42.0.10"
105+
ip = "10.42.1.10" # 10.42.1.10/24
104106
}
105107
}
106108

0 commit comments

Comments
 (0)