When establishing security policies, I prefer to use interface names where possible to allow future flexibility.
In your case, I would use the source interface of the .4.x network (we'll say ether4 in this example, but use your actual interface on your system) and the dst-address=ip.of.db.server as the destination....
/ip firewall filter
add chain=forward action=accept in-interface=ether4 dst-address=192.168.1.2 protocol=tcp dst-port=1433-1434,2554-2555
add chain=forward action=drop in-interface=ether4
These rules would be VERY strict - allowing anything in the ether4 network (whatever its IP range is - you could change it 12 times a day and this rule would not need to be changed to keep working) access to 192.168.1.2 for database, and nothing else.
If you want to allow this network onto the Internet in general, you could either add a rule between the two above:
add chain=forward action=accept in-interface=ether4 out-interface=wan
(use the wan interface name on your system)
or perhaps earlier in your chain you have an all-purpose rule that simply allows out-interface=wan regardless of which interface it came from... this would work as well, and you wouldn't need the third rule.
You may also want to allow icmp from ether4 just so internally, you can ping the rest of your network, and things like udp port unreachable, etc - these sorts of control messages will work properly.
Thank you for your reply!
First of all this is a very complex and problematic system in a company. Made many other people I face with the problems right now.
There's an old RB532 with 3 ethernet ports. My 192.168.4.x sits on a VLAN which sits on a bridge.
![Smile :)](./images/smilies/icon_smile.gif)
I follow your instructions and do a firewall rule - two rules:
chain=forward action=accept src-address=192.168.4.0/24
dst-address=192.168.1.2 in-interface=vlan4
chain=forward action=accept src-address=192.168.1.2
dst-address=192.168.4.0/24 out-interface=vlan4
First of all I tried without any ports and it worked, I could ping the devices I needed from INSIDE the 4.x network.
But after came the harder things.
There's a PPTP VPN connection with it's own pool (10.20.4.201-210). All connections from this area forwarded to the 4.x network - but I can not ping the 192.168.1.2 and can not reach the database when I log in with VPN connection.
Have to try another method?