smartalock / wireguard-lwip

WireGuard Implementation for lwIP
Other
189 stars 27 forks source link

esp32 device as the vpn server #7

Open uGiFarukh opened 1 year ago

uGiFarukh commented 1 year ago

Hello,

Recently I have implemented this library for the esp32 using freertos. Wireguard tunnel seems to be working and handshakes are also working between peers. But somehow ping is not working from my windows wireguard to the esp32 peer. I am trying to allow traffic forwarding so that every traffic to the internet from my windows wireguard peer will go through the lwip wireguard interface. I am not sure how to achieve this. Any help would be highly appreciated.

Thanks.

Odysseusfr commented 1 year ago

Hello did you check your router firewall rules ? You can change some of your firewall rules by accessing to it on ssh or with a web interface, but the configuration of it depends of the device. It could also be your windows firewall which refused the icmps requests. I am trying to create a wireguard client on esp32 too, but I'm struggling with this library, could you help me with that ?

uGiFarukh commented 1 year ago

Hello did you check your router firewall rules ? You can change some of your firewall rules by accessing to it on ssh or with a web interface, but the configuration of it depends of the device. It could also be your windows firewall which refused the icmps requests. I am trying to create a wireguard client on esp32 too, but I'm struggling with this library, could you help me with that ?

Yes, both my router firewall and windows firewall is fully disabled. I have fully open network for testing purposes. Thank you though.

Please let me know exactly what you are struggling with, probably create another issue with some descriptions on your problem so that I can try to help.

Odysseusfr commented 1 year ago

Are you sure your peer configuration is good, with the allowed ips configured correctly (allowed ip for esp32 --> ip of windows) Did you set any route(s) on your router ?

uGiFarukh commented 1 year ago

Are you sure your peer configuration is good, with the allowed ips configured correctly (allowed ip for esp32 --> ip of windows) Did you set any route(s) on your router ?

peer handshakes are working perfectly fine. In the esp32 allowed ips I have the ip address of the windows peer. In the windows allowed ips I have 0.0.0.0/0 so that all traffic should forward through the tunnel. But it is not working as epxected. I do not have any routes set on my router. Not sure if I need any type of route configuration in router for wireguard as a vpn to work.

Odysseusfr commented 1 year ago

I am currently working with a router with no Firewall, and it works fine, i can ping it. Can you ping it outside of the tunnel, i mean, can you ping the real IPs addresses ?

uGiFarukh commented 1 year ago

I am currently working with a router with no Firewall, and it works fine, i can ping it. Can you ping it outside of the tunnel, i mean, can you ping the real IPs addresses ?

Yes, I can ping it outside of the tunnel with device ip addresses. But pinging inside the tunnel doesn't seem to work. Can you please share your wireguard configuration for both peers here?

Odysseusfr commented 1 year ago

No problem, there it is, the simplest configuration possible: client.txt server.txt

uGiFarukh commented 1 year ago

Still stuck on this issue. @smartalock can you please help on this?