我正在运行 Kali Linux live USB。我最近无法连接到我的 Wi-Fi 网络,但我找到了一个 Wi-Fi 适配器,可以让我连接到我的网络并使用互联网,而不会遇到任何问题。但是,当我打开终端并运行时arp -a
,我只看到一台具有 IP 地址的设备192.168.86.1
。我不知道这是否是 USB 的“IP 地址”,或者它是否属于适配器或路由器,但我无法看到连接到我的网络的任何其他设备,即使我知道有。
答案1
这缓存是新鲜的在您的设备上。
解释
实时启动映像是非持久性缓存的(非缓存吊带缓存器) 为了避免将来出现此问题,请设置具有文件持久性的 USB 映像。
你的修复每次都必须完成,或者在启动时运行某种网络发现协议来发现地址......
话虽如此,它只与你的路由器和调制解调器对话。它需要更新,ARP 从缓存中读取……
总长DR
运行此命令重置 ip 协议的缓存:
ip link set arp off dev eth0 ; ip link set arp on dev eth0
完成后,运行此 copypasta 来解析接口......
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 启动终端。
Run sudo gedit /etc/hdparm.conf
找到write_cache,去掉前面的#。保存并重新启动计算机。
下一步是
***只为绝望的人***
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 从缓存中读取条目。尝试更新缓存或创建指向另一个的实时图像(见上文)