While All the machines can connect to the CentOS server, two machines can not access the same port at the same time.
How the traffic is routed looks like this.
--------------------------------------------------------
Local Machine 1: 192.168.1.10 (M1)
Local Machine 2: 192.168.1.11 (M2)
CentOS Server: 192.168.1.20 (COS)
Outside Machine 1: 168.X.X.1 (OM1)
Outside Machine 1: 168.X.X.2 (OM2)
--------------------------------------------------------
All the 192.168.X.X Machines are behind the same NAT and have the same public IP.
192.168.1.20:10000 (COS) Routes traffic to 168.X.X.1:50000 (OM1)
192.168.1.20:10001 (COS) Routes traffic to 168.X.X.2:50000 (OM2)
Commands Used:
Code: Select all
firewall-cmd --add-port=10000/tcp --permanent
firewall-cmd --add-port=10001/tcp --permanent
firewall-cmd --add-masquerade --permanent
firewall-cmd --permanent --add-forward-port=port=10000:proto=tcp:toport=50000:toaddr=168.X.X.1
firewall-cmd --permanent --add-forward-port=port=10001:proto=tcp:toport=50000:toaddr=168.X.X.2
firewall-cmd --reload
192.168.1.10 (M1) connects to port 10000 of 192.168.1.20 (COS) the traffic is routed to 168.X.X.1 (OM1) Port 50000.
192.168.1.11 (M2) connects to port 10001 of 192.168.1.20 (COS) the traffic is routed to 168.X.X.2 (OM2) Port 50000.
But when.
192.168.1.10 (M1) connects to port 10000 of 192.168.1.20 (COS) the traffic is routed to 168.X.X.1 (OM1) Port 50000
and
192.168.1.11 (M2) connects to port 10000 of 192.168.1.20 (COS) I receive "curl: (7) Failed to connect to 192.168.1.20 port 10000: Timed out"
It should be noted that the same issue happens when I try to connect from (M1) and (M2) to (OM1) at the same time directly, I was hopping using (COS) as a middle man it would solve the issue but I again receive the same error, Could be an issue with the (OM1) but the weird part is that (M1) creates 100s of concurrent connections to (OM1) with no errors or problems.