You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by 心冶独孤 <qa...@foxmail.com> on 2014/04/18 07:27:27 UTC
how to get the real client ip--Emergency
Hi,
I am using Mina to developing a server program.
When the client directly connects to the server, using the following code I can get the ip:
String clientIP = ((InetSocketAddress)session.getRemoteAddress()).getAddress().getHostAddress();
But, when we use a F5(load balance machine) between the client and server, I can't get the real ip now.
Instead, I get the virtual ip(LAN ip) from F5.
I need the real ip, can you help me?
Emergency
Best Regards,
Jerry
China
Re: how to get the real client ip--Emergency
Posted by Christopher Popp <ch...@yahoo.com>.
You can configure the F5 to not translate the client address. If you set the F5 up this way you'll get the client's IP address while still being able to use the F5 for load balancing. https://devcentral.f5.com/questions/maintain-client-ip-address
Chris
On Friday, April 18, 2014 3:30 AM, Emmanuel Lécharny <el...@gmail.com> wrote:
Le 4/18/14 7:27 AM, 心冶独孤 a écrit :
> Hi,
>
>
> I am using Mina to developing a server program.
> When the client directly connects to the server, using the following code I can get the ip:
> String clientIP = ((InetSocketAddress)session.getRemoteAddress()).getAddress().getHostAddress();
> But, when we use a F5(load balance machine) between the client and server, I can't get the real ip now.
> Instead, I get the virtual ip(LAN ip) from F5.
Plain normal. The IP address you get is the address of the socket, which
is the socket to the F5.
> I need the real ip, can you help me?
No, we can't. This is simply not possible.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: how to get the real client ip--Emergency
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 4/18/14 7:27 AM, 心冶独孤 a écrit :
> Hi,
>
>
> I am using Mina to developing a server program.
> When the client directly connects to the server, using the following code I can get the ip:
> String clientIP = ((InetSocketAddress)session.getRemoteAddress()).getAddress().getHostAddress();
> But, when we use a F5(load balance machine) between the client and server, I can't get the real ip now.
> Instead, I get the virtual ip(LAN ip) from F5.
Plain normal. The IP address you get is the address of the socket, which
is the socket to the F5.
> I need the real ip, can you help me?
No, we can't. This is simply not possible.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com