SOLUTION METHOD 3 - VXLAN OVER WIREGUARD TUNNEL
a. create wireguard connectivity as per normal and then
b. create the VXLAN tunnel within the WG tunnel ( vxlan never concerns its self with local WANIPs at either end )
c. modify configs to avoid L2 conflicts with identical subnets.
For those not familiar with VxLAN, it's an tunneling protocol which wraps layer 2 frame into a UDP packet at layer 3.
Diagram courtesy of Charles D.
...
vxlan.JPG
...
SCENARIO, Span subnet like EOIP over two separate locations.
Facts:
VLAN B - LANB on R1 where unifB controller resides and LANB on R2 where two unifi APs reside AP1-B and AP2-B
It is thought (
but not verified) that the underlying Network (in this case Wireguard) should have a higher MTU (min 1522, we will use
1550)
SO in our example we are going to create one vxlan tunnel between VLAN B on R1 to VLAN B on R2.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
a. setup the wg tunnel
/MT Device One info
/interface wireguard
listening port 15551 mtu=1550 name=wireguard-home
/interface wireguard peers
add allowed-address=192.168.50.2, interface=wireguard-home public-key="---" comment=Router2
add allowed address=192.168.50.3 interface=wireguard-home public0key="---" comment=remoteAdmin
/ip address
add address=192.168.50.1/24 interface=wireguard-home
/MT Device Two
/interface wireguard
listening port 10771 mtu=1550 name=wireguard-client
/interface wireguard peers
add allowed-address=192.168.50.0/24, endpoint-address=mynetnameMTDEVICEONE endpoint-port=15551 \
interface=wireguard-client public-key="..." persistant keep-alive=35sec
/ip address
add address=192.168.50.2/24 interface=wireguard-client
b. Now lets construct the vxlan tunnel
R1 VLAN B - 192.168.2.0/24 , unifi controller = 192.168.2.15,
R2 VLAN B - 192.168.2.0/24 , unifi APs AP1-B = 192.168.2.25 AP2-B = 192.168.2.35
VLANx Settings
Step1:Assign vxlan interface name.
R1: Interface name=ConrollerB
R2: Interface name=AP-B
Step2:Allocate VTEP to the underlying structure
R1: VTEP --> interface=ControllerB remoteIP=192.168.50.2 { since the remote IP wireguard address of R2 is 50.2 }
R2: VTEP --> interface=AP-B remoteIP=192.168.50.1 { since the remote IP wireguard address of R1 is 50.1 }
Step3:Assign vxlan parameters as required. The first iteration of this solution will be to span the same subnet.
R1 (interface ControllerB) --> vni=1001 port=9472
R2 (interface AP-B) --> vni=1001 port=9472
Add both vxlan interfaces to the single bridge on each router and connect/associate to the applicable VLAN interface.
R1
/interface bridge port
add bridge=bridge interface=ControllerB pvid=20
/interface bridge vlan
add bridge=bridge tagged=bridge untagged=ControllerB vlan-ids=20
Note: Tagged or Untagged works but if one can save the overhead of 4 bytes, one pays less carbon tax.
R2
/interface bridge port
add bridge=bridge interface=AP-B pvid=20
/interface bridge vlan
add bridge=bridge tagged=bridge untagged=AP-B vlan-ids=20
c.
PROBLEM:H
OW TO DECONFLICT SAME L2 SUBNET in TWO ROUTERS.
Solution Part 1:
VLAN20
R1 ip pool = 192.169.2.2-192.168.2.100
R1 ip address = 192.168.2.1 interface=vlan20 network=192.168.2.0
R2 ip pool = 192.169.2.120-192.168.2.220
R2 ip address = 192.168.2.254 interface=vlan20 network=192.168.2.0
Solution Part 2:
Bridge
R1 /interface bridge --> name=bridge vlan-filtering=yesdhcp-snooping=yes
R1 /interface bridge ports ---> add bridge=bridge interface=local port/wlantrusted=yes
R1 /interface bridge ports ---> add bridge=bridge interface=Controller-Btrusted=no
R2 /interface bridge --> name=bridge vlan-filtering=yesdhcp-snooping=yes
R2 /interface bridge ports ---> add bridge=bridge interface=local port/wlantrusted=yes
R2 /interface bridge ports ---> add bridge=bridge interface=AP-Btrusted=no
In effect, we ensure different address and gateway for the same subnet/vlan so that there is no issue with which Router is used for internet traffic.
We ensure that we keep the internet traffic of the local subnet via the local WAN.
确保没有possib桥设置ility of conflict with DHCP assignments between the two subnets connected over the vxlan tunnel.
You do not have the required permissions to view the files attached to this post.