首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >arp -a只返回Kali上的一个设备?

问arp -a只返回Kali上的一个设备?
EN

Unix & Linux用户
提问于 2022-05-23 01:32:07
回答 1查看 336关注 0票数 0

我正在运行一个Kali Linux实时USB。我最近无法连接到我的Wi网络,但我发现了一个Wi适配器,让我连接到我的网络和使用互联网没有任何问题。然而,当我打开我的终端并运行arp -a时,我只看到一个带有IP地址192.168.86.1的设备。我不知道这是USB的"IP地址“还是属于适配器或路由器,但我无法看到任何其他设备连接到我的网络,即使我知道有。

EN

回答 1

Unix & Linux用户

发布于 2022-05-23 03:33:50

缓存在您的设备上是新的。

解释

活动引导映像是非持久缓存(非缓存吊带缓存-er),以避免这个问题,在未来建立一个具有文件持久性的usb映像。

每次都必须执行Your修复,或者在引导时运行某种网络发现协议来发现地址.

尽管如此,它只和你的路由器和调制解调器谈过。它需要更新,ARP从缓存中读取.

TLDR

运行此命令以重置ip协议的缓存:

代码语言:javascript
复制
    ip link set arp off dev eth0 ; ip link set arp on dev eth0

完成后,运行这个copypasta来解析接口.

代码语言:javascript
复制
    interfaces=$(
      arp -n | awk '
        NR == 1 {next}
        {interfaces[$5]+=1}
        END {for (interface in interfaces){print(interface)}}
      '
    );
    for interface in $interfaces; do
      echo "Clearing ARP cache for $interface";
      sudo ip link set arp off dev $interface;
      sudo ip link set arp on  dev $interface;
    done

TLDR #2

如果不允许持久化,可以在usb上禁用您的写缓存(我知道有矛盾)。

在Linux

中编写缓存

按CTRL+ALT+T启动终端。

代码语言:javascript
复制
    Run sudo gedit /etc/hdparm.conf

找到write_cache并删除它前面的#。保存并重新启动计算机。

下一步是

*只为绝望的人*

代码语言:javascript
复制
FROM ARP MAN PAGE



-D, --use-device
              Instead of a hw_addr, the given argument is the name of an
              interface.  arp will use the MAC address of that interface
              for the table entry. This is usually the best option to
              set up a proxy ARP entry to yourself.

      -i If, --device If
              Select an interface. When dumping the ARP cache only
              entries matching the specified interface will be printed.
              When setting a permanent or temp ARP entry this interface
              will be associated with the entry; if this option is not
              used, the kernel will guess based on the routing table.
              For pub entries the specified interface is the interface
              on which ARP requests will be answered.
              NOTE: This has to be different from the interface to which
              the IP datagrams will be routed.  NOTE: As of kernel 2.2.0
              it is no longer possible to set an ARP entry for an entire
              subnet. Linux instead does automagic proxy arp when a
              route exists and it is forwarding. See arp(7) for details.
              Also the dontpub option which is available for delete and
              set operations cannot be used with 2.4 and newer kernels. 

ARP从缓存中读取条目。尝试更新您的缓存或创建一个与另一个缓存对应的实时映像(见上文)。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/703500

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档