Windows Client ?
Remove tick in “Block Untunneled Traffic” (Kill-switch)
When ticked: ALL traffic goes through the tunnel when using 0.0.0.0/0, no exception.
When unticked, traffic for which a local route exists (like local network), gets preference before being sent through the tunnel.
@holvoetn - interesting, not sure what you are getting at ref windows and ticks, did you leave the windows open and ticks are getting inside your house???
This is simply a case of masked intentions.
We know the allowed IPs of 0.0.0.0/0 means internet access and to wireguard interfaces as well by default.
However we didnt know that at least for one of the peers the idea was to get off the wireguard train and not go to the internet.
SO at the wireguard server in France, whilst stuffing your face with a baguette virtually sadly…
you need to add ensure that the peer is allowed to the LAN subnet in question. LETS SAY 0.4 in your example…
I am assuming the default ROUTE created by the IP wireguard interface address will suffice for return traffic back to the client from these subnets. (DAC) dst-address=192.168.200.0/24 gateway=wireguard table=main
OP problem is not about what happens in France. It’s what happens in Iran.
Local traffic for local network needs to STAY there. Not go to France. That’s too late then.
So his client needs to be adjusted to do that.
If it’s a Windows client, disable the kill switch.
AND/OR (not sure how this logical operator needs to be set here …)
construct the allowed addresses in such a way that at the end ONLY those 2 subnets are NOT allowed to enter the tunnel (hence stay local). Not an easy task…
That’s how I understood the requirement. But it would help if the requirements were made a bit more clear using a bit more words…
Not sure what you are getting at…
But in this case the allowed IPs is 0.0.0.0/0 which means any public IP out there, plus the subnets he wants to reach at the French Server Site. In this case the subnets are included so no need to try and get overly fancy~!~
Its easy and it works AND NOT PRONE TO ERRORS in entry
Finally use firewall rules if necessary where applicable to ensure users coming through wireguard go to where they are supposed to go.
As stated previously use IP routes and blackhole to block outgoing internet traffic destined for non-public addresses!!!
Neat link though!! It would be more appropriate if the OP said I want to users to be able to access ONLY the following subnets and not all of them…
Can you come up with a better, clearer example of where this might be advantageous? I would like to add it to my wireguard article with such an example…
Perhaps in case its you who misunderstood then…
The OP wants to from his client peer laptop to connect to the server in France via wireguard.
He wants to access the internet through his connection to France (not locally) and in addition he wants to access some subnets existing off the mikrotik in France.
The reason for both of our confusion is that in his config for France he never put in those subnets so we didnt know they existed. Rather unfair if you ask me. /ip address
add address=xxx.xx2.230.10 interface=ether1 network=x.xx.65.254
add address=192.168.200.1/24 interface=wireguard network=192.168.200.0
where are they ???
++++++++++++++++++++++++++++++++++
If its the reverse he has not indicate a LOCAL OFFICE PEER, so if has one that is connecting to the SERVER in FRANCE, and if its a mikrotik device,
then he needs to come clean and give us that config as well. If its not a mikrotik device, then not our problem LOL…
OR thirdly
information left out and he is making assumptions we know whats going on without a network diagram or full knowledge.
xxx.xx2.230.10 is server address in France and x.xx.65.254 is the GW. 192.168.200.1/24 is the ip address for wiregaurd interface, i dont know its useful in my case or not