if Server1 would have IP close to MikroTiks, I could use subnet mask to let it know that it’s directly connected. But its not… so I thought I could add static route, but it requires a gateway address..
For now I’ve done it adding a simple route to 85.1.2.1 using 85.1.2.1 as the gateway. It seems to work, though I’m not sure if it might have any consequences?
thats the issue - it’s public IP, and it’s only one IP that our ISP has given to us (in addition to our router IP). So how to route it IS my question For now I have it working like this:
85.1.1.1 is public IP for our router [well, I’ve changed it, but lets assume its like that]
85.1.2.1 is public IP for our internal server
I’ve added a new route to 85.1.2.1 255.255.255.255 on 85.1.1.1 using 85.1.2.1 as a gateway. It seems to work. But is it proper?
If you have only one public ip, where did you get the other public ip? Unless your ISP routes that second ip to your router, it will not work outside your localnet.
ADD: My bad! You have two public ips assigned; one at the router, and the second is routed into a server on the localnet, correct? And your localnet is on the same interface as the server?
Add the second ip address/netmask (85.1.2.1/24?) to your WAN interface.
Set the internal server to a localnet address. (like 10.1.1.2/24)
For now I’ve done it adding a simple route to 85.1.2.1 using 85.1.2.1 as the gateway. It seems to work,…
I don’t get it. It basically tells the router that route to 85.1.2.1 is via it’s own address. But how can router know where it is? It can’t work. But if it does, I’m obviously misinterpreting something.
@Sob: I don’t think you are missing anything. If the ip/subnet is not assigned to the WAN interface, only conntrack will know where it is. Only locally in the router. From the internet, it will dead-end into the MT router’s WAN interface. Without the second ip address/subnet assigned there, the router will not respond.
I think I forgot to tell something - the server is connected directly to the router via a switch. So there is no path anymore, the packet just has to be delivered to the recipient
I’ve actually changed all the IPs in question, so I’m not even sure what to show Routers external IP is 85.1.1.1, LAN IP is 10.1.1.1, subnet mask is 10.1.1.255. Internal servers lan IP is 10.1.1.200. It also has a second interface, which has a 85.1.2.1 IP assigned. And I added a new route to 8.1.2.1 VIA 8.1.2.1 to router.
Adding route did not work, until I explicitely specified interface. When I did that, it started working. My guess, is that it sends arp request and the server responds to it, so they know they are connected directly. Could this be true?
Frankly, I’m so new to mikrotik, that I’m using WinBox interface, and not even sure of the command lines..
Anyway, my way doesnt really work It worked when 8.1.2.1 was on same adapter which also had an internal IP address. When we put in a new adapter, it no longer works.. I have to look into your suggestions..
Ok, I’ve tried it “additional private network” way. And it works just fine for incoming connections - they find their way to the public IP just fine. However, that does not work at all for outgoing connections via that network. If I don’t add anything, they just dont go through. If I add a masquarade rule, they appear to come from router’s IP address