File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
terraform/hcloud-wireguard Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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
7274resource "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
8082resource "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
8789resource "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
You can’t perform that action at this time.
0 commit comments