policy route for locally originating traffic

Rolf <[email protected]> Mon, 14 Dec 2015 12:27:27 +1100
Newsgroups gmane.os.openbsd.pf
Message-ID <[email protected]>
Hello=20

I=E2=80=99m new to pf and am using it on OS X 10.11

When I have my OS X host connected to two networks, say Wifi and a wired =
ethernet I=E2=80=99d like to arrange for specific services to specific de=
stinations be directed to the wifi network, while the ethernet carries ot=
her traffic.

No matter what combination I try with pfctl I cannot make it work.

In the documentation there is the - correct - implication that all routin=
g is that defined as traffic arriving on one interface and leaving on ano=
ther, which is not the case when I am using a single OS X host.  So I=E2=80=
=99m tempted to think this rather perverted use of routing is simply not =
possible with pf.=20

I=E2=80=99ve tried many combinations but typically they are variations on=
 this:

pfctl pass route-to ($device $gateway) from any to $destinationNetwork $s=
ervice

I=E2=80=99ve tried explicitly stating interfaces and their direction (in,=
 out) as well as stating tcp protocol as well.  I=E2=80=99ve simplified f=
urther leaving out the service involved, I=E2=80=99ve also tried using th=
e reply-to command but I don=E2=80=99t believe i need that.

I know the config has an effect usually by my tests breaking all connecti=
vity...

So I=E2=80=99d be very appreciative if I can be shown a way to setup the =
above config.  So I can get access to particular services via one interfa=
ce while everything else goes via the other.  Or to say its not possible.

Thanks very much,

r.