I am testing a basic lvs/ipvsadm implementation.
- 192.168.1.200 is the Loadbalance Director (Master LB), At the moment I am not testing a VIP.
1.1 enabled sysctl -w net.ipv4.ip_forward=1 in the Loadbalance Director
1.2 firewall-cmd --permanent --add-port=80/tcp
1.3
ipvsadm -A -t 192.168.1.200:80 -s rr
ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.201:80 -g
ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.202:80 -g
Test Results
[root@lb ~]# ipvsadm -Lnc
IPVS connection entries
pro expire state source virtual destination
TCP 00:53 SYN_RECV 192.168.1.200:35416 192.168.1.200:80 192.168.1.201:80
TCP 00:42 SYN_RECV 192.168.1.200:35410 192.168.1.200:80 192.168.1.202:80
- 192.168.1.201 - Real Server 1 --> Apache server is running on port 80
2.1 firewall-cmd --permanent --add-port=80/tcp
2.2 echo 2 > /proc/sys/net/ipv4/conf/enp0s3/rp_filter
- 192.168.1.202 - Real Server 2 --> Apache server is running on port 80
3.1 firewall-cmd --permanent --add-port=80/tcp
3.2 echo 2 > /proc/sys/net/ipv4/conf/enp0s3/rp_filter
However when I am testing from a external client and the LB director itself, I don't get the real servers pages. curl request is hang.
May I check with you, what I have done wrongly or what configurations i have not done to achieve the basic implementation?
Thanks in Advance
Luke