Skip to content

My t2.micro cannot access outgoing traffic on port 80

0

Hi all,

my t2.micro, after about 1 minute after a reboot, fails to access outgoing traffic on port 80 (ping, FTP, ssh are all OK). There are no rules about outgoing traffic. The strange thing is that this problem occurs only about a minute after the EC2 is booted. Any suggestions?

Thanks. Ciao. L.

2 Answers
1

Based on your description, it sounds like you're experiencing an issue with outbound HTTP traffic (port 80) from your EC2 instance, while other types of traffic like ping, FTP, and SSH continue to work. The timing aspect - where it fails about a minute after boot - is particularly interesting.

Here are some potential causes and troubleshooting steps:

  1. Security Group Configuration: Even though you mentioned there are no rules about outgoing traffic, double-check your security group's outbound rules. By default, security groups allow all outbound traffic, but if there have been modifications, you might need to explicitly allow outbound traffic on port 80.

  2. Network ACLs (NACLs): Check if there are any Network ACLs applied to your subnet that might be blocking outbound traffic on port 80. Unlike security groups, NACLs are stateless and require explicit allow rules for both inbound and outbound traffic. Ensure there's no deny rule for port 80 in the outbound rules of your NACL.

  3. OS-level Firewall or Configuration: Since the issue occurs a minute after boot, it could be related to a service or script that runs during startup. Check if there are any firewall rules (like iptables) being applied or any services starting that might be blocking outbound HTTP traffic.

  4. System Logs: Examine the system logs for any errors or warnings that appear around the time the outbound connectivity fails. This might provide clues about what's happening.

  5. Resource Constraints: Check if your t2.micro is experiencing any resource constraints. Although you mentioned CPU credits aren't depleted, there might be other resource issues affecting network connectivity.

  6. Application or Service Interference: If you have any applications or services that start shortly after boot, they might be interfering with outbound HTTP traffic.

  7. Try a Full Reboot: Sometimes, a complete instance reboot can resolve connectivity issues, especially if they're related to transient network problems.

The fact that the issue consistently occurs about a minute after boot suggests there's likely a specific process or configuration change happening at that time. Identifying what changes during that period would be key to resolving the issue.
Sources
How to block HTTP/HTTPS access from inside AWS Linux instance? | AWS re:Post
EC2 Instances in the us-east-1 and us-east-2 region can ping outside but not able to curl/wget/telnet | AWS re:Post
outbound connections from ec2 instance stop working after around a day | AWS re:Post

answered a year ago
AWS
EXPERT
reviewed a year ago
0

You mentioned that outbound port 80 does not work after 1 minute, I'm assuming that it worked initially but stops working after 1 minute. If this is the case, maybe check if you have user data script or a custom solution that's modifying your firewalls. Some OS images like Amazon Linux may run cloud agents or config management that modify iptables after boot. Example: firewalld, ufw, cloud-init. Check rules in iptables - /etc/sysconfig/iptables - to see if outbound port 80 is being blocked.

EXPERT
answered a year ago
  • Hi Shajam, no firewalld, ufw, cloud-init used, iptables shows this:

    Chain INPUT (policy ACCEPT) target prot opt source destination

    Chain FORWARD (policy ACCEPT) target prot opt source destination

    Chain OUTPUT (policy ACCEPT) target prot opt source destination

    Thanks for your help.

    Ciao. L.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.