大网数据广告活动
服务器运维问答

The route addition failed: The parameter is incorrect

· 52CE 我爱测

How can I null route a IP range? I get a parameter is incorrect error. route -p ADD 65.55.223.0-65.55.223.255 MASK 255.255.255.255 0.0.0.0 The route addition failed: The parameter is incorrect.

问题原文

原帖链接 · user330198 · CC BY-SA 3.0

How can I null route a IP range? I get a parameter is incorrect error.

route -p ADD 65.55.223.0-65.55.223.255 MASK 255.255.255.255 0.0.0.0

The route addition failed: The parameter is incorrect.

已采纳解答

原帖链接 · Diamond · CC BY-SA 3.0

Your route command syntax is wrong. Here is the proper syntax:

Syntax

route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]

Destination : Specifies the network destination of the route. The destination can be an IP network address (where the host bits of the network address are set to 0), an IP address for a host route, or 0.0.0.0 for the default route.

As you can see, the command doesn't allow adding ip range like that, and that's why you are getting the error. You need to define the range using network & netmask.

Null route doesn't necessarily means Routing to 0.0.0.0 it means actually Routing to nowhere or blackholing so that the packets are silently dropped.

You may try the following, where if 1 stands for the loopback Interface:

route -p add 65.55.223.0 mask 255.255.255.0 Gateway_ip if 1

Alternatively, you can achieve similar result by pointing the gateway to an unused ip or a fake ip:

route -p add 65.55.223.0 mask 255.255.255.0 unused_ip_address

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。