twk87
twk87

Reputation: 33

many ip addresses on machine, set outgoing ip java

I recently got a machine with 10 IPv6 addresses, this is a CentOS running MySQL and tomcat, I'm using spring to create servlets.

I was wondering is there a Java way (not OS routing tables) to set the outgoing IP from the ones available on my server?

What I am trying to do is have a incoming address reach the servlets and do an http post from a specific IP accordingly.

For all my research the thing I saw closest to solving this would be httplib, but is there something like this for Java?

Upvotes: 3

Views: 2058

Answers (1)

Mark
Mark

Reputation: 2473

just use localaddr parameter in your socket.

Pretty much duplicate question here:

Upvotes: 4

Related Questions