I'm having a problem with connection tracking and UDP, specifically with OpenVPN (ROSv7).
While the actual configuration is way more complex (PCC load balancing and recursive routing), I have simplyfied the scenario for testing and for posting here.
- There are 2 ISPs: ISP_A and ISP_B
- Configuration is for failover using different distances: 1 for ISP_A and 2 for ISP_B
- Both IP addresses are resolvable on the Internet side
- Mangle/prerouting is used to connection-mark each inbound connection, to allow returning through the proper external interface
- For fowarding connections, Mangle/prerouting is used to set route-mark based on the connection mark (at the start and at the end of the prerouting chain)
- For output connections, Mangle/output is used to convert the connection-mark to route-mark.
- There are route tables with the proper routes to force traffic to a specific ISP, to ensure proper connections.
All works well with TCP connections (both for forwarding and for output). The only other protocol that traverses or leaves the firewall are SIP (properly set in services and working fine for years) and OpenVPN.
My problem is with OpenVPN, inbound: if the connection is addressed the the IP address of ISP_A (that is the active "default" route) it works. But if the connection is addressed to the IP address of ISP_B, that is the backup route, even though the initial UDP packet is being properly connection marked in Mangle/prerouting.
In other words: UDP OpenVPN connections to the server using ISP_A work, and will NOT work usign ISP_B as the target. TCP OpenVPN work for both IP addresses. Log shows the connection but will not show the authentication (I guess it means that the initial package is recognized but after that it stops). Clients claim the conntecion timed-out.
Any ideas?