Good day all.
Off the bat, I’m not a Mikrotik, nor network guru. I know very basic network lingo
and with that. I want to present the following scenario.
I’ve recently installed the RB5009UG+S+ and configured it with my limited knowledge as well as watching a ton of Youtube videos, forums and wiki’s. I didn’t want to export the config of the router that was replaced, but rather wanted to setup this router from scratch. I was very nervous to tackle the Firewall Rules, as I couldn’t really figure how some of these rules would work and ended up creating a few of the default rules. (Should anyone see anything wrong or not needed in my rules, please do “educate” me on this ![]()
I’ve got 4 end-users that needs to connect to the Company via VPN, to " obtain" the company IP, in order to connect to a SQL Server Managerment Studio database. I was able to create the Wireguard Interface and created 2 peers thus far. I hope these were correctly created. I can connect via the Wireguard tunnel and the IP address received when checking whatismyip.com, reveals that my IP is that of the company. However, when trying to connect to this database when working remotely and connected via the Wireguard tunnel, we are unable to connect to this database. I thought that maybe my Firewall rules are to blame? As I’m no expert on Firewall rules and would appreciate any assistance.
Side Note: With the previous router, they use to connect via an IPSec Tunnel. I figured that since wireguard seems to better in all aspects. I could try it out ![]()
Router Config:
# 2024-09-19 13:54:35 by RouterOS 7.15.3
# software id = 7UAI-U0HI
#
# model = RB5009UG+S+
# serial number = HFE09FXFHK6
/interface bridge
add arp=proxy-arp name=Bridge-LAN
/interface ethernet
set [ find default-name=ether1 ] arp=proxy-arp name=ether1-WAN
set [ find default-name=ether2 ] name=ether2-LAN
set [ find default-name=ether3 ] name="ether3-Admin AP"
set [ find default-name=ether4 ] name="ether4-Hallway AP"
set [ find default-name=ether5 ] name="ether5-Blue AP"
set [ find default-name=ether6 ] name="ether6-Green_Orange AP"
set [ find default-name=ether8 ] name="ether8 - LTE Fail Over"
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1-WAN name=\
"Internet In-Web Africa" use-peer-dns=yes user=*********
/interface wireguard
add listen-port=13231 mtu=1400 name=Pepla_WG
/interface list
add name=LAN
add name=WAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha512
/ip pool
add name=DHCP-LAN ranges=192.168.0.11-192.168.0.239
/ip dhcp-server
add address-pool=DHCP-LAN interface=Bridge-LAN lease-time=2d name=DHCP
/routing table
add comment="Table for WireGuard - JPB" disabled=no fib name=WG-Pepla
/interface bridge port
add bridge=Bridge-LAN interface="ether3-Admin AP"
add bridge=Bridge-LAN interface="ether4-Hallway AP"
add bridge=Bridge-LAN interface="ether5-Blue AP"
add bridge=Bridge-LAN interface="ether6-Green_Orange AP"
add bridge=Bridge-LAN interface=ether2-LAN
/ip firewall connection tracking
set enabled=yes udp-timeout=10s
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/interface l2tp-server server
set default-profile=default use-ipsec=yes
/interface list member
add interface=Bridge-LAN list=LAN
add interface="Internet In-Web Africa" list=WAN
/interface wireguard peers
add allowed-address=192.168.89.3/32 client-dns=192.168.0.1 interface=Pepla_WG \
name="peer1" persistent-keepalive=30s private-key=\
"******************" public-key=\
""
add allowed-address=192.168.89.2/32 client-dns=8.8.8.8 interface=Pepla_WG \
name="Peer2" persistent-keepalive=30s private-key=\
"****************************" public-key=\
""
/ip address
add address=192.168.0.1/24 interface=Bridge-LAN network=192.168.0.0
add address=41.132.65.127 disabled=yes interface="Internet In-Web Africa" \
network=168.210.4.66
add address=192.168.89.1/24 interface=Pepla_WG network=192.168.89.0
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=192.168.0.1 gateway=192.168.0.1 \
ntp-server=154.73.32.1,154.73.32.2
/ip dns
set allow-remote-requests=yes servers=192.168.0.1
/ip firewall address-list
add address=154.73.32.0/22 disabled=yes list=iewc-ip4s
add address=165.16.200.0/21 disabled=yes list=iewc-ip4s
add address=192.168.0.0/24 disabled=yes list=MGMT-RANGES
add address=192.168.88.0/24 disabled=yes list=MGMT-RANGES
add address=192.168.0.0/24 disabled=yes list=LAN-RANGE
/ip firewall filter
add action=accept chain=input comment=\
"\"defconf: accept established,related,untracked\"" connection-state=\
established,related,untracked
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="Allow WireGuard" dst-port=13231 \
protocol=udp
add action=accept chain=forward in-interface=Pepla_WG
add action=accept chain=input dst-port=8291 protocol=tcp src-address=\
192.168.89.0/24
add action=accept chain=input comment="Old Router Rules" disabled=yes \
dst-port=443 protocol=tcp
add action=accept chain=input disabled=yes dst-port=22,2000,8291 protocol=tcp \
src-address-list=iewc-ip4s
add action=accept chain=input disabled=yes protocol=icmp
add action=accept chain=input disabled=yes dst-port=53,123 in-interface=\
Bridge-LAN protocol=udp
add action=accept chain=input disabled=yes dst-port=22,8291 in-interface=\
Bridge-LAN protocol=tcp
add action=accept chain=forward disabled=yes dst-port=19001 protocol=tcp
add action=drop chain=input comment=\
"\"defconf: drop all not coming from Bridge-LAN\"" in-interface=\
!Bridge-LAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=drop chain=forward comment="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=accept chain=prerouting disabled=yes dst-address=192.168.0.0/24
/ip firewall nat
add action=masquerade chain=srcnat
add action=masquerade chain=srcnat comment="WireGuard NAT" out-interface=\
Pepla_WG src-address=192.168.89.0/24
/ip firewall service-port
set tftp disabled=yes
set irc disabled=no
set h323 disabled=yes
set sip disabled=yes
/ip ipsec profile
set [ find default=yes ] dh-group=modp2048 enc-algorithm=aes-256 \
hash-algorithm=sha512
/ip service
set ftp disabled=yes
/ppp secret
add disabled=yes name=vpn profile=*2
add disabled=yes name=JP profile=*2
/routing rule
add action=lookup disabled=no src-address=192.168.89.0/24 table=WG-Pepla
add action=lookup disabled=yes src-address=192.168.89.2/32 table=WG-Pepla
add action=lookup disabled=yes src-address=192.168.89.3/32 table=WG-Pepla
/system clock
set time-zone-name=Africa/Johannesburg
/system identity
set name="Core Router"
/system note
set show-at-login=no
Apologies for any confusion of terminologies above, but I hope that I kinda made sense? ![]()
Again, thank you to anyone willing to assist me with this.