linux

linux

Rabu, 30 Mei 2012

route windows

To display the entire contents of the IP routing table, type:

route print

To display the routes in the IP routing table that begin with 10., type:

route print 10.*

To add a default route with the default gateway address of 192.168.12.1, type:

route add 0.0.0.0 mask 0.0.0.0 192.168.55.1
To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:

route add 10.41.0.0 mask 255.255.0.0 10.27.0.1

To add a persistent route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:

route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1

To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and the cost metric of 7, type:

route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7

To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and using the interface index 0x3, type:

route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3

To delete the route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, type:

route delete 10.41.0.0 mask 255.255.0.0

To delete all routes in the IP routing table that begin with 10., type:

route delete 10.*

To change the next hop address of the route with the destination of 10.41.0.0 and the subnet mask of 255.255.0.0 from 10.27.0.1 to 10.27.0.25, type:

route change 10.41.0.0 mask 255.255.0.0 10.27.0.25
-------------
-f : Clears the routing table of all entries that are not host routes (routes with a netmask of 255.255.255.255),
     the loopback network route (routes with a destination of 127.0.0.0 and a netmask of 255.0.0.0),
     or a multicast route (routes with a destination of 224.0.0.0 and a netmask of 240.0.0.0).
     If this is used in conjunction with one of the commands (such as add, change, or delete), the table is cleared prior to running the command.

-p : When used with the add command, the specified route is added to the registry
     and is used to initialize the IP routing table whenever the TCP/IP protocol is started.
     By default, added routes are not preserved when the TCP/IP protocol is started.
     When used with the print command, the list of persistent routes is displayed. This parameter is ignored for all other commands.
     Persistent routes are stored in the registry location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes.
-----------------------
To enable TCP/IP forwarding, follow these steps:

   1. Start Registry Editor (Regedit.exe).
   2. In Registry Editor, locate the following registry key:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
   3. Set the following registry value:
      Value Name: IPEnableRouter
      Value type: REG_DWORD
      Value Data: 1
      A value of 1 enables TCP/IP forwarding for all network connections that are installed and used by this computer.
   4. Quit Registry Editor.

Senin, 07 Mei 2012

IP scanner for linux

NMAP

for scan ip on the network just use nmap
if you want to know the up ip on our network just type :
nmap -sP 192.168.1.0/24

this will show  :
Host gw1.ipos.net (192.168.1.1) is up (0.00014s latency).    
MAC Address: 00:0C:42:BC:4D:9A (Routerboard.com)            
Host hplj1200.ipos.net (192.168.1.5) is up (0.0019s latency).
MAC Address: 00:11:0A:ED:52:43 (Hewlett Packard)            
Host hplj2200.ipos.net (192.168.1.6) is up (0.0020s latency).
MAC Address: 00:11:0A:ED:52:B9 (Hewlett Packard)            
Host hpljc4500.ipos.net (192.168.1.7) is up (0.00035s latency).
MAC Address: 08:00:37:97:B2:22 (Fuji-xerox CO.)             
Host 192.168.1.9 is up (0.0011s latency).                   
MAC Address: 00:1A:4B:1F:EB:0A (Hewlett Packard)            
Host 192.168.1.10 is up (0.00079s latency).            


for more simple use :
nmap -sP 192.168.1.0/24 | grep Host 


this will show :
Host gw1.ipos.net (192.168.1.1) is up (0.00012s latency).       
Host hplj1200.ipos.net (192.168.1.5) is up (0.0019s latency).   
Host hplj2200.ipos.net (192.168.1.6) is up (0.0019s latency).   
Host hpljc4500.ipos.net (192.168.1.7) is up (0.00044s latency).
Host 192.168.1.9 is up (0.0011s latency).                       
Host 192.168.1.10 is up (0.00098s latency).                     
Host 192.168.1.11 is up (0.0015s latency).                      
Host 192.168.1.12 is up (0.00024s latency).                     
Host 192.168.1.13 is up (0.00081s latency).                     
Host 192.168.1.15 is up (0.00046s latency). 



for range ip 192.168.1.50 - 192.168.1.57 just type :

nmap -sP 192.168.1.50-57 | grep Host


this will show
Host januar.ipos.net (192.168.1.50) is up (0.00014s latency).
Host 192.168.1.51 is up (0.00042s latency).
Host 192.168.1.53 is up (0.00022s latency).
Host 192.168.1.56 is up (0.00055s latency).