Hello mikrotik community,
I'm a new user on mikrotik and i'm trying to configure a wireguard tunnel between two mikrotik routers, bellow the context of this setup :
on Router mikrotik A :
- inet <=[PUBLIC IPV4]Fibre Modem <=(eth0) ISP Router with a private network 192.168.1.1/24 <= (eth1) Mikrotik router A connected with private IP 192.168.1.2 through a bridge-lan
- i had set a private network for wireguard 10.0.0.0/24, on the router mikrotik A, wireguard interface is using the address : 10.0.0.1
on Router mikrotik B :
- inet <= [PUBLIC CGNAT IPV4] (lte0 USB Tethering) Mikrotik router B
- i had set a private network for wireguard 10.0.0.0/24, wireguard interface is using the address : 10.0.0.2
- i had also set a private wlan network on 10.2.2.0/24 which will be used by clients connected to wireless ap
the wireguard tunnel between mikrotik A and B is up and it's working
i can connect using a test laptop on the network 10.2.2.0/24 :
- ping 10.0.0.1 => OK
- ping 192.168.1.1 => ping OK which is the ip address of the ISP router on mikrotik A side
- nslookup google.com => OK
- ping google.fr => NOK (the request is routed to the interface lte instead of wireguard interface...)
i can also use a dns relay 192.168.1.1 to resolve nameserver... (nslookup google.fr gives me a feedback from 192.168.1.1).
how can i force users connected to 10.2.2.0/24 network to use inet (PUBLIC IPV4) on mikrotik A side....??
bellow you'll find export of mikrotik A & B confs :
Thank you very much for your help ![]()
Mikrotik A confs :
RouterOS 7.12.1
model = RB952Ui-5ac2nD
/interface bridge
add admin-mac=78:9A:18:4F:74:84 auto-mac=no name=bridge-lan
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
/interface wireguard
add listen-port=51820 mtu=1420 name=wireguard-site-a
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk mode=dynamic-keys name=ep_remote_access
supplicant-identity=""
/interface wireless
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=
20/40/80mhz-eCee frequency=5520 mode=ap-bridge security-profile=
ep_remote_access ssid=wlan1_limited_access wps-mode=disabled
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/interface bridge port
add bridge=bridge-lan interface=ether1
add bridge=bridge-lan interface=ether2
add bridge=bridge-lan interface=ether3
add bridge=bridge-lan interface=ether4
add bridge=bridge-lan interface=ether5
add bridge=bridge-lan interface=wlan1
add bridge=bridge-lan interface=wlan2
/interface wireguard peers
add allowed-address=0.0.0.0/0,::/0 comment="Site B" interface=
wireguard-site-a persistent-keepalive=25s public-key="*****"
/ip address
add address=10.0.0.1/24 interface=wireguard-site-a network=10.0.0.0
/ip dhcp-client
add interface=bridge-lan
/ip firewall nat
add action=masquerade chain=srcnat out-interface=bridge-lan src-address=
10.0.0.0/24
/ip route
add disabled=no distance=1 dst-address=10.2.2.0/24 gateway=wireguard-site-a
pref-src="" routing-table=main scope=30 suppress-hw-offload=no
target-scope=10
/system clock
set time-zone-name=Europe/Paris
/system note
set show-at-login=no
\
Mikrotik B confs :
RouterOS 7.12.1
model = RB952Ui-5ac2nD
/interface bridge
add admin-mac=BA:80:3F:59:B2:9B auto-mac=no name=bridge-lan
/interface lte
set [ find default-name=lte1 ] comment="USB Tethering"
/interface wireguard
add comment="WG Interface - Site B" listen-port=51821 mtu=1420 name=
wireguard-site-b
/interface lte apn
set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk group-ciphers=tkip,aes-ccm mode=
dynamic-keys name=ep_remote_access supplicant-identity=""
unicast-ciphers=tkip,aes-ccm
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n country=france disabled=no
installation=outdoor mode=ap-bridge mtu=1420 security-profile=
ep_remote_access ssid=wlan2_limited_access wps-mode=disabled
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=dhcp_pool4 ranges=10.2.2.1-10.2.2.254
/ip dhcp-server
add address-pool=dhcp_pool4 interface=bridge-lan name=dhcp1
/port
set 0 baud-rate=9600 data-bits=8 flow-control=none name=usb1 parity=none
stop-bits=1
/interface ppp-client
add apn=internet name=ppp-out1 port=usb1
/interface bridge port
add bridge=bridge-lan ingress-filtering=no interface=ether1
add bridge=bridge-lan ingress-filtering=no interface=ether2
add bridge=bridge-lan ingress-filtering=no interface=ether3
add bridge=bridge-lan ingress-filtering=no interface=ether4
add bridge=bridge-lan ingress-filtering=no interface=ether5
add bridge=bridge-lan ingress-filtering=no interface=wlan1
add bridge=bridge-lan ingress-filtering=no interface=wlan2
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface ovpn-server server
set auth=sha1,md5
/interface wireguard peers
add allowed-address=0.0.0.0/0,::/0 comment="Site A" endpoint-address=
mygateway-dns... endpoint-port=51820 interface=wireguard-site-b
persistent-keepalive=25s public-key="*******"
/ip address
add address=10.0.0.2/24 interface=wireguard-site-b network=10.0.0.0
add address=10.2.2.0/24 interface=bridge-lan network=10.2.2.0
/ip dhcp-client
add interface=bridge-lan
/ip dhcp-server network
add address=10.2.2.0/24 dns-server=192.168.1.1 gateway=10.2.2.0
/ip firewall nat
add action=src-nat chain=srcnat src-address=10.2.2.0/24 to-addresses=10.0.0.2
/routing bfd configuration
add disabled=no interfaces=all min-rx=200ms min-tx=200ms multiplier=5
/system clock
set time-zone-name=Europe/Paris
/system identity
set name=RouterOS
/system note
set show-at-login=no
/system ntp client
set mode=broadcast