Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a dedicated server running Ubuntu 10.04.

Trying to access a certain URL (HTTP-based API service) results in timeouts. I tried curl, wget and others.

It was working OK until recently. I can access the URL from my local machine and other servers.

Although it looks like API provider may have blocked inbound requests from my server, it is very unlikely because the API was used very ocassionally.

What are the best ways to debug it? What places can I check to see if it is not my server or network blocking this outbound request?

share|improve this question

1 Answer 1

One of the things to try is to sniff the traffic leaving your PC (and your router if you have a Linux router). You can do this with tcpdump. For example, if the IP address of the site you are going to is "1.2.3.4", the protocol is HTTP and your Internet connection is on eth0, you could try (as root)

tcpdump -n -i eth0 src or dst 1.2.3.4 and port 80

and then going to the URL to check to get an idea if packets are coming in and out of your box. If you are seeing packets in both directions you can try

tcpdump -A -s 1500 -n -i eth0 src or dst 1.2.3.4 and port 80 | tee hit.dump

To get a dump of the traffic entering and leaving your box (or network).

If TCPDump shows packes leaving but not entering your network, you should double-check your iptables rules (but these are unlikely to be a problem). You can list these with

/sbin/iptables -vnL

and inspecting the output.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.