adrianmihalko / raspberrypiwireguard

Install and configure WireGuard on Raspberry Pi (and others)
840 stars 77 forks source link

Local network not accessible but 192.168.99.1/2 is #18

Open septeven opened 5 years ago

septeven commented 5 years ago

Hi, I installed wireguard on my pi zero in order to access my Home Assistant system when I'm away. I followed your instruction as well as DrZz's video.

After having set up everything, I was able to ping to 192.168.99.1 and 192.168.99.2 from iphone/pi zero but wasn't able to ping anything else of my local network nor access it by any way.

I found on a forum this command sudo iptables -t nat -A POSTROUTING -o $DEVICENAME -j MASQUERADE (where $DEVICENAME is the name of the interfaces you'd like packets to be forwarded through)

I tried it with wlan0 as DEVICENAME - that worked, I was able to access my local network. As I am not an expert in term of networking, I must confess that I don't really know what this command is for ? I decided to give a try and put wg0 instead of wlan0 as DEVICENAME and... it worked too....

So now, I just don't know how should I set up this ? wlan0, wg0 ?? I don't want to make a bad choice which will result in a security problem. I didn't find any details regarding this in your instructions so hopefully you'll be able to help.

Thanks.

septeven commented 5 years ago

Hi, Any help will be very appreciated. Since my intial message, I have noticed that the command I used (sudo iptables ...) didn't work anymore - I mean it keeps working during a few days, and then, I can't access again to my local network and I have to execute the command again.

This is definitely not the best way to do, and I'm sure I'm missing something but again your instructions didn't mention anything similar of what I'm experiencing.

Hopefully, you'll be able to help. Thanks