robyp7 (Normal User)
Newbie
Messaggi: 13
Iscritto: 02/07/2008
|
jpcap è un'utility per fare sniffig dei pacchetti oppure ping, traceroute ecc: nel mio caso mi serve fare tracerout in java e ho trovato l'esemopio:
http://netresearch.ics.uci.edu/kfujii/jpcap/sample/Tracero ...
ho aggiunto dell System.out.println in qusti punti(per debugging, vedi la "-->"):
}else if(p.type==ICMPPacket.ICMP_TIMXCEED){
--> System.out.println("Enter icmp time exceed!");
p.src_ip.getHostName();
System.out.println(icmp.hop_limit+": "+p.src_ip);
icmp.hop_limit++;
}else if(p.type==ICMPPacket.ICMP_UNREACH){
--> System.out.println("Enter unreach, destination unreachable!");
p.src_ip.getHostName();
System.out.println(icmp.hop_limit+": "+p.src_ip);
System.exit(0);
}else if(p.type==ICMPPacket.ICMP_ECHOREPLY){
-->System.out.println("Enter echo reply!");
p.src_ip.getHostName();
System.out.println(icmp.hop_limit+": "+p.src_ip);
System.exit(0);
}else continue;
faccio un traceroute verso www.google.it (74.125.39.103) e ottengo visualizzato in shell:
Enter icmp time exceed!
0: 192.168.1.1/192.168.1.1 <-- my gateway answer about TTL=0 whit a icmp
Enter unreach, destination unreachable!
1: 192.168.1.1/192.168.1.1 <-- TTL = 1 but dest not reacable
e basta! perchè?
sono su una lan con gateway 192.168.1.1/255.255.255.0 ma non riesco ad uscire dal gateway, mentre con tracert da dos (windows xp) si, perchè????????
possibil che è un problema del mio gatew?
che posso fare?
grazie!Roby
Robert
|