“路由删除”和“路由添加”恢复后 ping 127.0.0.1 时出现“一般故障”

问题描述 投票:0回答:1

替代拼写:https://forums.tomshardware.com/threads/restart-software-loopback-interface.2880183/
有没有办法在不重新启动Windows的情况下重新启动

Software Loopback Interface

重现:

route delete 127.0.0.1 0.0.0.0 if 1
route add 127.0.0.1 0.0.0.0 if 1
ping 127.0.0.1

输出(在win11上测试):

Pinging 127.0.0.1 with 32 bytes of data:
General failure.
General failure.
General failure.
General failure.

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

___
背景资料:
使用

route print
if 1
(界面1)是:

  1...........................Software Loopback Interface 1
windows network-programming loopback network-interface routetable
1个回答
0
投票

这可能不会“重新启动”界面,但它可以完成工作:

netsh interface ip set address "Loopback Pseudo-Interface 1" static address=127.0.0.1 mask=255.0.0.0 gateway=none

输出:

>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
© www.soinside.com 2019 - 2024. All rights reserved.