Greetings to all. Please tell an inexperienced person how to make sure that packets originating from a specific local network exit through a designated external IP address?
I have three external ip addresses: 1.1.1.156, 1.1.1.157, and 1.1.1.158, as well as local ones: 10.0.10.0/24, 10.0.20.0/24, and 10.0.30.0/24. Here’s how to use NAT or Route or something else to make the Internet, for example, 10.0.30.0/24 go under 1.1.1.158?
/ ip address
add address=10.0.10.0/24 network=10.0.10.0 interface=bridge-main
add address=10.0.20.0/24 network=10.0.20.0 interface=vlan157
add address=10.0.30.0/24 network=10.0.30.0 interface=vlan158
add address=1.1.1.156/23 network=1.1.1.0 interface=ether1-wan
add address=1.1.1.157/23 network=1.1.1.0 interface=ether2-wan
add address=1.1.1.158/23 network=1.1.1.0 interface=ether3-wan P.S> : > now I have such settings, because vlan157 and vlan158 go through the 5th port to the switch, where I already spread VLANs on the port
/ ip route
add dst-address=0.0.0.0/0 gateway=1.1.1.156,1.1.1.157,1.1.1.158 check-gateway=ping
This is a one connection from one ISP with three addresses. The Internet cable from ISP is included in the switch, from which there are three cables to the router, the first (156), the second(157) and the third(158)
And how do you get those addresses? Is it DHCP? Or static addresses, but locked to specific MAC address? In other words, you can’t just put them all on one interface?
In that case, you need to treat it as multi-WAN. The only difference is that you most likely have the same gateway for all addresses, so when creating other routing tables, you need to include interface (1.1.1.X is gateway address):
Depending on how strictly you want to link LANs to WANs, you may either use the approach with mangle rules, marking connections and routing for them, or you can have routing rules.
For mangle rules, you also need to mark connections from LANs. Check PCC example for some ideas. The article is mainly about load balancing, which is done by two rules with per-connection-classifier option, so just ignore that and focus on understanding the rest, because it applies to any multi-WAN config.
With routing rules you can have all-static mapping without mangle rules:
I’ve tried everything, it still doesn’t work , even though I’m 10.0.10.0/24, 10.0.20.0 /24 or even 10.0.30.0/24, I still send requests/responses via 1.1.1.156. Checked on two computers! Here are screenshots: https://imgur.com/a/I4i3vgT
You have wrong gateways. See my previous post, the routes there with 1.1.1.X, it should be 1.1.1.1 for all three (1.1.1.1%ether1-wan, 1.1.1.1%ether2-wan, 1.1.1.1%ether3-wan).
And better than screenshots is to do:
/export hide-sensitive file=myconfig
and then post content of resulting myconfig.rsc in code tags (you can mask addresses if you want, but in some consistent and understadable way).
I can 't understand why I can 't open port 27016 for the SE game server . When I check the port status via 2ip, packets arrive to it, that is, the counter increases, but the port usually does not respond to the source. The same thing happens with port 53. I have a web server at home on ISPmanager from ISPsystem. Before the server , of course, there is MikroTik, in it I open everything. The port seems to be open , and when I enter it:
You have several dstnat rules forwarding ports to same server. So if all those ports work, there’s no reason why just one wouldn’t. The only difference is that 53 is udp and others are tcp (I don’t know about 27016). So make sure that you don’t block udp in firewall filter. You can go step by step and verify what exactly happens. If counter for dstnat increases, it means that packet arrived to router, but it doesn’t guarantee that it was sent to server (that’s why you need to check firewall filter). You can also verify on internal interface that it really went there, using either Tools->Torch or logging rule in postrouting. Next step is that server must send something back, use the same way to check it.
I still don 't understand how it works, sorry…
Here is I a bit cleaned NAT from unnecessary IP addresses, 158 th acts as a service, 157 th acts as access to the sites themselves. Watch this video please: https://youtu.be/RDqX123Sodw P.S: at the end of the video, I did not correctly open port 27016, there is no problem with it anymore
I open the ports as I know, check on all the ones I need: 21 (FTP/ TCP), 22(SSH/TCP), 25(SMTP/TCP), 53(DNS/UDP) 143(IMAP/TCP), 995(IMAPS/TCP), 465(SMTPS/TCP), 3306(MySQL/TCP).
21, 22-work, and the rest can not respond to packages or do not accept them at all…
I don 't want to waste your time just because I’m new, I’m studying, and I have to pay for my education. Please help me and I will pay for your spend time
I’ll be honest, I didn’t watch the video closely, it’s rather long and quite boring. But I skimmed through it, tried to check the ports from my side, and it doesn’t work at all, there’s no response from any of them. But now I realize that you never posted whole config, so that would be great next step, do:
/export hide-sensitive file=myconfig
And post content of resulting myconfig.rsc here in code tags.