
< /p>
Как вы можете видеть на рисунке, я хотел, чтобы моя Homelab была доступна и трафик перенаправлялся с помощью Wireguard. «Перенаправление трафика» работает на 100 %, но я не могу выполнить ping или подключиться по SSH к лучу.
Я боролся с этим пару дней, принимая любые новые входные данные. Вот мои конфиги:
Клиент:
[Interface]
PrivateKey = PRIVATE_CLIENT
Address = 10.0.0.1/24 # , fd10:0:0:1::1/64
ListenPort = 443
MTU = 1380
[Peer]
AllowedIPs = 0.0.0.0/0 , ::/0 #all traffic
PublicKey = PUBLIC_HOP
PresharedKey = PRESHARE1
Endpoint = PUBLIC_IP_HOP:443
PersistentKeepAlive = 25
Хоп:
[Interface]
PrivateKey = PRIVATE_HOP
Address = 10.0.0.2/24 #, fd10:0:0:3::1/64
ListenPort = 443
Table = 123
# IPv4 forwarding & routing
PreUp = sysctl -w net.ipv4.ip_forward=1
PreUp = ip rule add iif midhop table 123 priority 456
PostDown = ip rule del iif midhop table 123 priority 456
[Peer]
PublicKey = PUBLIC_CLIENT
AllowedIPs = 10.0.0.1/24 #, fd10:0:0:1::/64
PresharedKey = PRESHARE1
[Peer]
PublicKey = PUBLIC_SPOKE
AllowedIPs = 0.0.0.0/0 , ::/0
Говорил:
[Interface]
PrivateKey = PRIVATE_SPOKE
Address = 10.0.0.3/24 #, fd10:0:0:2::1/64
ListenPort = 443
MTU = 1380
# IPv4 forwarding
PreUp = sysctl -w net.ipv4.ip_forward=1
# IPv4 masquerading
# This is what I was doing originally
#PostUp = iptables -A FORWARD -i wg_us -j ACCEPT; iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
#PostDown = iptables -D FORWARD -i wg_us -j ACCEPT; iptables -t nat -D POSTROUTING -o eno1 -j MASQUERADE
#PostUp = ip route add 10.0.0.0/24 dev wg_us
# Futile attempt to try and make loopback interface(and therefore the spoke ip) accessible.
PostUp = iptables -A FORWARD -i wg_us -j ACCEPT; iptables -t nat -A POSTROUTING -o lo -j MASQUERADE
PostDown = iptables -D FORWARD -i wg_us -j ACCEPT; iptables -t nat -D POSTROUTING -o lo -j MASQUERADE
#VPS US
[Peer]
AllowedIPs = 10.0.0.0/24 #, fd10::/56
PublicKey = PUBLIC_HOP
Endpoint = PUBLIC_IP_HOP:443
PersistentKeepalive = 25
Подробнее здесь: https://stackoverflow.com/questions/791 ... into-spoke