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 was reading the manpage for traceroute, and I noticed it accepts a port argument.

I thought traceroute worked only with ICMP. What does it do with the port?

share|improve this question
    
ICMP does not use a port since it does not have a place for a port. It is encapsulated with an IP datagram only. You will find the port option only on UDP and TCP datagrams. To block ICMP echo, you would explicitly block the type and code. –  djshortbus Jul 27 '10 at 0:55

2 Answers 2

up vote 1 down vote accepted

Traceroute (classical mode) works by sending UDP packets to a high, theoretically unused UDP port, changing the time to live (TTL) for each packet so that routers along the way notice that it has timed out and return ICMP time exceeded messages. Traceroute then prints those messages out until it gets a message from the destination host denying the connection.

You can change the port in case the default port is in use (thus preventing that last hop from working because the packet is silently accepted).

There is a wealth of information in the man page for traceroute on your standard Linux distro.

share|improve this answer

That's in case ICMP is blocked somewhere along the way.

You could for example use port 80 (http) because almost any firewall will allow it to pass through.

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.