Routing through two networks

Dinesh Nair dinesh at
Wed Apr 23 02:36:50 PDT 2003

On Wed, 23 Apr 2003, Jonathan wrote:

> All I'm trying to do is ensure that any traffic that comes in for
> routes back out through and anything that comes in
> for routes back out through keeping bandwidth
> charges to a minimum.

it's interesting that you're asking the very same question i asked on this
list yesterday. i had the same problem, where i wanted traffic incoming on
one interface to go out the same on a dual homed box.

playing around with ipfw's fwd directive, i came to the following
solution. set the default route to the router on one interface, say a
default route to then add the following ipfw rule

ipfw fwd ip from to any

this way, traffic which is outgoing from will hit the forward
rule and be sent on a next hop of, while all other traffic will
obey the default rule and go out with a next hop

this works for me, but my question was if this is the optimum way of
solving this problem.

Regards,                           /\_/\   "All dogs go to heaven."
dinesh at                (0 0)
| for a in past present future; do                                        |
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo "The opinions here in no way reflect the opinions of my $a $b."  |
| done; done                                                              |

More information about the freebsd-questions mailing list