I have 2 servers in HA mode using CARP, using virtual IP 192.168.1.95. Each server has a real IP of 192.168.2.75/76
When the haproxy that's running on the master server - 192.168.1.95 sends a reply back to a client, it first sends the reply back to the local network gateway ( 192.168.1.1 ) instead of directly to the client!
It's been driving me crazy because I can't figure out how this happens. This is on FreeBSD 12.1-p12
For example:
tcpdump -en output:
The local firewall ( also FreeBSD ) receives the packets and redirects them. It looks like this:
For client->CARP server the communication happens directly. It's only the return packets that go through the local gateway.
Am I going crazy here ? How can packets destined for one IP/mac address go to my default gateway ??
When the haproxy that's running on the master server - 192.168.1.95 sends a reply back to a client, it first sends the reply back to the local network gateway ( 192.168.1.1 ) instead of directly to the client!
It's been driving me crazy because I can't figure out how this happens. This is on FreeBSD 12.1-p12
For example:
Code:
arp -an
? (192.168.1.35) at 00:50:56:85:2c:f1 on em0 expires in 1199 seconds [ethernet]
? (192.168.2.1) at 00:50:56:bc:00:3c on em0 expires in 1123 seconds [ethernet]
? (192.168.1.1) at 00:50:56:bc:00:3c on em0 expires in 1190 seconds [ethernet]
Code:
12:21:42.848617 00:0c:29:73:b4:bb > 00:50:56:bc:00:3c, ethertype IPv4 (0x0800), length 66: 192.168.1.95.3306 > 192.168.1.35.42691: Flags [.], ack 1713257743, win 513, options [nop,nop,TS val 1354880564 ecr 1570829278], length 0
12:21:42.848933 00:0c:29:73:b4:bb > 00:50:56:bc:00:3c, ethertype IPv4 (0x0800), length 77: 192.168.1.95.3306 > 192.168.1.35.42691: Flags [P.], seq 0:11, ack 1, win 513, options [nop,nop,TS val 1354880564 ecr 1570829278], length 11
The local firewall ( also FreeBSD ) receives the packets and redirects them. It looks like this:
Code:
09:40:15.611039 00:0c:29:73:b4:bb > 00:50:56:bc:00:3c, ethertype IPv4 (0x0800), length 551: 192.168.1.95.3306 > 192.168.1.35.42691: Flags [P.], seq 5717:6202, ack 1460, win 513, options [nop,nop,TS val 1345193324 ecr 1561142039], length 485
09:40:15.611051 00:50:56:bc:00:3c > 00:50:56:85:2c:f1, ethertype IPv4 (0x0800), length 551: 192.168.1.95.3306 > 192.168.1.35.42691: Flags [P.], seq 5717:6202, ack 1460, win 513, options [nop,nop,TS val 1345193324 ecr 1561142039], length 485
For client->CARP server the communication happens directly. It's only the return packets that go through the local gateway.
Am I going crazy here ? How can packets destined for one IP/mac address go to my default gateway ??