Skip to contentSkip to conversation

traceroute

DISCUSSION Peter Marshall 6 participants 13 messages Jun 30, 2004 – Jul 1, 2004

lore
Share & tools
lore
#0 lore raw

Hi. I was wondering what I would need for rules to have traceroute work through my firewall. (I have a box behind the firewall trying to get out using traceroute).

I have an allow established connections on my forwared chain, and I am allowing anything from the source IP of the box in question to leave ... It appears that the problem is on the packets comming back in .. but I am not sure what I have to do to fix it ....

Thanks

Peter

#1 lore raw
Quoted 8 lines · Peter Marshall

Hi. I was wondering what I would need for rules to have traceroute work through my firewall. (I have a box behind the firewall trying to get out using traceroute).

I have an allow established connections on my forwared chain, and I am allowing anything from the source IP of the box in question to leave ... It appears that the problem is on the packets comming back in .. but I am not sure what I have to do to fix it ....

Allow RELATED packets as well as ESTABLISHED.

Regards,

Antony.

Signature · 10 lines
"It is easy to be blinded to the essential uselessness of them by the sense of 
achievement you get from getting them to work at all. In other words - and 
this is the rock solid principle on which the whole of the Corporation's 
Galaxy-wide success is founded - their fundamental design flaws are 
completely hidden by their superficial design flaws."

 - Douglas Noel Adams

                                                     Please reply to the list;
                                                           please don't CC me.
#12 lore raw
In reply to Peter Marshall
Quoted 7 lines · Peter Marshall

Hi. I was wondering what I would need for rules to have traceroute work through my firewall. (I have a box behind the firewall trying to get out using traceroute).

Have a look to the icmp-types. You can begin by enabling icmp generally.

Regards,
Ruprecht

#2 lore raw
In reply to Antony Stone

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have a similar problem.

My traceroute says:

traceroute to www.google.akadns.net (66.102.11.99), 30 hops max, 38 byte packets
traceroute: sendto: Operation not permitted
1 traceroute: wrote www.google.akadns.net 38 chars, ret=-1
[ ... ]

My setup is rather simple. I have "black-boxed" router connected to the internet, that is able to forward traceroutes. My client is equipped with netfilter.
When I disable my local netfilter on the client, traceroute works fine.

I use

$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

at the beginning of my firewall script.

Nevertheless traceroute does not work.

Do I miss something?

Thanks.

Cheers,

Florian

Quoted 9 lines · Antony Stone
Quoted 6 lines · Peter Marshall

Hi. I was wondering what I would need for rules to have traceroute work through my firewall. (I have a box behind the firewall trying to get out using traceroute).

I have an allow established connections on my forwared chain, and I am allowing anything from the source IP of the box in question to leave

... It

Quoted 10 lines
Quoted 2 lines

appears that the problem is on the packets comming back in .. but I am not sure what I have to do to fix it ....

Allow RELATED packets as well as ESTABLISHED.

Regards,

Antony.

...............................

Someone on the net said:
Frank, have you been sniffing medical samples again? - Hawkeye

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFA4zTswT2gPfZm6tURAoOnAKCtHbVHsvg7nrTBCviE4DVydenpQgCfeVuS jdBS08sKpALhTTMJ+gGYcsc=
=g53n
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 19 lines · Florian Boelstler

Hi,

I have a similar problem.

My traceroute says:

traceroute to www.google.akadns.net (66.102.11.99), 30 hops max, 38 byte packets
traceroute: sendto: Operation not permitted
1 traceroute: wrote www.google.akadns.net 38 chars, ret=-1
[ ... ]

My setup is rather simple. I have "black-boxed" router connected to the internet, that is able to forward traceroutes. My client is equipped with netfilter.
When I disable my local netfilter on the client, traceroute works fine.

I use

Quoted 8 lines

$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

at the beginning of my firewall script.

Nevertheless traceroute does not work.

Do I miss something?

Tell us how you handle NEW packets leaving the machine.

Regards,

Antony.

Signature · 7 lines
"The problem with television is that the people must sit and keep their eyes 
glued on a screen; the average American family hasn't time for it."

 - New York Times, following a demonstration at the 1939 World's Fair.

                                                     Please reply to the list;
                                                           please don't CC me.
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Quoted 1 line · Antony Stone

Tell us how you handle NEW packets leaving the machine.

Well, I just realized by looking at your reply that I only have set:

$IPTABLES -A OUTPUT -p ICMP --icmp-type echo-request -j ACCEPT

Which of the icmp-type displayed "iptables -p icmp -h" do I need to make traceroute work?

By looking at other posts in this thread I've learned that traceroutes are done with echo-requests. Is this true for Linux 2.6.6 ?

Thanks,

Florian

...............................

Someone on the net said:
G'Kar: 2 hours ago my government declared war on the Centari Republic

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFA40BiwT2gPfZm6tURAkaLAJ4zRVtBrVbhxVgcPuCs/ZiGVvX1TACdGJOU eKewKcpjQbMlyTtm9omcJZ8=
=qjuX
-----END PGP SIGNATURE-----

#5 lore raw
Quoted 7 lines · Florian Boelstler

Hi,

Quoted 1 line · Antony Stone

Tell us how you handle NEW packets leaving the machine.

Well, I just realized by looking at your reply that I only have set:

Quoted 7 lines

$IPTABLES -A OUTPUT -p ICMP --icmp-type echo-request -j ACCEPT

Which of the icmp-type displayed "iptables -p icmp -h" do I need to make traceroute work?

By looking at other posts in this thread I've learned that traceroutes are done with echo-requests. Is this true for Linux 2.6.6 ?

No, that's true for Windows systems. Unix machines (Linux included) uses
high-port numbered UDP packets.

Therefore you need to allow UDP packets to leave your machine for you to be able to run traceroute from it.

Regards,

Antony.

Signature · 6 lines
There's no such thing as bad weather - only the wrong clothes.

 - Billy Connolly

                                                     Please reply to the list;
                                                           please don't CC me.
#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Antony Stone
Quoted 2 lines

By looking at other posts in this thread I've learned that traceroutes are done with echo-requests. Is this true for Linux 2.6.6 ?

No, that's true for Windows systems. Unix machines (Linux included)

uses

Quoted 3 lines

high-port numbered UDP packets.

Therefore you need to allow UDP packets to leave your machine for you

to be

Quoted 1 line

able to run traceroute from it.

Hmm, this could end up in an unfeasible task, when I do not allow unrestricted output.

I just found out that traceroute offers a -I switch, that uses ICMP echo requests instead.
On the other hand one could use -p for a specific base port to get a certain determinism.

Florian

...............................

Someone on the net said:
I am Clinton of Borg. Prepare to see me make a fool of myself.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFA40d1wT2gPfZm6tURAn4AAJ9OfnD/kMw7Ua1ss/7lRfQzIbo5SgCfezgN Ch0ifus6ReGzusVIarwR+z8=
=bIgk
-----END PGP SIGNATURE-----

#11 lore raw
In reply to Florian Boelstler
Quoted 6 lines · Florian Boelstler

My traceroute says:
traceroute to www.google.akadns.net (66.102.11.99), 30 hops max, 38 byte packets
traceroute: sendto: Operation not permitted
1 traceroute: wrote www.google.akadns.net 38 chars, ret=-1
[ ... ]

You must have an OUTPUT rule that forbid UDP to high ports, thus traceroute cannot send its packets.

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!

#7 lore raw
In reply to Antony Stone
Quoted 4 lines · Antony Stone
Quoted 2 lines · Florian Boelstler
Quoted 1 line

Tell us how you handle NEW packets leaving the machine.

Quoted 8 lines
Quoted 2 lines

By looking at other posts in this thread I've learned that traceroutes are done with echo-requests. Is this true for Linux 2.6.6 ?

No, that's true for Windows systems. Unix machines (Linux included) uses
high-port numbered UDP packets.

Therefore you need to allow UDP packets to leave your machine for you to be able to run traceroute from it.

Actually UDP based traceroute uses ports in the range 33434-33523.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics

          H-1525 Budapest 114, POB. 49, Hungary
#8 lore raw
Quoted 6 lines · Jozsef Kadlecsik
Quoted 5 lines · Antony Stone
Quoted 3 lines · Florian Boelstler

By looking at other posts in this thread I've learned that traceroutes are done with echo-requests. Is this true for Linux 2.6.6 ?

Quoted 7 lines
Quoted 5 lines

No, that's true for Windows systems. Unix machines (Linux included)
use high-port numbered UDP packets.

Therefore you need to allow UDP packets to leave your machine for you to be able to run traceroute from it.

Actually UDP based traceroute uses ports in the range 33434-33523.

That's one of things I like about this mailing list - I can find people who are even more precise and pedantic than I am :)

Antony.

Signature · 9 lines
There are two possible outcomes:

 If the result confirms the hypothesis, then you've made a measurement.
 If the result is contrary to the hypothesis, then you've made a discovery.

 - Enrico Fermi

                                                     Please reply to the list;
                                                           please don't CC me.
#9 lore raw
Quoted 7 lines · Antony Stone
Quoted 4 lines
Quoted 3 lines

No, that's true for Windows systems. Unix machines (Linux included)
use high-port numbered UDP packets.

Actually UDP based traceroute uses ports in the range 33434-33523.

That's one of things I like about this mailing list - I can find people who are even more precise and pedantic than I am :)

It's from Building Internet Firewalls by Chapman & Zwicky :-).

We have been using the corresponding rule for ages. It failed for HPUX only because we used unclean matching as well and the old one did not know about the fact that UDP checksumming is not mandatory. [unclean match has been fixed since then, of course.]

Can't be repeated enough time, your tireless valuable help on the list is highly appreciated! (And your sigs are simply great! :-)

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics

          H-1525 Budapest 114, POB. 49, Hungary
#10 lore raw
In reply to Jozsef Kadlecsik
Quoted 1 line · Jozsef Kadlecsik

Actually UDP based traceroute uses ports in the range 33434-33523.

Just an add-on for those who want to allow traceroute through a Netfilter firewall in FORWARD : Windows traceroute uses ICMP echo requests. Thus, ICMP echo has to be accepted in order to have it work from Windwos boxes.

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!