Greetings,
As requested, I made a “cleaned-up” working and “far from optimal or according to best practices since I am learning” config as requested.
# 2023-08-04 01:05:20 by RouterOS 7.10.2
# software id =
#
# model =
# serial number =
/interface bridge
add admin-mac=08:55:31:91:1F:8E auto-mac=no comment=defconf name=bridge
/interface vlan
add interface=bridge name=vlan1 vlan-id=1
add interface=bridge name=vlan2 vlan-id=2
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
add name=VLAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=dhcp ranges=10.0.0.100-10.0.0.200
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
/port
set 0 name=serial0
/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 bridge vlan
add bridge=bridge vlan-ids=1
add bridge=bridge vlan-ids=2
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=vlan1 list=VLAN
add interface=vlan2 list=VLAN
/ip address
add address=10.0.0.1/8 interface=bridge network=10.0.0.0
add address=172.16.0.2/12 interface=ether1 network=172.16.0.0
/ip dhcp-client
add comment=defconf disabled=yes interface=ether1
/ip dhcp-server network
add address=10.0.0.0/8 comment=defconf dns-server=172.16.0.1 gateway=10.0.0.1 \
netmask=8
/ip dns
set allow-remote-requests=yes servers=172.16.0.1
/ip dns static
add address=172.16.0.2 comment=defconf name=router.lan
/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 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 nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=172.16.0.1 routing-table=main \
suppress-hw-offload=no
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 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 ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
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 packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
/system clock
set time-zone-name=America/Toronto
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
From what I could read, according to provided links and other topics on the forums, I would need to use VLANs to “isolate” the subnets, which is something that was already suggested, I started the configuration but I do not know how to finish it, hence why I am still posting my configuration and asking for help once again. I think I need to set tagged, untagged ports and then activate VLAN filtering on the bridge.
Also, before you ask:
- This is temporary, because if I use WAN as the out interface-list, every internet communication is way slower:
/ip firewall nat
add action=masquerade chain=srcnat
I will also try to answer as much comments and/or questions as possible, sorry if I missed any:
I’m not the one who needs help, it’s the one who’s exposing several unencrypted protocols — HTTP, SMTP, IMAP, inbound (!) DNS, and FTP — to the naked Internet. Add to that RDP and MySQL, both of which might be made secure, but so often are not that they’re perennial targets, particularly given that they’re high-value services.
What are you recommendations to use and or forward these ports to the outside then? I have a DB server, web server and FTPS, I do admit that the FTP and the DNS were probably leftovers for testing purposes, so it was my mistake to not remove them sooner.
You can’t dstnat through a routing layer like that. For a rule like this:
Code: Select all
add action=dst-nat chain=dstnat comment=MySQL dst-address=172.16.0.1
dst-port=3306 protocol=tcp src-port=“” to-addresses=10.0.0.32 to-ports=3306
That was a leftover test, since port forwarding was not working, I tried a lot of stuff.
I was not aware that you could add three addresses to the bridge?
How do devices know which subnet they belong too??
Not the usual config I am used to seeing, why the strange approach?
This is a mix of lack of knowledge and partial information from other network admins I spoke with. As I said above, I think VLAN is the way to resolve the subnet issue. THis was also, originally, configured like that as a temporary measure to eventually learn and get some help with VLANs.
Even worse why is the WAN address part of the bridge.???
add address=172.16.6.0/12 interface=bridge network=172.16.0.0
I was told by someone working with Cisco routers that, since my WatchGuard (firewall) was in the 172.16.X.X range and that it was already configured with WAN access, that I would not need the MikroTik port, this is probably a bad configuration from my part, but this is the only way I was able to use internet for the moment, I will gladly take your recommendations, this is why I actually created this topic.
Forward chain is not used for port forwarding information…
add action=accept chain=forward disabled=yes dst-port=21,49152-65534 \
This is a test I made when I originally configured the router, I saw the NAT rules afterward, forgot to remove it, completely my bad.
Duplicate Entries?
add action=accept chain=input in-interface=ether5-access src-address=
192.168.5.55
add action=accept chain=input in-interface=ether5-access src-address=
192.168.5.0/24
Taken from: https://forum.mikrotik.com/viewtopic.php?t=181718
Copy/paste mistake (not an error by the OP), I was trying to configure a “management” port at some point because I kept losing access to the router with bad VLAN configurations.
Mangle rules for layer7 what??? Never seen that either.
WHat does this have to do with your setup??
I had DNS issues at some point, I followed a guide online to set up a domain name, I tried to find the link, but I was not able to, it was a while back.
Dst NAT port forwarding rules will not work with in-interface-list=WAN, Very much discussed in the article provided.
add action=dst-nat chain=dstnat comment=HTTP/HTTPS dst-port=80
in-interface-list=WAN protocol=tcp to-addresses=10.0.0.32 to-ports=80
That was another test.
Sorry if I missed anything or if I took time to answer. I wanted to provide as much information as possible.