Can a multihomed Linux machine implement a true [Strong ES Model](http://wiki.treck.com/Appendix_C:_Strong_End_System_Model_/_Weak_End_System_Model)?

###Specific Use Case

I have a system with five different interfaces, each connected to the same subnet, thus the same gateway to the Internet.

* I would like to listen on each interface separately on the same port, and ensure that packets always go out the same interface they came in, and ensure that packets trying to come in the "wrong" interface are discarded.
* I would like to be able to bind to each interface and make outgoing connections to Internet destinations that always originate from the same source IP I bound to. For example,

```
curl --interface *interface\_ip* http://ipecho.net/plain
```

should always show the same IP address I bound to with `--interface`.

* Static routes may be problematic due to using DHCP on one of these interfaces.

### RFC 1122

From [RFC 1122](https://www.rfc-editor.org/rfc/rfc1122#section-3.3.4.2) - Requirements for Internet Hosts - Communication Layers, [Section 3.3.4.2 – Multihoming Requirements](https://www.rfc-editor.org/rfc/rfc1122#page-62):

> 
> Internet host implementors have used two different
> conceptual models for multihoming, briefly summarized
> in the following discussion.  This document takes no
> stand on which model is preferred; each seems to have a
> place.  This ambivalence is reflected in the issues (A)
> and (B) being optional.
> 
> 
> 

* Strong ES Model

	The Strong ES (End System, i.e., host) model
	emphasizes the host/gateway (ES/IS) distinction,
	and would therefore substitute MUST for MAY in
	issues (A) and (B) above.  It tends to model a
	multihomed host as a set of logical hosts within
	the same physical host.  

	With respect to (A), proponents of the Strong ES
	model note that automatic Internet routing
	mechanisms could not route a datagram to a
	physical interface that did not correspond to the
	destination address.

> 
> 

```
         route(src IP addr, dest IP addr, TOS) -> gateway

```

Here the source address is included as a parameter
in order to select a gateway that is directly
reachable on the corresponding physical interface. 
Note that this model logically requires that in
general there be at least one default gateway, and
preferably multiple defaults, for each IP source
address.  

> 
> 

* Weak ES Model

	This view de-emphasizes the ES/IS distinction, and
	would therefore substitute MUST NOT for MAY in
	issues (A) and (B).  This model may be the more
	natural one for hosts that wiretap gateway routing
	protocols, and is necessary for hosts that have
	embedded gateway functionality.

> 
> 

```
         route(dest IP addr, TOS) -> gateway, interface

```

Linux is a Weak ES model by default, whereas FreeBSD and other Unix varieties act as Strong ES systems. Is there any way to make it behave more like a Strong ES system?

What `sysctl` or compile-time config would need to be set to make it behave like a Strong ES by default, without adding specific routing rules for any new interface you add? I know we can do strict source-route filtering via `net.ipv4.conf.default.rp_filter = 1`, but there seems to be much more to it than that. How can I do Source-Based Routing by default?