burghardt / easy-wg-quick

Creates Wireguard configuration for hub and peers with ease
GNU General Public License v2.0
1.01k stars 108 forks source link

Multihomed gateway #129

Closed grebnebo closed 7 months ago

grebnebo commented 7 months ago

Hello. Great toolkit, but i have some problem with routing setup in multihomed environment i've got 3 interfaces ens160,ens192,wghub on server ens160 is internal : 10.40.0.15/24 ens192 is external: 99.x.x.x/29 wgub is 10.87.123.1/24

when i connect to external ip, i cannot ping internal ip address subnet, only 10.40.0.15 (the local ip of ens160), but not 10.40.0.11 for example. how can i make routing between 10.40.0.11 <> 10.40.0.15 <> 10.87.123.11 <> - 99.x.x.x/29?

grebnebo commented 7 months ago

i've added some changes to wghub.conf: two lines with ens160 - local interface, and everythings working now as expected. i can go to internal_host1 <> wireguard_gw <> me `PostUp = iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o ens192 -j TCPMSS --clamp-mss-to-pmtu

PostUp = iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE PostUp = iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o ens160 -j TCPMSS --clamp-mss-to-pmtu

PostUp = iptables -t nat -A POSTROUTING -o ens160 -j MASQUERADE `