Comments (2)
I am not sure yet, how useful it is to disable NAT.
I did some testing, and it is very useful. NAT is fine and easy to use, but it has some disadvantages:
1.) As peers are behind a NAT, they cannot be addressed from your network
2.) You don't know, from which peer a request originates, as the originating IP will always be the one of the LAN adapter, where the wireguard tunnel is running. This makes things simple, but prevents you to make clever access rules. e.g. you have a program, which allows access only from specific IP addresses (a VNC server perhaps?). Such a program will always see a request from the local LAN.
Using Windows' routing instead of NAT is fairly easy, but you need a "not completely cheap" router, which allows you to add a default route to your wireguard network.
First, you need to enable "packet forwarding" in Windows for both "wg_server" interface and your "LAN" interface. There are various methods how to do this, for simple testing this will do it:
netsh interface ipv4 set int "LAN-Connection" forwarding=enabled
netsh interface ipv4 set int "wg_server" forwarding=enabled
If wg_server interface has the correct IP, this is basically all you have to do on the Windows side.
The routing table is set up already to route from / to "wg_server" and "LAN-Connection".
If you have a router with a firewall, you will need to allow access to required services like DNS from the wireguard subnet.
But most important, you need to add a static route in your router acting as the default gateway of your LAN.
This route should specify the machine running the wireguard tunnel as a gateway to the wireguard subnet.
Once this is done, reply packets from your LAN subnet can find a way to the wireguard subnet.
This is a nice solution, especially with NAT being ... "difficult". Why NAT would require Hyper-V to be running really is beyond me. And a "Nat-less" solution simply looks cleaner in my opinion.
from wgserverforwindows.
It seems that there's a bug with the address field not being populated in the config.
If you manually add Address=192.168.170.1/24
under [Interface]
to server_wg\wg_server.conf
and reinstall the tunnel it should work.
from wgserverforwindows.
Related Issues (20)
- Is there a way to disable the wireguard server HOT 2
- Cannot access services on WireGuard server
- Call Server Status Display Directly HOT 1
- can't share internet
- [Proposal] Disabling and enabling wireguard server HOT 2
- Not working on 32bit Windows
- I'm so amazed I don't know what to say, this is god like. I want to donate HOT 2
- Enable Internet Sharing: An event was unable to invoke any of the subscribers (0x80040201) HOT 1
- Enable configuration of PersistentKeepalive in client configuration HOT 7
- It closes by itself after a while of not using it (Win11). HOT 3
- [Feature Request] Add a removal tool incase the tunnel is incorrectly installed HOT 4
- My server does not have NAT related functions here HOT 2
- [Feature Request] Server MTU Size setting
- route wireguard server hosts file HOT 1
- error
- What's the difference between clients_data/ and clients_wg/ directories? HOT 1
- Invalid class error after splash [already solved] HOT 2
- Client Connection HOT 1
- Enable NAT Failed
- Server keeps trying to handshake after client disconnects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wgserverforwindows.