Bind IP address for S2S

Hi to all.
I have a computer PC1 with ejabberd and 2 network interface on board.
The IP address of network interfaces are: 10.11.9.1 (eth0) and 10.11.4.29 (eth1).
Then I have 2 virtual host on ejabberd, called: warning and alarm and I have 2 user, one is logged on warning (user1@warning) and one is logged on alarm (user2@alarm).

Then I have another computer PC2 with ejabberd and 1 network interface with IP address: 10.11.7.1 (eth0); on this server (called autotreno) I have an user logged: user3@autotreno.

Between PC1 and PC2 I have a router with 3 network interfaces. The plan is this:

user2
10.11.9.1 <----------> 10.11.9.12

_________________________________________user3
_________________10.11.7.12 <-------------> (10.11.7.1)

user1
10.11.4.29 <--------> 10.11.4.12

PC1_______________router_________________PC2

I have done 2 connection S2S, one PC1<--->PC3 and one PC2<--->PC3.

Now, what I want is bind IP address for each virtual host on PC1:
10.11.4.29 <-> warning
10.11.9.1 <-> alarm

(in file /etc/hosts I have already done this mapping)

I want this because packets that I send from user1 must have IP 10.11.4.29 and packets that I send from user2 must have IP 10.11.9.1. Instead, now, if I do sniffing on router, I see that the packets from user1 and user2 have all same IP 10.11.9.1 (or same IP 10.11.4.29).

I have already done this:
{ip, {10, 11, 4, 29}}.
on configuration file (at voice Listening Ports) but it don't solve my problem.

Do you understand my problem?
I hope yes.
Thank you to all in advance.
Crystal

Not possible to bind outgoing S2S per vhost to IP

You want to bind the outgoing S2S connections of each vhost to a different IP address. But that is not implemented in ejabberd.

There is a related feature request: Allow definition of local address on outbound s2s, and there is a patch available. However, that patch allows to specify IP address of whole server, not configurable per each vhost.

If you want to use ejabberd, you will need to modify your original plan so ejabberd doesn't need to use specific IP addresses.

Thank you for your

Thank you for your answer!

So, you say that with this patch, can I specify IP address for each virtual host?

Can you tell me how can I install this patch?

I have centOS as OS.

thank you very much....

NOT configurable per vhost

badlop wrote:

that patch allows to specify IP address of whole server, not configurable per each vhost.

crystal wrote:

So, you say that with this patch, can I specify IP address for each virtual host?

Read again my sentence: that patch allows to specify IP address of whole server, NOT configurable per vhost.

Ah ok....thanks....sorry for

Ah ok....thanks....sorry for adjective.

Please, can you tell me how can I install this patch?

sorry, I'm noob.

thank you very much.

A two question: 1) If I will

I have two question:

1) If I will create a different database for each virtual host (and a configuration file ejabberd.cfg for each virtual host), is impossible specify IP address for each virtual host in this case too?

2) Is possibile to specify diffrent outgoing port for each S2S connection of virtual hosts? (outgoing port of packets that go from PC1 to PC3 is different by outgoing port of packets that go from PC2 to PC3).

thanks to all.
crystal

Syndicate content