Tuesday, December 10, 2013

Find active ip address on the networ..

 I thought nmap will give you all the active hosts on the network but it was not working. I tried it but finally found it that the host I was working was natted.. lol...


[devi@localhost ~]$ for i in `seq 0  256`
> do
> ping 192.168.10. $i
> done







[devi@localhost ~]$ for i in `seq 2 256`; do ping 192.168.10.$i ; done
PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_seq=1 ttl=128 time=7.40 ms
64 bytes from 192.168.10.2: icmp_seq=2 ttl=128 time=0.800 ms
64 bytes from 192.168.10.2: icmp_seq=3 ttl=128 time=0.903 ms






[devi@localhost ~]$ for i in `seq 1 256`
> do
> echo $i
> done
1
2
3
4



[root@localhost ~]# nmap
-bash: nmap: command not found
[root@localhost ~]# yum search nmap
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel-repository                        

[root@localhost ~]# yum install nmap
Loaded plugins: product-id,


Resolving Dependencies
--> Running transaction check
---> Package nmap.i686 2:5.51-2.el6 will be installed
--> Finished Dependency Resolution

[root@localhost ~]# more /etc/yum.repos.d/file.repo
##!/bin/bash
[rhel-repository]
name=rhel.myrepo
#baseurl=http://192.168.10.32/yum
baseurl=file:///opt/OS_Image
enabled=1
gpgcheck=0

[root@localhost ~]# nmap -sP 192.168.10.1/24

Starting Nmap 5.51 ( http://nmap.org ) at 2013-12-10 19:52 PST
Nmap scan report for 192.168.10.0
Host is up (0.013s latency).
Nmap scan report for 192.168.10.1
Host is up (0.0023s latency).
Nmap scan report for 192.168.10.2


[root@localhost ~]# arp -an
? (192.168.179.254) at 00:50:56:f8:39:53 [ether] on eth0
? (192.168.179.1) at 00:50:56:c0:00:08 [ether] on eth0
? (192.168.179.2) at 00:50:56:f9:55:21 [ether] on eth0
[root@localhost ~]#

No comments:

Post a Comment