I don’t know if this is a bug, a feature, or simply the way UDP traffic works and i’ve never heard about it
I’ve been troubleshooting an issue with SNMP being unreachable to a particular destination (Router E in the below example), yet pings and all other ICMP or TCP based traffic work fine
I’ve done a traceroute and found there is asymmetrical routing. The traffic paths are as follows
Device1->A->B->C->D->E (E being the destination, a MikroTik Router)
E->B->A->Device1
This works fine no problems at all, except for UDP traffic. For some reason when using UDP, E returns traffic back out the interface it received it on, creating a routing loop
Device1->A->B->C->D->E
E->D->E->D->E->D->E->D etc until packet dies
Router D has no firewall rules at all, no NAT, no mangle, nothing
Router E has rules but nothing in mangle other than QoS marks (nothing influences routing)
The ‘best route’ on RouterE is its default route which points to B, so traffic should go there. Instead it goes out the same interface it received the packet on. So why is it this the case for UDP packets but not TCP/ICMP?
It’s a rather large config that I don’t want to post, even with hide sensitive
But the only parts should affect routing are in the ip routes and ip firewall section. There’s no route so it should use the default one, and there’s no firewall rules affecting this
I didn’t say that. There is OSPF in the network, and BGP at Router B to other routers (including E)
All routers do have a specific route to E
E does not have a specific route to the original source, so it uses it’s default gateway which is B
D also doesn’t have a specific route, so again it uses it’s default gateway which is E
Because E is always present in the routing table it’s going to go via that route. The original source isn’t so it’ll use the default gateway. This is all laid out in the original post
The thing is routing tables don’t care about what protocol it is. I should be seeing the same behavior with TCP, UDP, ICMP, GRE, take your pick. They should all follow the exact same route.
The only area’s that could affect this are NAT or Mangle. There are no rules in either that affect traffic flow to/from any of these devices, and there’s nothing specific to UDP
Maybe the problem you are experiencing with SNMP can be solved by defining the src-address parameter in the SNMP agent in router E. You should configure the IP address you are querying (probably a loopback).