Bind S2S to a specific IP address

Finally found out what goes wrong with my connections towards jabber.org. My jabber server has multiple IP addresses, RFC numbers on the interfaces, public addresses on the loopback. That means that *unless* the outgoing socket is bound to an IP address, it will use the RFC address and get NATted out via the internet gateway.

I can use the {ip,{...}} on the {listen,...} section in the configuration, but that's only for c2s, s2s_in and other funkies, but not s2s_out:

T 10.192.0.1:62594 -> 208.245.212.98:5269 [AP]

I expected 202.83.176.32 there (which is the IP address of jabber.barnet.com.au, and the IP address s2s_in is bound to.
Is there anybody who knows if this can be fixed in the configuration file, or that it should be done in the file ejabberd_s2s_out.erl?

Thanks in advance, edwin@barnet.com.au

hard coding it is easy...

(21:34:19) mavetju: line 115 of ejabberd_s2s_out.erl, it creates the socket. Can I give the information from there?
(21:35:33) badlop: i have this on line 142 (I'm using svn :P ):
open_socket(init, StateData) ->
...
case catch gen_tcp:connect(ASCIIAddr, Port,[binary, {packet, 0}, {active, false}]) of
(21:35:44) mavetjut: yes
(21:35:55) mavetjut: asciiaddr is the destination
(21:35:58) mavetjut: port is the destination.
(21:36:03) badlop: yes, you can try to add the option to:
[binary, {packet, 0}, {active, false}, {ip, ...}]

I have added this, and now my outgoing TCP sessions are going happily via the IP address defined.

Only problem, jabber.org *still* doesn't like me.

jabber.org and a SRV > CNAME > A redirection

> Only problem, jabber.org *still* doesn't like me.

The reason is that you have srv record for barnet.com.au pointing to a CNAME

;; QUESTION SECTION:
;jabber.barnet.com.au. IN A

;; ANSWER SECTION:
jabber.barnet.com.au. 2275 IN CNAME mag.barnet.com.au.

And there is a known bug (or also may be called a strict implementation of RFC-2782) in jabber.org's resolver — they just cannot resolve such double redirections X)

Ref:

http://www.jabber.org/chatbot/logs/conference.jabber.org/jdev/2003-11-11.html
http://mail.jabber.org/pipermail/jadmin/2004-April/015326.html
http://www.jabber.org/muc-logs/jdev@conference.jabber.org/2005-03-10.html

It has been added to Bugzilla

It has been added to ejabberd's bugzilla:
Bug 181: Add option to bind S2S_out to a specific IP address

Proposition to extend Bugzilla request

Maybe it would be also possible to extend the request to add possiblity to bind S2S_out to a specific cluster node (of course if specific IP address won't solve this).

I think that s2s_in and

I think that s2s_in and s2s_out options are particular for every ejabberd node. So you can set them differently for every specific cluster node, right?

Syndicate content