Is there a way to route traffic based on port?  Basically, I want to have
all traffic on port 8080 use the rl0 interface for its gateway and all other
traffic use dc0.  Here is a diagram of my network.

         Public IP
       ADSL Modem/Router
         FBSD 4.8 --------- rl0
            dc1              |
             |    Neighbor's AP
             |               |
        Internal LAN     Public IP
             |               |       Internet
        Media Server

I'm trying to serve a small video stream via my neighbor's faster Internet
connection and keep all of my other traffic on my Internet connection.  I'm
trying to get the traffic to flow like this:

1.    Media players connect to the public IP on the neighbor's AP (Linksys)
on port 8080.

2.    Neighbor's AP does NAT and forwards traffic on port 8080 to rl0
(  I would like to forward to the media server at
but the Linksys won't allow me to set NAT to forward to a different subnet.

3.    The rl0 interface on my FBSD box is running NAT as well.  I did this
because a simple "ipfw fwd" rule left the destination address as and so my server at ignored the packets as it was
not the destination.  natd with a 'redirect' switch and the corresponding
'divert' rule changes the destination address to

4.    The server receives the syn packet and sends a syn/ack to establish a
connection.  I want to have this packet return on the same path.  However
the default gateway for the media server is  Then because the
default gateway for the FBSD box is (my Internet connection),
the packet goes out and out through my own ISP.  Thus the
connection never gets established.

I can get traffic to flow the way I want by adding a static route on the
FBSD box.  For example, if a media player at initiates a connection
from the Internet and do "route add -host" then the
connection flows.  However this is not practical in normal everyday usage
when I don't know what IPs will connect.

Is what I want possible and if so, what should I read to learn more?



[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to