Skip to contentSkip to conversation

Jumping to chains dynamically based on interface name

DISCUSSION Tore Anderson 1 participant 1 message Oct 8, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I'm building a "router on a stick" type of firewall using netfilter, which have a two dedicated chains per interface (egress+ingress). This causes a large FORWARD and FORWARD-EGRESS chains with rules that match on interface name and jumps to the appopriate interface-specific chain.
I've been wanting to replace them all with just one rule per direction:

iptables -A FORWARD -j ${in-interface}-ingress iptables -A FORWARD-EGRESS -j ${out-interface}-egress

Is that possible somehow?

Best regards,

Signature · 3 lines
Tore Anderson
Redpill Linpro AS - http://www.redpill-linpro.com/
Tel: +47 21 54 41 27