Routing problem? It should work but it doesn't!

Hi everybody!

I have a Mikrotik 2011UiAS running as the primary router for my home network.

One of the physical ports is defined as the exit port to the internet provider,
the others are bridged and connected to the devices of my local network.

There is another port not connected to the bridge.

While the main local network (192.168.88.0/24) works fine, the single port makes some problems:

/ip address add address=10.10.10.1/24 interface=ETH7 network=10.10.10.0



/ip firewall nat add action=masquerade chain=srcnat dst-address-list=!LOCAL src-address=10.10.10.0/24 to-addresses=10.10.10.1

There is also a dhcp server running on that port. When physically connected to that port,
the dhcp server gives out leases. Also the router is able to ping the client.

BUT the client is not able to use the internet.

To be sure that there is no misconfiguration with filter rules and bridge filters they all have
been deleted for testing purpose.

It is also interesting while using the tools/torch utility I found out, that the packets from
the client connected to the single port are forwarded and masqueraded so that they
are leaving the default gateway with the source address and the right
destination ip <8.8.8.8>. Also there are packets replied with the right source
<8.8.8.8> and destination .

BUT they never reach the client! It looks like all these packets, comming back,
are not masquerade the way back or lost at any other point.

Using wireshark on the client shows that ICMP packets getting no reply.

Thats really weird :confused:

greetings, tony

You imply that traffic connected to the bridge do work, but only this one non-bridge port is not working. Carefully compare the rules and settings for the working ports and the non-working port. I’ll bet you find something that is different and preventing. If that does not help, I would also suggest that you export your entire IP configuration and post it here so we can better help you.

What’s the idea behind posted srcnat rule? Because unless there’s another srcnat rule before this one that matches traffic from 10.x network, this one will set source to 10.10.10.1 and not .

Hi Sob, yes there is another srcnat rule before that rule mentioned by you:

/ip firewall nat add action=masquerade chain=srcnat out-interface="ETH1" to-addresses=0.0.0.0

I have also tested a clean installation of routeros by the time. It looks like a bug.

@k6ccc: The only difference between the working bridge and the single port is that the single port is actually a vlan.

Again, there is a dhcp-server running on the vlan. Leases are working fine. Connectivity between the client and
the router (ping, http) is now working 100%. The only problem is the connection to the internet.

Vlan network is 10.10.10.0/24, router network is 192.168.88.0/24. The problem must be the translation! Really,
all checked twice. Packets are being forwarded to the ETH1-gateway fine, but replies from the outside are not
being forwared to the vlan. It looks like the masquerading rule from above is only working for the bridge network
and only works one-direction for the vlan? :confused:

I cannot explain. Its strange! :slight_smile:

Showing partial config will only led to speculation and time wasted guessing…

What’s the point of that srcnat to begin with? Router already knows how to pass the traffic back to 10.10.10.x addresses without it.

Kind regards,

While testing I checked if the vlan works when disabling the dhcp server and
adding it to the bridge. → It works.

That means:

Connectivity from vlan to router … working.
Connectivity from router to vlan … working.
Connectivity from router to internet … working.

Forwarding vlan traffic to internet … not working,
meaning no packets are coming back to the vlan client.

  1. Post a copy of your static route.
  2. there is no need for the second srcnat and this could be causing your problem.suggest you just have instead of your primary nat.
chain=srcnat action=masquerade src-address=10.10.10.0/24 dst-address=0.0.0.0/0  out-interface="ETH1" log=no log-prefix=""

you should not use the to-address in this statement as that changes the source ip you want to use dst-addres as this specifies the address you trying to reach. hope that makes sense for more info refer to the wiki http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/NAT

Thanks so much for your help!

After spending the whole day searching for the problem I found the problem eventually:

After three years of using the router and some extensive configuration-upgrades
including firmware / software-updates there was a “configuration error” in the
/ip firewall nat area. After /export file=foo and system configuration reset
I reimported the configuration file and now everything works as it should.

I was also able to find the problem and correct it directly by simply deleting all
/ip firewall nat rules and adding them manually again.

As dgnevans mentioned the following srcnat rule

/ip firewall nat add action=masquerade chain=srcnat out-interface="ETH1" to-addresses=0.0.0.0

was not correct because of the “to-addresses=0.0.0.0”-part. There is a bug in the web-gui! If you set-up a new
rule like this with action=srcnat, enter a to-addresses, save it and later remove the “to-addresses=0.0.0.0”-part and
change it to “action=masquerade” there will be the “to-addresses=0.0.0.0”-part left in the system. You cannot delete
it besides deleting and recreating the whole rule.

greetings, tony