arp

MAC地址表、ARP缓存表、路由表及交换机、路由器基本原理

无人久伴 提交于 2019-12-03 06:30:22
  在网上找到了这篇讲述MAC地址,ARP协议和路由表的文章,如获至宝。一篇文章把组网中的相关概念讲的明明白白。   原文是发布在51cto博客上,但不知道为什么点进去却是404。让我没想到的是这个技术论坛上有不少原创的好文章。   好了下面是文章正文: MAC地址表 说到MAC地址表,就不得不说一下交换机的工作原理了,因为交换机是根据MAC地址表转发数据帧的。在交换机中有一张记录着局域网主机MAC地址与交换机接口的对应关系的表,交换机就是根据这张表负责将数据帧传输到指定的主机上的。 交换机的工作原理 交换机在接收到数据帧以后,首先、会记录数据帧中的源MAC地址和对应的接口到MAC表中,接着、会检查自己的MAC表中是否有数据帧中目标MAC地址的信息,如果有则会根据MAC表中记录的对应接口将数据帧发送出去(也就是单播),如果没有,则会将该数据帧从非接受接口发送出去(也就是广播)。 如下图:详细讲解交换机传输数据帧的过程 1) 主机A会将一个源MAC地址为自己,目标MAC地址为主机B的数据帧发送给交换机。 2) 交换机收到此数据帧后,首先将数据帧中的源MAC地址和对应的接口(接口为f 0/1) 记录到MAC地址表中。 3) 然后交换机会检查自己的MAC地址表中是否有数据帧中的目标MAC地址的信息,如果有,则从MAC地址表中记录的接口发送出去,如果没有

How to ping MAC address in Linux

时光总嘲笑我的痴心妄想 提交于 2019-12-03 04:35:08
问题 I want to ping a known MAC address, I tried to use nmap: sudo nmap -sP 192.168.15.1/24 | grep 20:64:32:3F:B1:A9 But in this case its ping all the 255 IP address (from 192.168.15.1 to 192.168.15.255) until get my MAC address, and that take a long time about 4 sec.! any idea please? 回答1: The only way to make it faster is to test if the mac address is already into your arp table #!/bin/bash # extract ip from local arp table ip=$(arp | grep 20:64:32:3F:B1:A9 | awk ' { print $1 } ') # found an ip

ARP Timeouts. Why fixed periodic?

末鹿安然 提交于 2019-12-03 03:46:17
This one's been bugging me for years. Basic question: Is there some reason ARP has to be implemented with fixed timeouts on ARP cache entries? I do a lot of work in Real Time ciricles. We do most of our inter-system communications these days on dedicated UDP/IP links. This for the most part works reliably in Real Time, but for one nit: ARP entry timeouts. The way typical implementations do ARP is the following: When client asks to send an IP packet to an IP address with an unkown MAC address, instead of sending that IP packet, the stack sends out an ARP request. If an upper layer (TCP) does

Get IP from MAC address. arp -a not showing device

纵饮孤独 提交于 2019-12-03 02:51:39
I'm trying to write a batch file that's supposed to find the dynamically assigned IP of my Android phone when it's connected to the network (Tenda WiFi router). So I'm trying arp -a and searching for my phone's MAC address so I can get its IP from the table. C:\Users\Leeroy>arp -a Interface: 192.168.0.100 --- 0xb Internet Address Physical Address Type 192.168.0.1 c8-3a-35-35-f6-68 dynamic 192.168.0.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.251 01-00-5e-00-00-fb static 224.0.0.252 01-00-5e-00-00-fc static 239.255.255.250 01-00-5e-7f-ff-fa static 255.255.255.255 ff

Obtain MAC Address from Devices using Python

匿名 (未验证) 提交于 2019-12-03 02:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking for a way (with python) to obtain the layer II address from a device on my local network. Layer III addresses are known. The goal is to build a script that will poll a databases of IP addresses on regular intervals ensuring that the mac addresses have not changed and if they have, email alerts to myself. 回答1: To answer the question with Python depends on your platform. I don't have Windows handy, so the following solution works on the Linux box I wrote it on. A small change to the regular expression will make it work in OS X.

H3C常用配置和命令

匿名 (未验证) 提交于 2019-12-03 00:41:02
邻居发现命令 display lldp neighbor-information list DHCP中继配置 dhcp enable dhcp relay server-group 1 ip x.x.x.x #x为DHCP服务器的ip地址 int vlan 30 在H3C交换机配置dhcp服务器时查看地址的分配情况 dis dhcp server ip-in-use pool vlan1006 dis dhcp server free-ip pool vlan1006 查看接口描述 display interface brief description default接口 [h3c]interface GigabitEthernet 1/0/41 [h3c-GigabitEthernet1/0/41]default 全局开启802.1X dot1x dot1x authentication-method eap dot1x timer quiet-period 10 dot1x timer tx-period 10 mac-authentication mac-authentication domain 1x radius scheme 1x primary authentication 172.28.101.3 primary accounting 172.28.101.3

nbtscan工具

匿名 (未验证) 提交于 2019-12-03 00:40:02
这是一款用于扫描Windows网络上NetBIOS名字信息的程序。该程序对给出范围内的每一个地址发送NetBIOS状态查询,并且以易读的表格列出接收到的信息,对于每个响应的主机,NBTScan列出它的IP地址、NetBIOS计算机名、登录用户名和MAC地址。但只能用于局域网,NBTSCAN可以取到PC的真实IP地址和MAC地址,如果有”ARP攻击”在做怪,可以找到装有ARP攻击的PC的IP/和MAC地址。 但只能用于局域网 , NBTSCAN可以取到PC的真实IP地址和MAC地址,如果有”ARP攻击”在做怪,可以找到装有ARP攻击的PC的IP/和MAC地址。NBTSCAN可以取到PC的真实IP地址和MAC地址,如果有”ARP攻击”在做怪,可以找到装有ARP攻击的PC的IP/和MAC地址。 总之,NBTSCAN可以取到PC的真实IP地址和MAC地址。 Example: 命令: 1.“nbtscan -r 192.168.0.0/24”(搜索整个192.168.0.0/24网段, 即 192.168.0.1-192.168.0.254); 原文:https://www.cnblogs.com/xingyunfashi/p/9285019.html

LVS DR模式搭建 keepalived + LVS

匿名 (未验证) 提交于 2019-12-03 00:40:02
一、LVS DR模式搭建 修改两台rs1和rs2机器的网关为之前的网关:192.168.238.2 #vi /etc/sysconfig/network-scripts/ifcfg-ens33 #systemctl restart network dir机器上也需要编写一个脚本,加入如下内容: [root@linux-01 ~]# vim /usr/local/sbin/lvs_dr.sh #! /bin/bash echo 1 > /proc/sys/net/ipv4/ip_forward ipv=/usr/sbin/ipvsadm vip=192.168.238.200 rs1=192.168.238.130 rs2=192.168.238.131 #注意这里的网卡名字 ifdown ens33 ifup ens33 ifconfig ens33:2 $vip broadcast $vip netmask 255.255.255.255 up route add -host $vip dev ens33:2 $ipv -C $ipv -A -t $vip:80 -s rr $ipv -a -t $vip:80 -r $rs1:80 -g -w 1 $ipv -a -t $vip:80 -r $rs2:80 -g -w 1 //脚本解释: echo 1 > /proc/sys

地址解析协议ARP与逆地址解析协议RARP

匿名 (未验证) 提交于 2019-12-03 00:40:02
IP地址是用来通信的,但是和硬件地址是有区别的。物理地址是数据链路层和物理层使用的地址,IP地址是网络层及以上各层使用的地址。 发送数据时,数据从高层向下层传输,使用IP地址的IP数据报交给下层的数据链路层,就会被封装为MAC帧。IP数据报的首部存放着IP地址,包括源地址和目的地址。MAC帧的首部存放着物理地址,在数据链路层看不到数据报的IP地址。 在通信过程中,不管网络层使用什么协议,在实际网络的链路上传输数据必须使用硬件地址。 IP地址有32位,MAC地址有48位,它们之间不存在简单的映射关系,在网络中,经常会出现加入新主机,撤走主机,以及更换网卡,这些都会使主机的硬件地址发生改变,在主机中存放IP-MAC的映射表,应该要经常动态更新,实现起来很繁琐。 我们如何简便地实现IP地址到物理地址的转换呢,地址解析协议ARP很好地解决了上述问题。 首先,每个主机上都应该设有一个ARP高速缓存,存放着 所在的局域网上 的各主机IP地址和其物理地址的映射表。那么这些映射表是如何来的呢? 当主机A想向本局域网上的主机B发送IP数据报,那么先在ARP高速缓存中查找主机B的IP地址,如果有,就对应出主机B的硬件地址,将地址写入MAC帧,然后通过局域网将该MAC帧发往此硬件地址。 如果在ARP高速缓存中没有找到主机B的IP地址,有可能是主机B刚刚入网,或者主机A刚刚上电,高速缓存是空的

arp 和icmp

匿名 (未验证) 提交于 2019-12-03 00:39:02
背景: 在做openstack 虚拟机网络调试时,发现虚拟机之间可以Ping通,但是无法ping到网关。抓tap设备也没有icmp的报文通过。 下面我们来复原下,并且做分析: 实验环境,共两台主机: 主机名 ip localhost 192.168.1.25 bogon 192.168.1.24 查看192.168.1.25 主机的arp [root@localhost ~]# arp -na ? (192.168.1.23) at e8:2a:44:34:3e:f4 [ether] on ens33 ? (192.168.1.22) at 94:39:e5:53:53:c0 [ether] on ens33 [root@localhost ~]# 此时我们卡电脑 在1.25上没有1.24 的arp 表。下面我们把1.24的网卡关闭,并且在1.25上ping 1.24 并且在1.24上抓icmp包 再抓arp的包 可以看到此时只有 arp的包,没有icmp的包。 ########### 下面我们把1.24的网卡 enable 再次在1.25上ping 1.24。无疑是可以通的,下面我们看1.25的arp表 现在已经有了1.24的arp了。我们再次把1.24的网卡禁用掉,再次ping ,并且抓包 可以看到 只有请求包,没有回应包,此时我们把1.25上的1.24 的arp表清除掉