Join And Earn Real Rewards from Amazon..

Thursday 25 April 2013

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. Go to the below Path and Add new DWORD Value

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

3. Right. Click. on Right. Pane ---> New ---> DWORD value
4. Rename it to DefaultTTL and 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"
.


Note : Second Way to change TTL in Linux

You can change your Default TTL value of LINUX by editing the /etc/sysctl.conf file and add the line ,

net.ipv4.ip_default_ttl = <0-255>

&

Reboot your system ...