runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
945 stars 132 forks source link

Unable to resolve server vpn #22

Closed martinorob closed 5 years ago

martinorob commented 5 years ago

HI, i have installed on DS1515+ and works well except for one thing

My NAS have this ip 192.168.3.40

This is the /etc/wireguard/wg0.conf

[Interface] Address = 192.168.3.200/24 PrivateKey = myprivatekey ListenPort = 16666 PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o bond0 -j MASQUERADE

[Peer]

macOS client

PublicKey = publickey PresharedKey = preshared AllowedIPs = 192.168.3.201/32

wg-quick up wg0

[#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip address add 192.168.3.200/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] ip route add 192.168.3.202/32 dev wg0 [#] ip route add 192.168.3.201/32 dev wg0 [#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

VPN start and working but if I ping mynas.publicip.com it resolve as 192.168.3.40 and doesn't works. if I ping 192.168.3.200 it works. (but I use https with name so I need it resolve as 3.40).

May some one which is the problem? Thanks

martinorob commented 5 years ago

solved

runfalk commented 5 years ago

Would you mind sharing your solution (in case someone finds this later on Google)?

rikroe commented 4 years ago

Hey @martinorob could please share your solution? I'm having the same issue :(

martinorob commented 4 years ago

[Interface] Address = IP/SUBNETMASK PrivateKey = KEY ListenPort = PORT PostUp = sysctl -w net.ipv4.ip_forward=1 PostUp = sysctl -w net.ipv6.conf.all.forwarding=1 PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o ovs_bond0 -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o ovs_bond0 -j MASQUERADE

Hope it helps