免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 35622 | 回复: 15
打印 上一主题 下一主题

知道mac如何查找ip呢 [复制链接]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
1 [报告]
发表于 2005-10-12 16:34 |显示全部楼层

知道mac如何查找ip呢

^_^前一段时间我也遇到这样的一个事情.于是就自己总结了一下.我个人感觉比使用snmp是快一点.这个直接就生成了一个文件.方便快捷
希望能够帮助上楼主.
另外你这个还不算什么.我作的那个人家还要求我将每个机器的网卡在那个交换机的端口上面都要找出来.如果不是我使用这些工具几百个端口我要去查的话非要吐血才行.

http://blog.chinaunix.net/articl ... 48815&blogId=12

nmap 扫描mac地址
最近干的一个工作就是要对出整个数据中心里面的服务器的网卡插在了那个交换机的那个端口上面.
经过总结发现合理使用的snmp和一些工具完全可以省去用手去看的工作.
其中一个最重要的功能是将ip地址和mac的对应表列出来.
所以我就使用了nmap这个工具.正好今天把nmap升级到了最新的版本.

linux : Latest Stable i386 Nmap RPM: nmap-3.93-1.i386.rpm
windows:Nmap 3.90 and later require WinPcap 3.1 or later. Latest stable Nmap command-line zipfile: nmap-3.93-win32.zip


使用的方法:
nmap -sP -PI -PT -on ipandmaclist.txt 192.168.1.0/24
完事后就得到了一个txt文件里面就是ip地址和mac地址.


论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2005-10-12 17:30 |显示全部楼层

知道mac如何查找ip呢

[quote]原帖由 "dingyi129"]好哇,很有用![/quote 发表:


大家有兴趣可以试试.至少我感觉还是比较方便的

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
3 [报告]
发表于 2005-10-13 08:52 |显示全部楼层

知道mac如何查找ip呢

[quote]原帖由 "枫影谁用了"][/quote 发表:



怎么样啊?好使吧 :em11:

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
4 [报告]
发表于 2005-10-13 08:54 |显示全部楼层

知道mac如何查找ip呢

另外nmap有新版本了.建议你去升级一个新的.这个软件每次出新的后我马上就去升级

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
5 [报告]
发表于 2005-10-13 09:57 |显示全部楼层

知道mac如何查找ip呢

原帖由 "枫影谁用了" 发表:


可不可以给一个使用手册?最好是中文的..因为英文的话我可以man nmap..

呵呵


中文的我也没有.nmap的网站上面有一个中文的老版本的说明书如果是你想看的话可以看看.

http://www.insecure.org/nmap/nmap-fingerprinting-article-cn.html

原帖由 "platinum" 发表:

怎么说扫描了 256 个 IP ?


应该是包括了0这个ip地址

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
6 [报告]
发表于 2005-10-13 10:48 |显示全部楼层

知道mac如何查找ip呢

[quote]原帖由 "platinum"]0 和 255 不是代表网络地址和广播地址吗?这两个也计算在内一起 scan ?[/quote 发表:


在man里面看到的.但是我个人感觉不是一个太满意的答案.你可以对付看看.
TARGET SPECIFICATION

       Everything that isn’t an option (or option argument) in nmap is treated
       as  a  target  host specification.  The simplest case is listing single
       hostnames or IP addresses on the command line.  If you want to  scan  a
       subnet  of  IP  addresses,  you  can append /mask to the hostname or IP
       address.  mask must be between 0 (scan the whole Internet) and 32 (scan
       the  single  host  specified).  Use /24 to scan a class "C" address and
       /16 for a class "B".

       Nmap also has a more powerful notation which lets  you  specify  an  IP
       address  using  lists/ranges  for  each element.  Thus you can scan the
       whole class "B" network  192.168.*.*  by  specifying  "192.168.*.*"  or
       "192.168.0-255.0-255" or even "192.168.1-50,51-255.1,2,3,4,5-255".  And
       of course you can use the mask notation: "192.168.0.0/16".   These  are
       all  equivalent.  If you use asterisks ("*", remember that most shells
       require you to escape them with  back  slashes  or  protect  them  with
       quotes.

       Another  interesting  thing  to do is slice the Internet the other way.
       Instead of scanning all the hosts in a class "B", scan  "*.*.5.6-7"  to
       scan  every IP address that ends in .5.6 or .5.7 Pick your own numbers.
       For more information on specifying hosts to scan, see the examples sec-
       tion.



EXAMPLES

       Here  are some examples of using nmap, from simple and normal to a lit-
       tle more complex/esoteric.  Note that actual numbers  and  some  actual
       domain names are used to make things more concrete.  In their place you
       should substitute addresses/names from your  own  network.   I  do  not
       think  portscanning  other networks is illegal; nor should portscans be
       construed by others as an attack.  I have scanned hundreds of thousands
       of  machines  and  have  received  only  one complaint.  But I am not a
       lawyer and some (anal) people may  be  annoyed  by  nmap  probes.   Get
       permission first or use at your own risk.

       nmap -v target.example.com

       This  option  scans  all reserved TCP ports on the machine target.exam-
       ple.com .  The -v means turn on verbose mode.

       nmap -sS -O target.example.com/24

       Launches a stealth SYN scan against each machine that is up out of  the
       255  machines  on  class "C" where target.example.com resides.  It also
       tries to determine what operating system is running on each  host  that
       is  up  and  running.  This requires root privileges because of the SYN
       scan and the OS detection.

       nmap -sX -p 22,53,110,143,4564 198.116.*.1-127

       Sends an Xmas tree scan to the first half of each of the 255 possible 8
       bit  subnets  in  the  198.116 class "B" address space.  We are testing
       whether the systems run sshd, DNS, pop3d, imapd, or  port  4564.   Note
       that  Xmas  scan doesn’t work on Microsoft boxes due to their deficient
       TCP stack.  Same goes with CISCO, IRIX, HP/UX, and BSDI boxes.

       nmap -v --randomize_hosts -p 80 *.*.2.3-5

       Rather than focus on a specific IP range, it is  sometimes  interesting
       to  slice  up  the  entire  Internet  and scan a small sample from each
       slice.  This  command  finds  all  web  servers  on  machines  with  IP
       addresses  ending in .2.3, .2.4, or .2.5.  If you are root you might as
       well add -sS.  Also you will find more interesting machines starting at
       127.  so you might want to use "127-222" instead of the first asterisks
       because that section has a  greater  density  of  interesting  machines
       (IMHO).

       host -l company.com | cut  -d  -f 4 | ./nmap -v -iL -

       Do  a  DNS zone transfer to find the hosts in company.com and then feed
       the IP addresses to nmap.  The above commands are for my GNU/Linux box.
       You may need different commands/options on other operating systems.


而且我这个人属于投机取巧的人.每次达到目的后就不深入钻研了.



所以自己的技术一直没有什么长进.大家可千万别学习我啊.应该多和白金学习学习.他们的技术都比我好.

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
7 [报告]
发表于 2005-10-13 10:49 |显示全部楼层

知道mac如何查找ip呢

原帖由 "西山晴雪" 发表:

能具体说说你是如何使用snmp和一些工具来察看网卡和交换机的对应端口呢
:em11: 你是想知道window下面的还是unix下面的啊?
想知道花钱的方法呢?还是免费的方法呢?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
8 [报告]
发表于 2005-10-13 11:47 |显示全部楼层

知道mac如何查找ip呢

原帖由 "platinum" 发表:

老大你别耍我了,你一直是我心目中的偶像呢
还需努力努力再努力!



哥们你在努力就上天了.有的时候也看看你们讨论的东西感觉你们的基础知识都比我好. 惭愧在挨踢商业里面工作了这么多年啊.
另外你现在是不是qq也不能够使用了啊?有什么联系方式吗?比如邮件之类的.我也就能发邮件了.晚上回家后才能上网.

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
9 [报告]
发表于 2005-10-13 12:28 |显示全部楼层

知道mac如何查找ip呢

原帖由 "platinum" 发表:
因为没有机会摸到很高端的设备,所以只能自己研究研究这些很底层的东西了。。。
不过现在回过头来看,我并没有觉得后悔,相反,越来越觉得调试那些高端设备其实很简单 ^_^


现在越高级的东西越智能(傻瓜)化了.有的时候研究一下底层的东西有好处.比如配置防火墙的时候多看看iptables 是绝对有帮助的.

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
10 [报告]
发表于 2005-10-13 15:57 |显示全部楼层

知道mac如何查找ip呢

[quote]原帖由 "西山晴雪" 发表:

我就想知道linux下免费的方法。我最近和你一样也要核对200多台服务器网卡和交换机对应的端口。我是这么做的
我先在交换机上ping这个服务器然后show arp 察看mac地址
然后再show mac-address-table 察看核实mac地
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP