如何获得一个IP地址的网卡的卡号

如何获得一个IP地址的网卡的卡号

我的内部网计算机有个ip地址,我想知道这个计算机上的网卡的卡号,帮我的老大们!      
issue command "ifconfig", no options needed if you want to look at information about all network interfaces.      
我不是看本机的,是另一台机器的      
suppose your system is 192.168.0.1, and another system is 192.168.0.2

The best way to get 192.168.0.2's MAC address is to login to that system, and issue command "ifconfig". This is the most reliable way.

Another way is on your system, use arp command: arp 192.168.0.2
The problem here is that your system has the 192.168.0.2's MAC address in current cache. Most like, it is, and you'll get the MAC address. But becareful if another machine is using dhcp, you may use hostname instead of IP.

There is another way to get it, but you need to be patient, that is use tcpdump to listen on the LAN:

tcpdump -l arp host 192.168.0.2 | tee tmp_arp

this way, you may watch the traffic to 192.168.0.2 while the tcpdump result is saved into file tmp_arp. This may need hours or even longer, depending on the set up of LAN and 192.168.0.2's configuration. If you are lucky, you'll see a meesage like "arp reply 192.168.0.2 is at XX:XX:XX:XX:XX" that is the MAC address you are looking for.

Hope this may help, good luck      
我是这样,你看对吗?arp -s 192.168.0.2 无法显示mac号,你在帮我一下吧!
      
you may not need s option.
just type in arp after prompt, you'll get all cached MAC addresses in your LAN. By specifying a hostname, we may look up that specific host. "arp 192.168.0.2" should be working fine if that MAC is currently cached.

Try this way also:

tcpdump -l host 192.168.0.2

then open another terminal, and just "ping" 192.168.0.2:
ping 192.168.0.2
You will see some lines popped out in tcpdump terminal. Kill the ping right away, and look for 192.168.0.2 is at xx:xx:xx:xx:xx:xx line. You need to login as root to do this. Some system may let you sudo it, but mine does not so I have to login as root to use tcpdump. By the way, tcpdump is very powerful, and I personally believe a network programmer and admin should be able to use it in different situations. If one also has ethereal installed, ethereal will help you read the tcpdump raw data in a GUI, and you can look up MAC address in the "data: window of ethereal GUI.

Good luck!:-)      
若那台机器的IP是192.168.1.1
你在一台机器上用: ping 192.168.1.1
                  arp -a
显示在192.168.1.1 后面的就是MAC地址了      
...      
netconfig试试巴!
你用的是版本?
路慢慢其修远兮,吾将上下尔求索!      
这个问题很简单,只需要两步:
1、ping 一下想知道网卡的IP;
2、ping后用arp -a 命令即可得到要知道的MAC号。