我运行此命令来“阻止”IP 地址:
route add -host 123.123.123.123 reject
有用。我可以在路线列表中看到它:
root@mypc:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 0 0 0 enp3s0
123.123.123.123 - 255.255.255.255 !H 0 - 0 -
凉爽的。如何删除路线?
我试过:
root@mypc:~# route del 123.123.123.123 gw - netmask 255.255.255.255 metric 0
但它给出了这个(错误?):
-: Unknown host
如何删除路线?
答案1
运行原始命令,但使用以下命令delete
代替add
:
route delete -host 123.123.123.123 reject