Simple static routing and SQL Server

Hi

I have two isolated networks (192.168.0.X/24 and 192.168.10.X/24), each of them in a simple unmanaged switch. My gateway to internet is 192.168.0.3 (my base router). My SQL server is in 192.168.10.14.

For now I just need to use my RB2011UiAS-IN to route between these two networks. I connect ether2 port to 192.168.0.X switch, and ether3 to 192.168.10.X switch. Mikrotik is reset, empty, no base config. IP Settings are default. This is what I have done till now:

SET IP

/ip address
add address=192.168.0.80/24 interface=ether2
add address=192.168.10.254/24 interface=ether3

SET GATEWAY

/ip route
add gateway = 192.168.0.3

I think I don’t need to specify any more static routing. Traffic to 192.168.0.x is autiomatically routed to ether2 and traffic to 192.168.10.x is automatically routed to 192.168.10.X

ALLOW ROUTING IN FIREWALL (not sure if is necesary)
/ip firewall filter add action=accept chain=forward in-interface=ether2
/ip firewall filter add action=accept chain=forward in-interface=ether3

Now, I have to configure the other devices:

  • I have set a static route in router 192.168.0.3 to route any packets destined to 192.168.10.X/24 to 192.168.0.80.

  • All devices in network 192.168.10.X have 192.168.10.254 as gateway

Anything appears to work fine. I can ping between networks, and computers in 192.168.10.X network can access internet. But I CANT connect to my SQL server in 192.168.10.14 from a computer in 192.168.0.X. SQL server connections are refused. I have configured the Windows Firewall in 192.168.10.14 to allow remote connections (https://technet.microsoft.com/en-us/library/cc646023(v=sql.110).aspx), and setup SQL services (https://blogs.msdn.microsoft.com/walzenbach/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008/).

Any extra configuration I must set in Mikrotik?

Thanks! :slight_smile:

NOTE: Just for your information, in case it could be relevant. With actual configuration, if I directly interconnect both switches with a cable, and then connect both ether2 and ether3 to one of them, it works without no problem. SQL server is visible. I know In this case all devices are connected to the same phisical network (divided in two interconnected switches), and Mikrotik is just routing packets from one logical network to the other (192.168.0.X to 192.168.10.x and vice-versa).

When connecting to SQL server, do you use numeric IP address (to be sure that client computer is really trying to connect there)? I’d do some packet sniffing, to see what exactly is happening. When you connect everything to same switch, it might as well use link-local IPv6.

Hi! Thanks for your orientation! It was very helpfull

This is what is happening…

All devices connected to same switch (no Mikrotik)
→ Ping to IPv4 does not work
→ Ping to host name WORKS! (IPv6 addrress is the one responing, so it must be link-local IPv6)
→ SQL Server connection via IPv4 address (/SQLEXPRESS) does not work
→ SQL Server connection via hostname (/SQLEXPRESS)… slow… slow.. but… IT WORKS! O_o

All devices connected to the same switch (with Mikrotik)
→ Ping to IPv4 does works
→ Ping to host name works
→ SQL Server connection via IPv4 address (/SQLEXPRESS) works fast
→ SQL Server connection via hostname (/SQLEXPRESS) works fast

Networks isolated, routing through Mikrotik
→ Ping to IPv4 does works
→ Ping to host name DOES NOT WORK
→ SQL Server connection via IPv4 address (/SQLEXPRESS) works fast
→ SQL Server connection via hostname (/SQLEXPRESS) does not work

So I can see Mikrotik is routing IP addresses, but somehow can’t resolve hostnames between networks. What coluld I do to achieve this?

Thanks for all!

Whne they connected to the same switch, it will use broadcast as part of the name resolution process and will work as they are on same layer2 network.

No broadcasting crosses layer 3 networking (routing), so to resolve this, you will need to enter name / IP details statically in Mikrotik DNS

Thanks for your answer. Following your advice I found another post regarding the use of Mikrotik DNS to resolve hostnames, answered by ZeroByte

http://forum.mikrotik.com/t/how-to-set-hostname-for-a-specific-static-ip/102749/1

Whatever that is, you can create host names in the Mikrotik’s DNS proxy:
/ip dns static add address=192.168.10.14 name=myhost.example.com

Then you need to either assign the Mikrotik as the LAN’s DNS server address, or else use a dstnat rule to intercept (redirect) outbound DNS queries to the Mikrotik itself:
/ip firewall nat add chain=dstnat protocol=tcp dst-port=53 action=redirect
/ip firewall nat add chain=dstnat protocol=udp dst-port=53 action=redirect

And make sure sure that your DNS service allows remote requests:
/ip dns set allow-remote-requests=yes

AND MOST IMPORTANTLY:
Make sure that your firewall filter’s input chain will drop incoming requests to port 53 from the Internet

I’ll do as described :slight_smile:

Thanks to both answers…

I’ts solved. Part of my problem was misconfiguration of NIC in server, but I couln’s have solved it without your orientation, I couldn’t mark both of you as answer. Sorry :frowning:

Well the problem can be resolved by putting a proxy vpn or browsing through a vpn site. So only access the best free proxy sites to truly help with the case.