1828584 Members
2700 Online
109982 Solutions
New Discussion

@ bonds

 
Nag_linux
New Member

@ bonds

Hi,
I have set up 2 bonds on RED HAT. I am having an issue where all the outgoing packets have the source IP of the server.

Here is an Ex : Apache connects to TomCAT.
IP 1 : 10.20.40.1 ( Primary IP)
IP 2 : 10.250.40.2 ( RUnning Apache )

When i do netstat, i see all the connections from
10.250.40.1 and the tomcat. Even thou i am running on 10.250.40.2

Can any one please shed some light on this or help me in this issue


3 REPLIES 3
skt_skt
Honored Contributor
Steven E. Protter
Exalted Contributor

Re: @ bonds

Shalom,

In httpd.conf you can specify the ip address for apache to listen on. This will probably help with the source ip address on the traffic.

To be more helpful, I'd need to see ethtool output from bond0 bond1 and all eth# involved in the bonding.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
rick jones
Honored Contributor

Re: @ bonds

The point about picking a specific IP to which you would have Apache bind() is a good one. And it may need to go a little farther.

When a listen endpoint is created (netstat -an | grep LISTEN and look for your port 80 entry or whatever port you have Apache on) and not bound to a given IP, then the source IP will be based on the destination IP used by the remote to reach the server.

So, if the remote used 10.250.40.1 to establish the connection to Apache, that is what the system will use as the source IP.

Now, if you do bind() Apache to 10.250.40.1 explicitly, you have to make certain that the remotes use _that_ IP address in their connection requests. Likely as not they will get the IP address from a hostname to IP lookup (eg getaddrinfo()) and so you want to look into what mappings there are from the hostname(s) in use to IP addresses.

Now if Apache is the one establishing connections, you still want to check the name resolution angle, but to make certain the source IP is what you want, you do want Apache to bind() the socket() on which it will connect() to Tomcat with the desired IP.
there is no rest for the wicked yet the virtuous have no pillows