I am quite new to the forum and to the community, please excuse me if I make any mistakes, will make sure to correct the ASAP.
What is the problem:
- Unable to route all internet traffic through Wireguard VPN server.
Diagram of the setup:
Short Explanation:
- Site A is the wireguard server, the goal is to tunnel all internet traffic from Site C through it. I didn't specified the external Ip address intentionally, only internal Ip network, pfsense internal address i 192.168.1.1
- Site B is my regular network it is 192.168.1.0, the router is TpLink located and 192.168.1.254.
Inside Site B I have the MikroTik router, connected to this TPLink and having it's external WAN assigned by the DHCP. Mikrotik WAN IP is 192.168.1.110/
MikroTik internal Lan network is 192.168.88.0, Mikrotik internal Lan address/gateway is 192.168.88.1
Wireguard client is set up and I see that the handshake and connection are successful Ip address for wireguard is 172.16.16.3
This is my Export config
Code: Select all
# model = RB941-2nD
/interface bridge
add admin-mac=18:FD:74:1E:4F:E3 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=MikroTik-1E4FE7 wireless-protocol=802.11
/interface wireguard
add listen-port=13231 mtu=1420 name=wg-vpn
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=dhcp interface=bridge name=defconf
/routing table
add disabled=no fib name=wg
/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=pwr-line1
add bridge=bridge comment=defconf ingress-filtering=no interface=wlan1
/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=0.0.0.0/0 endpoint-address=ExternalIp endpoint-port=\
51820 interface=wg-vpn persistent-keepalive=5m public-key=\
"H0g1gh54KX+uk77ATqjnw87FQ3BeAxFifUEvlHjdNDU="
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.0
add address=172.16.16.3 interface=wg-vpn network=172.16.16.1
/ip dhcp-client
add comment=defconf default-route-distance=100 interface=ether1 use-peer-dns=\
no use-peer-ntp=no
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=output dst-address=ExternalIp dst-port=51820 \
protocol=udp
add action=accept chain=forward dst-address=172.16.16.0/24 src-address=\
192.168.88.0/24
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 mangle
add action=mark-routing chain=prerouting new-routing-mark=wg passthrough=yes \
src-address=192.168.88.0/24
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat out-interface=wg-vpn
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
wg-vpn pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=ExternalIp/32 gateway=\
192.168.1.254 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
/system clock
set time-zone-name=Europe/Vienna
/system identity
set name=RouterOS
Thank you.