Community discussions

MikroTik App
 
jereminius
just joined
Topic Author
Posts: 1
Joined: Mon Nov 14, 2022 11:04 am

Port forwarding - Wireguard

Mon Nov 14, 2022 2:26 pm

Hi, i searched the forums today but did not find an answer to my problem. I changed routers yesterday (i used an Asus router before) and i cant get the port forwarding to work.

Basically i only need the port 51820 UDP to be forwarded to 192.168.1.50 (ubuntu server, wireguard running in a docker container).
I set up the router with the quick setup utility. Could it be the problem?

This is my config:
/export compact 
# nov/14/2022 13:22:25 by RouterOS 6.49.7
# software id = 5ZFW-3348
#
# model = RB750Gr3
# serial number = ******
/interface bridge
add admin-mac=****** auto-mac=no comment=defconf name=bridge
/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.1.2-192.168.1.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.1.1/24 comment=defconf interface=bridge network=192.168.1.0
/ip dhcp-client
add comment=defconf disabled=no interface=ether1
/ip dhcp-server lease
add address=192.168.1.11 mac-address=64:90:C1:02:E3:92 use-src-mac=yes
add address=192.168.1.10 mac-address=34:CE:00:8C:CB:70
add address=192.168.1.12 mac-address=70:2A:D5:EE:79:3C
add address=192.168.1.13 mac-address=74:7A:90:9E:C3:FD
add address=192.168.1.8 mac-address=E0:DC:FF:05:15:35
add address=192.168.1.14 mac-address=A4:83:E7:65:90:09
add address=192.168.1.19 mac-address=A4:E5:7C:A3:35:56
add address=192.168.1.9 mac-address=8C:AA:B5:56:2E:C6
add address=192.168.1.17 mac-address=48:B0:2D:2B:9E:FA
/ip dhcp-server network
add address=192.168.1.0/24 comment=defconf gateway=192.168.1.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,1.0.0.1
/ip dns static
add address=192.168.1.1 comment=defconf name=router.lan
add address=192.168.1.50 name=weather.loxone.com
/ip firewall filter
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
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=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat comment=wireguard dst-address=[MY PUBLIC IP] dst-port=51820 protocol=udp to-addresses=192.168.1.50
add action=masquerade chain=srcnat dst-address=192.168.1.50 dst-port=51820 out-interface=bridge protocol=udp src-address=192.168.1.0/24 to-addresses=192.168.1.50 to-ports=51820
/system clock
set time-zone-name=Europe/Budapest
/system identity
set name=RouterOS
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
What am i doing wrong? I tried maybe a dozen configs found online, but no luck. Thanks for the help.

Who is online

Users browsing this forum: 0xAA55 and 40 guests