Tuesday, January 22, 2008

How to change TTL of TCP packets for windows (xp/nt/2000) & LINUX (kernel 2.4.x) ?

How to change TTL of TCP packets for windows (xp/nt/2000) & LINUX (kernel 2.4.x) ?

For windows , you can change the TTL value, by editing registry value;
======================================================================
1. run ---> regedit
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
3. Rht. Clk. on Rht. Pane ---> New ---> DWORD value
4. Rename it to DefaultTTL 'n' set the value (0-255).
5. Restart your System.
6. Ping from other system or try Ping localhost

For Linux (Kernel ver-2.4.x & 2.6.x.x)
=============================
I have done it, which is given below,

1. Setting temporary TTL (active till system reboot)
-------------------------------------------------------
...]#echo "123" > "/proc/sys/net/ipv4/ip_default_ttl"

The above command will change the default TTL(64) to 123.

2. Setting TTL Permanently
-----------------------------
I have done nothing ,but automated it -:)...

...]#vi /etc/rc.d/rc3.c/S99local
.
.
.
# added
echo "123" > "/proc/sys/net/ipv4/ip_default_ttl"
.
.
.
.
~
~
~