Possible to set source IP address in queue route setup in C++ broker?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible to set source IP address in queue route setup in C++ broker?

Steve Huston
I'm using the C++ broker and I am setting up queue pull routes to another broker. I want to be able to have my local broker set a virtual IP address as the IP source address when connecting to the remote broker it will pull from. Is this possible using current broker capabilities?

I tried to force it using qpid-route, but don't see a way. I tried looking through the source as well but did not find a way to specify that.

Thanks,
-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Possible to set source IP address in queue route setup in C++ broker?

Gordon Sim
On 22/08/17 21:22, Steve Huston wrote:
> I'm using the C++ broker and I am setting up queue pull routes to
> another broker. I want to be able to have my local broker set a
> virtual IP address as the IP source address when connecting to the
> remote broker it will pull from. Is this possible using current
> broker capabilities?

I don't understand the question properly. When creating a pull route you
always have to supply the host/ip that the destination broker will
connect to in order to pull the messages. If that is a virtual IP, I
don't think anything in the broker or the qpid-route tool should care?

I'm probably misunderstanding what you are trying to do though, can you
elaborate a bit more?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Possible to set source IP address in queue route setup in C++ broker?

Steve Huston
Thanks for replying, Gordon - sorry for the confusing terms.

> On 22/08/17 21:22, Steve Huston wrote:
> > I'm using the C++ broker and I am setting up queue pull routes to
> > another broker. I want to be able to have my local broker set a
> > virtual IP address as the IP source address when connecting to the
> > remote broker it will pull from. Is this possible using current broker
> > capabilities?
>
> I don't understand the question properly. When creating a pull route you
> always have to supply the host/ip that the destination broker will connect to
> in order to pull the messages. If that is a virtual IP, I don't think anything in
> the broker or the qpid-route tool should care?
>
> I'm probably misunderstanding what you are trying to do though, can you
> elaborate a bit more?

- Host A wants to set up a pull route to pull messages from Host B
- Host A has two IP addresses assigned to it
- When Host A connects to B, can A specify a particular source IP address that B will see it as?

The situation is there's a firewall between A and B; only one of A's addresses is reachable from outside that firewall. We're trying to prevent having to NAT/PAT A's address at the firewall.

Thanks,
-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Possible to set source IP address in queue route setup in C++ broker?

Gordon Sim
On 23/08/17 17:35, Steve Huston wrote:
> - Host A wants to set up a pull route to pull messages from Host B
> - Host A has two IP addresses assigned to it
> - When Host A connects to B, can A specify a particular source IP address that B will see it as?

Ah, makes sense. Sorry for my confusion, your original wording actually
described it perfectly, I just jumped to the wrong interpretation!

Unfortunately the broker doesn't allow the source ip to be explicitly
set at present. There is quite a chain of calls that the chosen source
ip would need to be passed along for a per 'link' (i.e. inter-broker
connection) option. Slightly simpler would be a broker level option used
for all outgoing connections.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Possible to set source IP address in queue route setup in C++ broker?

aconway.rh
On Wed, 2017-08-23 at 17:58 +0100, Gordon Sim wrote:
> On 23/08/17 17:35, Steve Huston wrote:
> > - Host A wants to set up a pull route to pull messages from Host B
> > - Host A has two IP addresses assigned to it
> > - When Host A connects to B, can A specify a particular source IP address that B will see it as?
>

When you say "see it as" do you mean via POSIX getpeername() or
equivalent? This is possible at the socket level using SO_BINDTODEVICE:

https://stackoverflow.com/questions/4404572/bind-before-connect-at-clie
nt-code

How common do you think this use case might be? Using getpeername() at
the socket layer is low-level and less flexible than passing a reply_to
address or a link/connection property at the AMQP layer. The socket
layer peer name only works for a direct TCP connection, a reply_to can
redirected/load balanced/bridged to private networks via dispatch
router, can allow DNS redirect/load balancing etc.

Cheers,
Alan.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]