Hi all,
I am trying to setup WG on my home router so I can connect home via my phone. I have setup both ends on my router and my phone. I can connect home, but as for the traffic traveling through tunnel I am getting super confused.
Code: Select all
/ip firewall filter
add action=accept chain=input comment="Allow traffic thru Home WG interface" \
log=yes src-address=10.10.35.0/24
add action=accept chain=input comment=\
"Allow inbound connection to Home WG interface" dst-port=13231 \
in-interface-list=WAN log=yes protocol=udp
add action=accept chain=input comment="LAN Hosts allowed access to router" \
src-address-list=allowed_to_router
add action=drop chain=input comment=\
"DROP Inbound DNS-TCP queries from WAN list" dst-port=53 \
in-interface-list=WAN protocol=tcp
add action=drop chain=input comment=\
"DROP Inbound DNS-UDP queries from WAN list" dst-port=53 \
in-interface-list=WAN protocol=udp
add action=add-src-to-address-list address-list=Port_Scanner \
address-list-timeout=1w chain=input comment="Port scanner detection rule" \
protocol=tcp psd=21,3s,3,1
add action=drop chain=input comment="Drop all entries in the port scan list" \
src-address-list=Port_Scanner
add action=add-src-to-address-list address-list=Syn_Flooder \
address-list-timeout=30m chain=input comment=\
"Add Syn Flood IP to the list" connection-limit=30,32 protocol=tcp \
tcp-flags=syn
add action=drop chain=input comment="Drop Syn flood list" src-address-list=\
Syn_Flooder
add action=add-src-to-address-list address-list=Spammers \
address-list-timeout=3h chain=forward comment=\
"Add spammers to the drop list for 3 hours" connection-limit=30,32 \
disabled=yes dst-port=25,587 limit=30/1m,0:packet protocol=tcp
add action=drop chain=forward comment="Avoid [EMAIL] spammers action" \
disabled=yes dst-port=25,587 protocol=tcp src-address-list=Spammers
add action=drop chain=forward comment=\
"Drop incoming from internet which is not public IP" in-interface-list=\
WAN src-address-list=Bogons
add action=accept chain=input comment=\
"Defcon - Accept established connections" connection-state=established
add action=accept chain=input comment="Defcon - Accept related connections" \
connection-state=related
add action=drop chain=forward comment=\
"Drop ALL invalid packets on all interfaces" connection-state=invalid
add action=drop chain=forward comment=\
"Drop incoming packets that are not NAT`ted" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
add action=drop chain=forward comment=\
"Drop packets from LAN that do not have LAN IP" in-interface=LAN_Bridge \
src-address=!10.10.10.0/24
add action=jump chain=forward comment="jump to ICMP filters" jump-target=icmp \
protocol=icmp
add action=drop chain=input comment="BLOCK ALL ACCESS TO ROUTER" dst-port=\
8291 protocol=tcp src-address-list=!allowed_to_router
add action=drop chain=input comment=\
"DROP EVERYTHING ELSE!"
add action=accept chain=icmp comment="echo reply" icmp-options=0:0 protocol=\
icmp
add action=accept chain=icmp comment="net unreachable" icmp-options=3:0 \
protocol=icmp
add action=accept chain=icmp comment="host unreachable" icmp-options=3:1 \
protocol=icmp
add action=accept chain=icmp comment=\
"host unreachable fragmentation required" icmp-options=3:4 protocol=icmp
add action=accept chain=icmp comment="allow echo request" icmp-options=8:0 \
protocol=icmp
add action=accept chain=icmp comment="allow time exceed" icmp-options=11:0 \
protocol=icmp
add action=accept chain=icmp comment="allow parameter bad" icmp-options=12:0 \
protocol=icmp
add action=drop chain=icmp comment="deny all other types"
The first rule should allow traffic thru wireguard. The second rule is to allow WG connection to the mikrotik router via port 13231 (as per instructions by Mikrotik on Youtube). As mentioned above the first rule doesn't counter whatsoever whether it's first or second. The second rule breaks if src-address is added. Yes, the src-address on my phone is correct. Can anyone help me out with this please? Thanks a loooot!