Hello,
I have a problem for many years, and I suddenly decided to resolve it...
I have it with different hardware, and I had it also with PVE 4, I think.
I have servers with only one IPv4 so I do NAT.
I have for the main interface:
Let's take two VM:
Nginx does proxy to 10.10.10.103:443 etc.
Everything is OK, but sometimes I have 502 errors (Nginx does not "find" 10.10.10.103).
It has been years. Since it's only personal traffic, I haven't cared much about... And I use also IPV6, everything is fine without NAT.
I ran tcpdump and saw that on the nginx VM, FreeBSD makes a TCP connection and the Linux answers with a RST, ACK.
It's on bare metal, the CPU use is very very low (with 4 or 12 cores 3Ghz+ ) and traffic is very very low too (with an average of 5 Mbps).
I had also the same problem with Nginx on Linux. I have it also with other web servers than VM 103.
I use the PVE firewall.
Would you have any idea?
I have a problem for many years, and I suddenly decided to resolve it...
I have it with different hardware, and I had it also with PVE 4, I think.
I have servers with only one IPv4 so I do NAT.
I have for the main interface:
Code:
auto vmbr0
iface vmbr0 inet static
address 10.10.8.1/21
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.8.0/21' -o eno3 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.8.0/21' -o eno3 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
post-up /root/nat-rules
Let's take two VM:
- VM 106, FreeBSD with nginx acting as reverse proxy, with IP 10.10.10.106 (net:virtio)
- VM 103, Linux with a Web server, with IP 10.10.10.103 (net:virtio)
Nginx does proxy to 10.10.10.103:443 etc.
Everything is OK, but sometimes I have 502 errors (Nginx does not "find" 10.10.10.103).
It has been years. Since it's only personal traffic, I haven't cared much about... And I use also IPV6, everything is fine without NAT.
I ran tcpdump and saw that on the nginx VM, FreeBSD makes a TCP connection and the Linux answers with a RST, ACK.
Code:
Internet Protocol Version 4, Src: 10.10.10.106, Dst: 10.10.10.103
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 60
Identification: 0x0000 (0)
Flags: 0x40, Don't fragment
...0 0000 0000 0000 = Fragment Offset: 0
Time to Live: 64
Protocol: TCP (6)
Header Checksum: 0x11d8 [validation disabled]
[Header checksum status: Unverified]
Source Address: 10.10.10.106
Destination Address: 10.10.10.103
Transmission Control Protocol, Src Port: 37373, Dst Port: 443, Seq: 0, Len: 0
Source Port: 37373
Destination Port: 443
[Stream index: 13]
[Conversation completeness: Incomplete (37)]
[TCP Segment Len: 0]
Sequence Number: 0 (relative sequence number)
Sequence Number (raw): 1858107831
[Next Sequence Number: 1 (relative sequence number)]
Acknowledgment Number: 0
Acknowledgment number (raw): 0
1010 .... = Header Length: 40 bytes (10)
Flags: 0x002 (SYN)
Window: 65535
[Calculated window size: 65535]
Checksum: 0x2913 [unverified]
[Checksum Status: Unverified]
Urgent Pointer: 0
Options: (20 bytes), Maximum segment size, No-Operation (NOP), Window scale, SACK permitted, Timestamps
[Timestamps]
Code:
Internet Protocol Version 4, Src: 10.10.10.103, Dst: 10.10.10.106
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 40
Identification: 0x0000 (0)
Flags: 0x40, Don't fragment
...0 0000 0000 0000 = Fragment Offset: 0
Time to Live: 64
Protocol: TCP (6)
Header Checksum: 0x11ec [validation disabled]
[Header checksum status: Unverified]
Source Address: 10.10.10.103
Destination Address: 10.10.10.106
Transmission Control Protocol, Src Port: 443, Dst Port: 37373, Seq: 1, Ack: 1, Len: 0
Source Port: 443
Destination Port: 37373
[Stream index: 13]
[Conversation completeness: Incomplete (37)]
[TCP Segment Len: 0]
Sequence Number: 1 (relative sequence number)
Sequence Number (raw): 0
[Next Sequence Number: 1 (relative sequence number)]
Acknowledgment Number: 1 (relative ack number)
Acknowledgment number (raw): 1858107832
0101 .... = Header Length: 20 bytes (5)
Flags: 0x014 (RST, ACK)
Window: 0
[Calculated window size: 0]
[Window size scaling factor: -1 (unknown)]
Checksum: 0x28ff [unverified]
[Checksum Status: Unverified]
Urgent Pointer: 0
[Timestamps]
[SEQ/ACK analysis]
It's on bare metal, the CPU use is very very low (with 4 or 12 cores 3Ghz+ ) and traffic is very very low too (with an average of 5 Mbps).
I had also the same problem with Nginx on Linux. I have it also with other web servers than VM 103.
I use the PVE firewall.
Would you have any idea?