Hi
Install HAPROXY+KEEPALIVED in the hosts ip
192.168.10.241
&
192.168.20.241
And was configured as follows:
KeepAlived
vrrp_script chk_haproxy {
script "pidof haporxy" # check the haproxy process
interval 2 # every 2 seconds
weight 2 # add 2 points if OK
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 10
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass newpassword
}
virtual_ipaddress {
192.168.10.25324 dev eth0
}
track_script {
chk_haproxy
}
The rest of the configuration file is the default mode
And other script I gave the form configuration
192.168.20.241
backend app
balance roundrobin
server app1 192.168.20.242:80 check
server app2 192.168.20.243:80 check
server app3 192.168.10.242:80 check
server app4 192.168.10.243:80 check
192.168.10.241
backend app
balance roundrobin
server app1 192.168.20.242:80 check
server app2 192.168.20.243:80 check
server app3 192.168.10.242:80 check
server app4 192.168.10.243:80 check
192.168.10.241
vrrp_script chk_haproxy {
script "pidof haporxy" # check the haproxy process
interval 2 # every 2 seconds
weight 2 # add 2 points if OK
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 10
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass newpassword
}
virtual_ipaddress {
192.168.10.25324 dev eth0
}
track_script {
chk_haproxy
}
Configuration file sysctl
sysctl -p
net.ipv4.ip_nonlocal_ind = 1
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmn = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
192.168.20.241
ip a
1: lo: <LOOPACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
linkloopack 00:00:00:00:00:00 rd 00:00:00:00:00:00
inet 127.0.0.18 scope host lo
inet6 ::1128 scope host
valid_lft forever preferred_lft forever
2: eth0: <ROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
linkether 00:0c:29:90:d3:98 rd ff:ff:ff:ff:ff:ff
inet 192.168.20.24124 rd 192.168.20.255 scope gloal eth0
inet 192.168.10.25324 scope gloal eth0
inet6 fe80::20c:29ff:fe90:d39864 scope link
valid_lft forever preferred_lft forever
192.168.10.241
ip a
ip a
1: lo: <LOOPACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
linkloopack 00:00:00:00:00:00 rd 00:00:00:00:00:00
inet 127.0.0.18 scope host lo
inet6 ::1128 scope host
valid_lft forever preferred_lft forever
2: eth0: <ROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
linkether 00:0c:29:74:e:8 rd ff:ff:ff:ff:ff:ff
inet 192.168.10.24124 rd 192.168.10.255 scope gloal eth0
inet 192.168.10.25332 scope gloal eth0
inet6 fe80::20c:29ff:fe74:e864 scope link
valid_lft forever preferred_lft forever
Virtual IP in 192.168.10.241
Works well
but in 192.168.20.241 Does not work
iptales stop
selinux disabled
The two networks that are connected y intranet
excuse me It was long:o
please help me