ipfw add 100 skipto 300 tag 1 in recv $ext_if1 keep-state
ipfw add 200 skipto 300 tag 2 in recv $ext_if2 keep-state
ipfw add 300 allow { recv $ext_if1 or recv $ext_if2 } # inbound packets
ipfw add 400 allow in recv $int_if # for internal NIC
ipfw add 500 fwd $gw1 tagged 1 # reply-to GW1 packets, which tagged with "tag1"
ipfw add 600 fwd $gw2 tagged 2 # reply-to GW2 packets, which tagged with "tag2"
Thank you so much. What does mean '$gw1'?Hello.
You can use a combination of "tag", "skipto" and "fwd" keywords. Next example was found on internet:
Code:ipfw add 100 skipto 300 tag 1 in recv $ext_if1 keep-state ipfw add 200 skipto 300 tag 2 in recv $ext_if2 keep-state ipfw add 300 allow { recv $ext_if1 or recv $ext_if2 } # inbound packets ipfw add 400 allow in recv $int_if # for internal NIC ipfw add 500 fwd $gw1 tagged 1 # reply-to GW1 packets, which tagged with "tag1" ipfw add 600 fwd $gw2 tagged 2 # reply-to GW2 packets, which tagged with "tag2"
PS. I'm not sure that all of the rules work because this example from 2009 year.
all right, thanks anywayNo, I don't use IPFW anymore.
Thank you so much. Do you know how to express the syntax of dup-to or reply-to ipfw commands?it simulates a policy based routing
gw1 and gw2 are the gateways for 2 providers
so packets that come in thru isp1 are replied thru isp1 and packets that come in thru isp2 are replied thru isp2