[Asterisk-Users] answer from wrong port

Benjamin Lawetz benthos at step.polymtl.ca
Tue Aug 31 08:35:59 MST 2004


Hi everyone,
I'm having a little problem and was wondering whether anyone would have 
any ideas or pointers for me.

I've been working on load-balancing asterisk and have had a pretty 
successful setup using LVS and IP tunneling (plus a bit of iptables 
nating).
I am only load balancing the SIP registration while the RTP between the 
SIP phone and the asterisk server and between the asterisk server and the 
CISCO AS5300 is being done directly with the real IP.

Now this setup worked wonderfully, and I had tested with SIP phones behind 
different routers to see if Natting wasn't causing a problem and 
everything worked fine.

But one of my locations recently changed routers (Linksys WRT54G)
and the SIP phone no longer registers with the asterisk servers.
After a bit of sniffing adn testing, here's what I came up with.
If the phone connects directly to the asterisk server without 
load-balancing, it works fine.
If the phone connects to the asterisk server through the load-balancing, 
the REGISTER packet comes into the asterisk server, but the reply instead 
of being sent-out from source-port 5060, it's sent out from source-port 
1343 (or other lowest free port (1024,1026) and is blocked at the 
linksys gateway.

Any ideas why asterisk doesn't use the 5060 source port in the reply?

I'm unfortunately using version 0.9.0 of asterisk (my boss doesn't want to 
go with CVS).

P.S. The iptables part of the load-balancing NATs the source IP of the 
reply packets as being from the virtual IP because asterisk sets it as 
from the real IP. The rest is "normal" lvs

Thanks for any help
Benjamin

-- 
       \\\|///
     \\  - -  //
      (  @ @  )
---oOOo-(_)-oOOo-------------------------------
There are times when truth is stranger than fiction and lunch time is one
of them.
--------------Oooo-----------------------------
      oooO    (   )   Benjamin Benthos Lawetz
      (  )     ) /    mailto:benthos at step.polymtl.ca
       \ (    (_/     ICQ# 4269530
        \_)



More information about the asterisk-users mailing list