Linux – Unable to download file using WGET on AWS instance enabled SR

amazon ec2amazon-web-serviceslinuxnetworking

I have the following topology 1, where there are 4 Cisco Routers deployed in each VPC. I am able to ping and generate traffic from Endpoint1:172.0.1.11 to Endpoint2:172.2.1.10 where the traffic passes through a set of paths called Segment Routing which I have defined in the router R1 e.g., (Endpoint1, R1, R2, R3, R2, R1, R2, R3, Endpoint2).

I have got apache installed in both instances, then I put the file that I'd like to download from the client side in the server Endpoint1 and put into a folder /var/www/files/.
Note that, both instances endpoints are in different VPCs.

I aim to send 100Mb file from Endpoint1 to Endpoint2.

In the client instance Endpoint2, I did the following:

curl http://172.0.1.11/files/ubuntu-18.04.2-live-server-amd64.iso

I tried also:

wget http://172.0.1.11/files/ubuntu-18.04.2-live-server-amd64.iso

the logs show:

172.2.1.10 - - [19/Jun/2019:13:20:24 +0000] "GET /files/ubuntu-18.04.2-live-server-amd64.iso HTTP/1.1" 200 295317 "-" "curl/7.58.0"

But both are taking long time, and here what I got from Endpoint2

Connecting to 172.0.1.11:80... connected.
HTTP request sent, awaiting response... 

this is The iptables of Endpoint1 is the following:

ubuntu@ip-172-0-1-11:~$ sudo iptables -L -n -v

Chain INPUT (policy ACCEPT 517 packets, 35198 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 425 packets, 70378 bytes)
 pkts bytes target     prot opt in     out     source               destination         

I tried with iperf and it sends the traffic normally.
On the server side:

ubuntu@ip-172-0-1-11:~$ iperf -s -u

and the client:

iperf -c 172.0.1.11 -u -b 20m 

UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.2.1.10 port 38402 connected with 172.0.1.11 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  23.8 MBytes  20.0 Mbits/sec
[  3] Sent 17008 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec  23.8 MBytes  20.0 Mbits/sec   0.000 ms   20/17008 (0%)

I even tried telnet. It seems that there is a connection between server and client. As well as the client side.

ubuntu@ip-172-2-1-10:~$ telnet 172.0.1.11 80
Trying 172.0.1.11...
Connected to 172.0.1.11.

Seems everything is working, except downloading the file.

Best Answer

As Best i know :

instead of struggling with iptables stuff,

Execute below command where your HTTPD / Apache web-servers installed

iptables -F

Have a great day future friend .!