Observations
1. Very good diagram example of a generic network, and I liked the separation using the black WG bubbles. It would have been preferential to have more LANs per router and perhaps a bit more detail for allowed IPs between them but still nice and clean.
2. You selected a coordinated IP address subnet for your peer wireguard interfaces, which reinforces your notion that an IP address for the wireguard interface is expected and a good thing.
3. The explanation, or more accurately the purpose of the paragraph starting with "
Regular routing and crypto routing are two distinct complementary things... and ending with ".
...happily ever after." was vague and weak. At first I thought you were trying to describe crypto routing and then realized you were just attempting to highlight the different effects on traffic between IP routing and Crypto Routing. This needed a bit more detail and clarity.
4. Personally I prefer to look at Crypto Processes as its own mini router (or Customs Booth if you will), and thus VERY conceptually (for the new beginner), gets user traffic from IP routing (payload), converts that to encrypted user traffic with RIGHT peer destination information (encrypted transport packet) and then back to IP routing for onward TX, and then the reverse happens at the other end. They work hand in hand to ensure the traffic gets to where it needs to be and thus both Route in their own way, and I view Crypto Routing as Crypto Steering or Marshaling because I get easily confused
when using the word Routing for different processes. But thats just me, it is crypto routing and I have no issues with how it works and what it does.
5. What the new person, beginner, should focus on is that Crypto Routing runs in the background and has to do mainly with two processes. However, for crypto routing to occur, it is the responsibility of the admin, to first accurately state the Allowed IPs for each peer (key word being peer=remote site). More specifically the admin should, at any local device, consider the Allowed IPs as they relate to the remote end for two distinct populations of addresses, a. the destination addresses at the remote end, for local users heading outbound and entering the tunnel, and b. the source addresses for users at the remote end, heading inbound and will be exiting the tunnel. Now that the Allowed IPs are correctly established by the admin, Crypto Routing can carry out its two integrated processes, and the really core bit uses the admin Allowed IPs to ensure the right peers and right keys are matched to the local traffic entering the tunnel so that the right destination information is added and subsequently at the other again compare peers and allowed IPs to ensure authorized traffic is allowed to exit the tunnel. The other process which occurs is the encryption and decryption (not as exciting). That is enough detail for the new beginner at the start of their journey. I added a bit more detail a few post before which adds the order of events involved (encryption, matching, selection, filtering etc.).
6. I liked the fact that you included the IP addresses of the other sites wireguard interfaces as part of the Allowed IPs. Did you do this to facilitate PING?
Or does this automatically ensure then that fragmentation issues are reported??? This question becomes clearer later!
7. I was disappointed you skipped an important step in your evolutionary process, namely this configuration, that you didnt put and was waiting to see. I am truly hoping I got the gateway IPs correct.
/ip route (at LANB)
add dst-address=10.0.1.0/24 gateway=172.16.0.1 table=main
add dst-address=10.0.3.0/24 gateway=172.16.0.3 table=main
8. Now you can tie in question 6, with the observation at 7. and my follow-on questions.
Q1 - If I have stated the IP routes as such, would I still need to include the IP addresses of the interfaces in the Allowed IPs, to PASSIVELY detect and report fragmentation issues???
Q2 - Are they linked? or is the Allowed IPs inclusion simply to facilitate the more ACTIVE ping test/troubleshooting.
9. I forget to mention in 6, that I liked how you used the subnet to describe the Allowed IPs for the IP wireguard addresses, such that in all cases only one entry need be made to cover all peers and thus every possible ping direction!
10. Then we get to the use of IP address for Wireguard, for the simple case, one mobile peer or perhaps 3 or 4, where they all have a faux address where we conveniently ensure their nomenclatures line up such that they can easily be described or captured within a subnet and then we provide an IP address for the Server WG interface that includes them. This shows some flexibility in your thinking on the use of IP address and that you do realize the practical effect that this causes DAC routes for those to be created on the Server device.
11. What is not clear to me yet, is how you can justify that usage but then not be consistent when the same could potentially be used for a subnet on a different peer, not an iphone - not a faux IP, but an MT device peer subnet. Somehow to you, the IP address on the phone is sufficiently different from a subnet on another MT Device such that you dont want to use an additional IP address line to also include this subnet - and yes one has to ensure there is no overlap or conflict with any other peers. I am still fuzzy on the distinction??
12. Now we get to - okay we can get away with using wg-interface, but if we do, then we lose something in the translation for Passive communications fragmentation reports etc... Here is where you propose Pref Source. I understand pref source, in that it will change the source IP of the payload to that suggested in this case you picked the LAN gateway 10.0.2.1. However this could be misleading. What if router A had 3 subnets...............?? What then?
In other words, the missing part of the equation here is that whatever pref-source you select IT HAS TO BE on the allowed IP list at the remote site. This wasnt explicitly stated and needs to be. With that wording, the reader can then go back to your example information and confirm YES, I see now that that pref- source is included in the allowed IPs at the other end, and thus will be allowed to exit the tunnel at the other end.
13. But then I get confused because it appears to me in your example the preferred source is the same as the source initiating the packets so what has been gained ?? Assuming preferred source changes the source of the payload from whatever it is to the preferred source IP. There is some nuance I am missing?? The source is A, and the preferred source is A? what is gained??
I think I am missing an important point here.
14. Another point of confusion with pref source, is this only for originating devices, traffic from local subnet heading outbound? What happens for the associated Return Traffic at the Server Side and the IP routes created there??
15. Lastly we get to the discussion of using wg-interface only with manual IP routes. It works but as you state is missing the Passive communications component and may not suffice for ACTIVE troubleshooting/pinging.
16. For ACTIVE pinging one can choose any existing Allowed IP for this purpose and if necessary identify an existing subnet at the other end and include this in local Allowed IPs, so that is easily accomplished without too much fuss.
17. For Passive communications, it seems you are saying the two ways to ensure this is done right but the over riding requirement is that:
AN IP address for the wireguard interface has to be present, as per your example, and needs to be a coordinated subnet between the peers.
Then one has two options:
a. use the correct gwy IP ADDRESS in the IP route OR
b. use wg-interface name WITH pref source!
18. In other words any time you deviate from some form of 17 (aka like 15) , the full breadth of possible communications between WG interfaces is not established.
Summary: The above represents what I got out of your post. Sorry I do not have the level of understanding of the others and thus cannot blindly accept stuff if not understanding how and why it functions.
Outstanding issues.
1. For me to understand Passive Communication (fragmentation or any other magic that happens automatically (passively) with the proper structure).
2. For you to explain why I cannot use multiple IP addresses for all my local Allowed IPs.
)))) but I can for single IP devices like Iphones.
3. To explain pref source explaining the purpose, as it looks like the source and source pref are no different in the example AND ALSO in terms of return traffic vice originating traffic, as it appears you only describe originating outbound ??
For example let me propose and addendum to your example. The PLUS lines are added to show what I would normally have done, and
based on your information would do in the future.
IP addresses associated with Wireguard on the devices.
Peer1 - iphone - 192.168.35.2/32
peer2 - laptop - 192.168.35.200/32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
peer3 - MT device client - 172.168.77.2/24 ( Subnet 10.10.10.0/24 needs to access server on Local Router subnet D)
peer4 - MT device client 172.168.77.3/24 (Subnent 10.20.10.10.0/24 needs to access server on Local Router subnet E)
Server- Local Router - 172.168.77.4/24
Allowed IPs Local Router
192.168.35.0/24 (handles both incoming peer 1 and peer 2 - using local Router internet and for peer 2, To be able to config the local router - so fw rules have to lineup)
10.10.10.0/24 (handles incoming subnet from peer3)
10.20.10.0/24 (handles incoming subnet from peer4)
+++++++++++++++++++++++++++++++++++++++++++
172.168.77.0/24 (ensures any device can ping any IP wireguard interface )
IP Routes Local Router
dst-address=192.168.35.0/24 gwy=192.168.35.1 table=main
dst-address=10.10.10.0/24 gwy=172.168.77.2 table=main
dst-address=10.20.10.0/24 gwy=172.168.77.3 table=main
IP Routes other peers
[peer3] dst-address=subnetD/24 gwy=172.168.77.4 table=main
[peer4] dst=address=subnetE/24 gwy=172.168.77.4 table=main
OR
Let say I add a second, IP address to the local router wireguard interface........
and this time lets use wg-interface for the gateway,
Server- Local Router - IP1 - 172.168.77.4/24 / IP2 - 192.168.35.1/24
IP Routes
(DAC) dst-address=192.168.35.0/24 gwy=wg-local table=main
dst-address=10.10.10.0/24 gwy=wg-local table=main pref source=??
dst-address=10.20.10.0/24 gwy=wg-local table=main pref-source=??
IP Routes other peers
[peer3] dst-address=subnetD/24 gwy=wg-peer3 table=main pref-source=10.10.10.1 ??
[peer4] dst=address=subnetE/24 gwy=wg-peer4 table=main pref-source=10.20.1.1 ??
What i find strange is that pref source is already the source IP, the source packets from peer 3 are from subnet 10.10.10.0/24, the source packets from peer 4 are already from 10.20.10.0/24 ??