团队文章网络运营

How to Prevent IP Spoofing Attacks

Where source filtering belongs, when strict reverse-path checks break valid traffic, and why authentication and IPv6 need separate attention.

目录

An envelope sits at a white sorting counter on a blue path; a separate blue doorway has a key beside it.
Checking a delivery's route and deciding who may enter are separate tasks. Source validation and authentication need their own controls.

A reception desk can check whether a delivery came by an expected route. The person receiving it still needs to decide who may enter the building. Networks have a similar division of work: validate where traffic claims to come from, then authenticate access to the service.

Place the first check near the source

A network operator knows which address ranges should arrive on a customer's connection. Packets claiming an unrelated source can be rejected there, before they travel further. This is the source-validation approach described in BCP 38.

For a company network, check traffic leaving towards the Internet as well as traffic arriving from outside. The same boundary is an exit from one network and an entrance to another. Define the expected sources for each connection, including legitimate delegated ranges, rather than applying one blanket rule everywhere.

A range check does not identify the person behind a packet. It can also leave room for forgery within an allowed range. Treat it as a useful boundary control, not a certificate of identity.

Make reverse-path checks fit the real routes

Unicast reverse path forwarding, or uRPF, compares a packet's source with routing information. In strict mode, the incoming interface must match the selected return path. That can work well where the paths are predictable.

However, legitimate traffic can arrive on one connection while the best return route uses another. This happens with asymmetric routing and networks using multiple providers. Strict checks can then discard valid traffic. RFC 3704 explains these trade-offs. Feasible-path approaches consider permitted alternatives; loose checks generally ask whether a route exists, so they provide a weaker test. Choose and verify the mode against the actual topology, including failover.

Authenticate the service and the user

Keep address restrictions where they are useful, but do not make them the sole proof of identity for sensitive access. Use properly validated TLS for web services and appropriate authenticated protocols for administration and network peers. Account authentication and permissions still have their own jobs.

TLS 1.3 authenticates the server, can also authenticate the client, and protects application traffic. It does not certify every IP source address or prevent a flood from exhausting a link. Encryption and source validation protect different things.

Reduce opportunities for reflection

If you operate recursive DNS, restrict recursion to the clients you intend to serve. That is different from authoritative DNS, which may need to answer the public for your domains. RFC 5358 explains why open recursion can turn a server into a reflector.

Check other exposed services for unnecessary reachability and oversized responses. Plan upstream DDoS assistance before an incident: filtering on your own server cannot restore a connection already saturated before traffic reaches it.

IPv6 needs these decisions too

Moving to IPv6 does not automatically turn on encryption or prevent source spoofing. IPsec requires deliberate configuration and key management, and can be used with both IP versions. IPv6 operational security guidance discusses the actual controls needed. In a dual-stack network, assess and test both paths.

Check that the protection works without breaking service

Record expected ranges and routes, test authorised traffic and failover, then examine drops and service health. An intrusion detection system can alert you to patterns; blocking requires a prevention function or an operator's response. Logs should help explain what happened, not turn a claimed source into a presumed identity.

As an ordinary Internet user, focus on updates, authenticated connections and account security. Ask your provider about source filtering if needed; you cannot fix upstream packet validation from a browser. For the background, read how a forged source works or which attack pattern each control addresses.