[OpenSIPS-Users] multihomed routing

Stanislav Kutil mammal at vol.cz
Tue Feb 28 13:46:25 CET 2012


I'm facing the following issue:

I'm trying to use opensips as a general UDP/TCP(TLS) translator between clients (using TCP/TLS) and servers (using UDP).
It's mostly working, but there's a slight issue.

I dedicated eth0 x.x.x.10 to be the client interface and eth0:0 x.x.x.11 to be the server interface. Then I use force_send_socket() to route the packets through the right interface.

However if the request comes from the client on eth0, they are processed correctly, forced to be sent using x.x.x.11 (it's reflected in Via) and sent out, but the source IP address of the packet is still x.x.x.10.

It seems the problem is in Linux routing because the default gateway is using eth0 and it doesn't pay attention to the IP address the socket is bound to. We cannot differentiate the traffic using the destination IP range either.
Both client IP range and server IP range are arbitrary.

The solution still works because RFC3261 says that if the received IP and the topmost Via IP differs it should be sent to where it is received from but I'd still like the traffic for the servers to come from x.x.x.11. Right now, the client originated requests and responses to them are always handled using the x.x.x.10 interface. The server originated requests hit x.x.x.11 correctly (because of the Contact and Record-Route headers).

Is there a solution to this? 

Stan


More information about the Users mailing list