[OpenSIPS-Users] Fix source IP in a 2-NICs router with openSIPS

Víctor Fernández Martínez vfernandez at barracuda.com
Tue Apr 3 15:31:28 CEST 2012


Hi! I'm trying to set up OpenSIPS in a router with 2 NICs that performs a 
dynamic NAT. It will receive requests from the UACs on eth0 (NIC behind NAT) 
and should forward them through eth1 (public NIC) to an Asterisk outside of 
the NAT. I'm not allowed to configure the Asterisk. I have also configured 
rtpproxy and would like to use it in order to traverse the NAT. I have 
openSIPS listening on both NICs, so the UACs inside of the NAT connect 
directly to the socket of openSIPS in eth0.

The question is: I have tried to use fix_nated_contact() and fix_nated_sdp() but 
they don't actually change the source IP, so I get no RTP traffic. Seems like 
openSIPS doesn't realise there is a NAT, since it receives the requests 
directly through its socket in the LAN. So when I use 
rewritehostport("IP_OF_ASTERISK"), Asterisk is getting the LAN IPs instead of 
the IP of eth1, which is the public IP. I'm using force_send_socket() to force 
openSIPS to send the SIP messages to Asterisk through eth1. Is there some way 
to fix the IPs so Asterisk gets the public IP (eth1)?

Thank you very much in advance.


Barracuda Networks AG
Vorsitzender des Aufsichtsrates/ Chairman of the supervisory board: Dean Drako
Vorstand/ Executive Board: Dr. Wieland Alge, Mag. Guenter Klausner
Sitz der Gesellschaft/ Registered office: 6020 Innsbruck, Austria
Handelsgericht Innsbruck Firmenbuch/ Registration Number: 184392s
UID-Nr/ VAT Number: ATU47509003

Diese Nachricht und allfaellige angehaengte Dokumente sind vertraulich und nur fuer den/die Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Adressat sein, ist jede Offenlegung, Weiterleitung oder sonstige Verwendung dieser Information nicht gestattet. In diesem Fall bitten wir, den Absender zu verstaendigen und die Information zu vernichten. Fuer Uebermittlungsfehler oder sonstige Irrtuemer bei Uebermittlung besteht keine Haftung.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the material. The sender does not accept liability for any errors or omissions as a result of the transmission.


'Like' us on Facebook for exclusive content and other resources on all Barracuda Networks solutions.
Visit http://barracudanetworks.com/facebook





More information about the Users mailing list