Wrong nat port

Hi!

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.

9 R ;;; Wan2 - digi - 1 GB/s
name="ether10" default-name="ether10" type="ether" mtu=1492 actual-mtu=1492 l2mtu=1492 max-l2mtu=10222
mac-address=4C:5E:0C:6A:80:55 ifname="eth9" ifindex=15 id=10 last-link-down-time=2026-03-11 10:35:23
last-link-up-time=2026-03-11 10:35:26 link-downs=4

The strange thing is, if i set the outgoing interface to 12 (where my other provider is connected) it works, and shows the correct public ip as well!

without setting the out interface, the log file shows the traffic flowing trough interface 12.

Any ideas, what would be the solution?

Steve.

You will need to post your configuration for review, instructions here:
Forum rules - #5 by gigabyte091

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.

26-3-11.rsc (55.0 KB) The config is to long to just paste in.

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

DST-ADDRESS GATEWAY DISTANCE

0 Xs 10.0.99.1/32 ether11 1
1 Xs 0.0.0.0/0 0.0.0.0 1
2 As 0.0.0.0/0 193.xxx.xxx.xxx 3
DAc 10.0.26.118/32 Int_DIGI 0
DAc 10.0.100.0/24 vlan100 0
DAc 10.0.105.0/24 vlan105 0
DAc 192.168.0.0/24 vlan0 0
DAc 192.168.3.0/24 vlan3 0
DAc 192.168.4.0/24 vlan4 0
DAc 192.168.5.0/24 vlan5 0
DIcH 192.168.88.0/24 ether1 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc 193.xxx.xxx.xxx/32 ether12 0
3 IsH 0.0.0.0/0 81.xxx.xxx.xxx 3

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.

for some reason i added a static route, which was that. I removed it. So it looks like this:

[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
#       DST-ADDRESS        GATEWAY         DISTANCE
0  Xs   10.0.99.1/32       ether11                1
1  Xs   0.0.0.0/0          0.0.0.0                1
2  As   0.0.0.0/0          193.xxx.xxx.xxx         3
  DAc   10.0.26.118/32     Int_DIGI               0
  DAc   10.0.100.0/24      vlan100                0
  DAc   10.0.105.0/24      vlan105                0
  DAc   192.168.0.0/24     vlan0                  0
  DAc   192.168.3.0/24     vlan3                  0
  DAc   192.168.4.0/24     vlan4                  0
  DAc   192.168.5.0/24     vlan5                  0
  DIcH  192.168.88.0/24    ether1                 0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc + 193.xxx.xxx.xxx/26  ether12                0
  DAc   193.xxx.xxx.xxx/32  ether12                0

What else could i try ? 

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"

38 ;;; VM-WindowsServer
chain=srcnat action=src-nat 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="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).

[admin@MikroTik] > /ip route print where dynamic
Flags: D - DYNAMIC; I - INACTIVE, A - ACTIVE; c - CONNECT; H - HW-OFFLOADED;>
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAc 10.0.27.182/32 pppoe-digi 0
DAc 10.0.100.0/24 vlan100 0
DAc 10.0.105.0/24 vlan105 0
DAc 192.168.0.0/24 vlan0 0
DAc 192.168.3.0/24 vlan3 0
DAc 192.168.4.0/24 vlan4 0
DAc 192.168.5.0/24 vlan5 0
DIcH 192.168.88.0/24 ether1 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0
DAc + 193.xxx.xxx.xxx/26 ether12 0

[admin@MikroTik] > /ip route print where static
Flags: A - ACTIVE; s - STATIC
Columns: DST-ADDRESS, GATEWAY, DISTANCE

DST-ADDRESS GATEWAY DISTANCE

;;; digi route
0 s 0.0.0.0/0 pppoe-digi 4
1 As 0.0.0.0/0 193.xxx.xxx.141 3

Same result if i masquerade instead of snat. Is there any networking guru here, who could shed some light on this strange fenomen?

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:

  1. put it at distance 3 as well (and you will have two As rules with a + sign meaning that they are PCC
  2. 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.

If i give the same distance indeed it worked (plus sign appeared ) and the mentioned local ip was nat-ed correctly, to the correct interface:

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

DST-ADDRESS GATEWAY DISTANCE

;;; digi route
0 As+ 0.0.0.0/0 pppoe-digi 3
1 As+ 0.0.0.0/0 193.xxx.xxx.141 3

Yeah what you have now is a multipath route, and that is not going to work with two ISP connections each with a different local IP.

What you need to have is multiple routing tables, routing rules, and marking of traffic to use the proper outgoing route.

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?

Thanks for the time and effort to reply.

There are several descriptions of that here in the forum and in the RouterOS - RouterOS - MikroTik Documentation

While your at it, I seriously recommending setting your config back to default and start anew, without all the xtra bloat you have going on.

It is not clear (to me) what you are actually wanting to do.
If failover, the two simplest methods are (IMNSHO):
Recursive:

and (using Netwatch):

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.