I m havign a strange problem. I m trying to set up a src nat to an pppoe wan connection, which is on interface ethernet 10 in my case. I have a second provider with fixed ip on interface ethernet 12 . It actually works if i SNAT without setting the out. interface. The moment i try to set it , it won t work.
When you want something to work on your pppoe wan connection, you need to select the pppoe interface (e.g. pppoe-client1) not the ether port it is using.
I have full access to the network. I played around extensively with the interfaces, and already tried to change the out interface to the pppoe interface. Unfortunately src nat will not work in that case, and the nat rule won t be hit to log it.
Most likely there is no traffic routed to that interface. I don’t see any routing configuration, and you claim you have 2 ISPs. The PPPoE interface can automatically add a default route, but how is it for the other ISP? and why is there no load-balancing/failover configuration to be found?
Disconnect the ether12 and see if it starts working. Also show the routing table when the device is running normally. /ip/route/print
No failover, because this is not implemented yet. There are routes:
[admin@MikroTik] > /ip/route/print
Flags: D - DYNAMIC; X - DISABLED, I - INACTIVE, A - ACTIVE; c - CONNECT, s - STATIC; H - HW-OFFLOADED; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
There you can see it, the 0.0.0.0/0 route is Active via 193.x.x.x and the other 0.0.0.0/0 route is not active, so no traffic is routed to the PPPoE interface and the NAT rule never activates.
So your problem is the lack of proper multi-ISP (failover) configuration.
In general, you should build this kind of setup from the bottom up. Interfaces, routing, failover etc must all be working before you start doing NAT etc.
btw, i m trying to set up correctly the static routing from a station which i manually SNAT to the mentioned pppoe connection. AFter this i plan to set up pcc load balancing.
37 X ;;; VM-WindowsServer- not working
chain=srcnat action=masquerade to-addresses=81.xxx.xxx.xxx src-address=10.0.100.33
dst-address-list=!local-networks out-interface=Int_DIGI log=yes log-prefix="masq digi"
Something is messed up, or maybe my routing knowledge is mild. I recreated the pppoe interface. I m trying to snat 10.0.100.30 local ip to the pppoe fixed ip on the pppoe interface and it won t work. Only option which is working is if i don t specify the out interface, but in the log file it shows interface ether12 (which is wrong, because physically the pppoe connection is connected to ether10).
The route through pppoe-digi has distance 4 (greater than 3) and thus it is only "s" (static), while the one through 192.xxx.xxx.141 has distance 3 (smaller than 4) and thus it is both A (Active) and s (static).
A route that is not A is like is not existing for all routing practical effects.
You either:
put it at distance 3 as well (and you will have two As rules with a + sign meaning that they are PCC
put it at a lower distance (and then the pppoe-digi one will become As and the 192.xxx.xxx.141 will become "only" s and not used anymore)
Or you change the destinations, of two 0.0.0.0/0 routes (identical destination, the whole internet) you can only have one Active at a time or you combine them in PCC.
but my other connection couldn t be used:
9 ;;; Vlan0 NAT to public
chain=srcnat action=src-nat to-addresses=193.xxx.xxx.161
src-address=192.168.0.0/24 dst-address-list=!local-networks
out-interface=ether12 log=no log-prefix=""
[admin@MikroTik] > /ip route print where static
Flags: A - ACTIVE; s - STATIC; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
thanks. So i really need to create the pcc method, multiple routing tables and mangle rules. Maybe you could recommend a good tutorial on this toppic/use case?
Basically i have two providers, one which provides a fixed ip range and a guaranteed bandwith. I host diffrent services(mailserver, webservers) on that connection, but the bandwith is not enough sometimes, because we need fast media download for multiple users. So we got a second cheap pppoe provider with 1GB/s link , not-guaranteed bandwidth which is dirt cheap, to implement pcc on it, for just web surfing and downloading. There are some services which are accessible only from the specific fixed ips.
Then definitely you need two (or more) routing tables and a mechanism to invite traffic to use the one or the other(s) depending on some "detection logic".
There are two methods, one (IMHO simpler even if less accurate/cutomizable) is routing rules:
simpler but has less selectors/matchers than the second one, mangle.