The Noob wrote:
> I have a small question.
> I have two interface in two vlans.
> The first interface 192.168.0.1 255.255.255.0
> The second interface: 10.228.44.1 255.255.255.0
> The gateway for the first interface must be 192.168.0.254 and the second
> interface must be 10.228.44.254
> How can I configure them? In rc.conf we have just defaultrouter but we can't
> specify the interface.

I'm guessing you want the gateway to be chosen based on the source
address, correct? The kernel does not support routing based on the
source address.

I use ipfw and fwd rules to achieve this:

ipfw add fwd 10.228.44.254 ip from 10.22.44.1 to not 10.22.44.0/24

Then you can leave the default_gateway as 192.168.0.254.

You might need IPFIREWALL_FORWARD in your kernel config. See ipfw(8).

-- 
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley

Attachment: pgpiKYKLmOr9K.pgp
Description: PGP signature

Reply via email to