IP forwarding differences between Amazon Linux 2 and RHEL9

Posted by a-sad-dev@reddit | linuxadmin | View on Reddit | 17 comments

Hi, I've been migrating from AL2 -> RHEL9 in our AWS EC2 environment and one issue I'm coming across is switching the AMI from AL2 -> RHEL9 is causing IP forwarding issues on our proxy VM's. The instance in question that's being replaced is working as a squid proxy and is the default route for the subnet it resides in (technically an ENI attached to the VM is the default route). The process in question is VM1 is attempting to connect via SFTP to an external endpoint on the internet and traffic is routing through VM2 which is running as a proxy VM (squid for HTTP traffic). All non HTTP traffic should transparrently flow through the machine which is the case with AL2 but switching to RHEL9 causes the connection to drop. So far I've checked the following: - iptables rules for port forwarding as well as NAT tables (identical on both machines) - ran cat /proc/sys/net/ipv4/ip_forward on both machines and both return 1 (ip forwarding enabled) - SELinux set to enabled, passive and disabled - has no affect either way - Squid settings identical (don't think this will matter for sftp on non http port) - All routing settings and security groups are unchanged in AWS - only thing swapped out is base AMI - No entry in squid access log for SFTP connections

To test I run an sftp command from VM1 and with AL2 squid VM the connection succeeds, with RHEL squid VM the connection hangs. Am I missing something obvious here? Any other areas I can investigate?

Kind of running out of ideas, thanks for reading and I hope it makes sense.