I have setup site2site VPN via wireguard, here is what i can achieve:
1. I can only ping router 2 from router1's interface and vice versa.
What i have been unable to achieve:
1. Cannot reach internal LAN devices from either side i.e from router1, i cannot reach devices in the LAN of router 2 and vice versa
I would like to be able to reach devices on both ends.
Below are my configs:
Router1:
Code: Select all
# jun/09/2023 12:17:04 by RouterOS 7.9.2
# software id = 141B-TTYI
#
# model = RB951G-2HnD
# serial number = XXXXXXX
/interface bridge
add admin-mac=xxxxx auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
disabled=no distance=indoors frequency=auto installation=indoor mode=\
ap-bridge ssid=XXXXX wireless-protocol=802.11
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguardVPN_to_Bandari
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=\
dynamic-keys supplicant-identity=MikroTik
/ip ipsec peer
add address=xx.xxxx.xxx.xx/32 exchange-mode=ike2 name="XXXXXi"
add address=xx.90.xxx.xx/32 exchange-mode=ike2 name=XXXX
add address=xx.72.xxxx.xxx/32 exchange-mode=ike2 name=XXX
/ip ipsec profile
set [ find default=yes ] dh-group=modp2048 enc-algorithm=aes-256 \
hash-algorithm=sha256
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc \
pfs-group=modp2048
/ip pool
add name=dhcp ranges=192.168.170.10-192.168.170.254
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
/interface bridge port
add bridge=bridge comment=defconf ingress-filtering=no interface=ether2
add bridge=bridge comment=defconf ingress-filtering=no interface=ether3
add bridge=bridge comment=defconf ingress-filtering=no interface=ether4
add bridge=bridge comment=defconf ingress-filtering=no interface=ether5
add bridge=bridge comment=defconf ingress-filtering=no interface=wlan1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
set auth=sha1,md5
/interface wireguard peers
add allowed-address=10.10.10.0/30,192.168.172.0/24 endpoint-address=\
41.90.248.49 endpoint-port=13231 interface=wireguardVPN_to_Bandari \
persistent-keepalive=10s public-key=\
"publickey"
/ip address
add address=192.168.170.1/24 comment=defconf interface=bridge network=\
192.168.170.0
add address=10.10.10.1/30 interface=wireguardVPN_to_Bandari network=\
10.10.10.0
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=192.168.170.0/24 comment=defconf dns-server=192.168.170.1 \
gateway=192.168.170.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.170.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input dst-port=13231 protocol=udp src-address=\
41.90.248.49
add action=accept chain=forward dst-address=192.168.170.0/24 src-address=\
192.168.172.0/24
add action=accept chain=forward dst-address=192.168.172.0/24 src-address=\
192.168.170.0/24
add action=accept chain=input comment="For Winbox Access" dst-address=\
192.168.170.0/24 dst-port=8291 protocol=tcp src-address=192.168.1.0/24
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=accept chain=srcnat disabled=yes dst-address=192.168.170.0/24 \
src-address=192.168.172.0/24
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip ipsec identity
add peer=xxx
add peer="xxxxx"
add peer=xxxx
/ip ipsec policy
add dst-address=192.168.1.0/24 peer=xxxx src-address=192.168.170.0/24 tunnel=\
yes
add dst-address=192.168.171.0/24 peer="xxxxxx" src-address=\
192.168.170.0/24 tunnel=yes
add dst-address=192.168.172.0/24 peer=xxxx src-address=192.168.170.0/24 \
tunnel=yes
/ip route
add disabled=no dst-address=192.168.172.0/24 gateway=10.10.10.2 \
routing-table=main suppress-hw-offload=no
/system clock
set time-zone-name=Africa/Nairobi
/system identity
set name="xxxxxx"
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Code: Select all
# jun/09/2023 12:22:13 by RouterOS 7.9.2
# software id = 645K-5L30
#
# model = RB951Ui-2HnD
# serial number = xxxxx
/interface bridge
add admin-mac=xxxxxx auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
disabled=no distance=indoors frequency=auto installation=indoor mode=\
ap-bridge ssid=Pharmaplus wireless-protocol=802.11
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard_to_Nyali
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk group-ciphers=\
tkip,aes-ccm mode=dynamic-keys supplicant-identity=MikroTik \
unicast-ciphers=tkip,aes-ccm
/ip ipsec peer
add address=xxxxxx/32 exchange-mode=ike2 name=\
"xxxxxxxx"
add address=xxxxxxx/32 exchange-mode=ike2 name="xxxxxxx"
add address=xxxxxx/32 exchange-mode=ike2 name=xxxxx
/ip ipsec profile
set [ find default=yes ] dh-group=modp2048 enc-algorithm=aes-256 \
hash-algorithm=sha256
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc \
pfs-group=modp2048
/ip pool
add name=dhcp ranges=192.168.172.10-192.168.172.254
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
/interface bridge port
add bridge=bridge comment=defconf ingress-filtering=no interface=ether2
add bridge=bridge comment=defconf ingress-filtering=no interface=ether3
add bridge=bridge comment=defconf ingress-filtering=no interface=ether4
add bridge=bridge comment=defconf ingress-filtering=no interface=ether5
add bridge=bridge comment=defconf ingress-filtering=no interface=wlan1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
set auth=sha1,md5
/interface wireguard peers
add allowed-address=10.10.10.0/30,192.168.170.0/24 endpoint-address=\
197.232.146.177 endpoint-port=13231 interface=wireguard_to_Nyali \
persistent-keepalive=10s public-key=\
"publickey2"
/ip address
add address=192.168.172.1/24 comment=defconf interface=bridge network=\
192.168.172.0
add address=10.10.10.2/30 interface=wireguard_to_Nyali network=10.10.10.0
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=192.168.172.0/24 comment=defconf gateway=192.168.172.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.172.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input dst-port=13231 protocol=udp src-address=\
197.232.146.177
add action=accept chain=input dst-address=192.168.172.0/24 dst-port=8291 \
protocol=tcp src-address=192.168.1.0/24
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
add action=accept chain=forward dst-address=192.168.172.0/24 src-address=\
192.168.170.0/24
add action=accept chain=forward dst-address=192.168.170.0/24 src-address=\
192.168.172.0/24
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip ipsec identity
add peer="xxxxx"
add peer="xxxxx"
add peer=xxxx
/ip ipsec policy
add dst-address=192.168.160.0/24 peer="xxxxx" src-address=\
192.168.172.0/24 tunnel=yes
add dst-address=192.168.170.0/24 peer="xxxxx" src-address=\
192.168.172.0/24 tunnel=yes
add dst-address=192.168.1.0/24 peer=xxxx src-address=192.168.172.0/24 tunnel=\
yes
/ip route
add disabled=no dst-address=192.168.170.0/24 gateway=10.10.10.1 \
routing-table=main suppress-hw-offload=no
/system clock
set time-zone-name=Africa/Nairobi
/system identity
set name="xxxxxx"
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN