All pastes #290142 Raw Edit

Unnamed

public text v1 · immutable
#290142 ·published 2006-12-23 18:47 UTC
rendered paste body
The server below is the server i setup LVS on:

IP Address on eth0: 192.168.9.53  gw 192.168.9.1  (public has access to the internet etc..)
IP Address on eth1: 192.168.8.53  (no gw)

mango ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.9.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.9.1     0.0.0.0         UG    0      0        0 eth0

NABLE_FORWARDING_IPv4="yes" and via sysctl.conf 

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
ipvsadm -A -t 192.168.9.53:80 -s wlc 
ipvsadm -a -t 192.168.9.53:80 -r 192.168.8.54:80 -m 
ipvsadm -a -t 192.168.9.53:80 -r 192.168.8.55:80 -m -w 2 


Machine with IP 192.168.9.54 and 192.168.8.54 (web server on port 80 is working)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.9.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.9.1     0.0.0.0         UG    0      0        0 eth1


Machine with IP 192.168.9.55 and 192.168.8.55  (web server on port 80 is working)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.9.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.9.1     0.0.0.0         UG    0      0        0 eth1



Basically what I want to do is, when connecting from another machine on the .9 network to 192.168.9.53 on port 80,the connection should be forwarded to 192.168.8.54 or .54 on port 80.  

I looked at tcpdump I see that the connection is being forwarded correctly, but i don't 
get a reply back. From the server where i run LVS on, i can ping both networks


The server where i initiate the telnet command is:

Machine with IP 192.168.9.12 and 192.168.8.12  (web server on port 80 is working)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.9.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.9.1     0.0.0.0         UG    0      0        0 eth1