There are basically two approaches to this.
One is the firewalling aproach. You create explicit rules to restrict the traffic, for example on a Linux router you would create rules using iptables.
The other is the reverse path filtering approach discussed in RFC3704. This talks about three filtering modes. Strict, loose and feasible.
- Strict mode only accepts packets if their input interface matches the best path for their source address.
- Feasible mode only accepts packets if their input interface is a feasible path.
- Loose mode only accepts packets if there is some route available to thier source address.
Strict mode is appropriate for tree networks where all routing is symetric and each destination is reachable through exactly one route but it is too strict for use in more complex networks.
Loose mode is useful for dropping private IP traffic on default-free routers but provides little protection against other spoofing and is pretty useless on systems that are not default-free.
Feasible mode provides somewhat effective filtering for more complex networks while reducing the risk of blocking legitimate traffic. However it is more troublesome to implement. Routers (both hardware and software) are designed to quickly determine if an IP is reachable and if-so what the best path is. Determining whether a path is feasible requires a different sort of table.
Systems may use different modes for different interfaces, so interfaces to simple user networks can be in strict mode while core interfaces and links to peers, upstreams and large customers can be in feasible or loose mode.
I get the impression that support for feasible mode is limited to high end routers.