Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I was wondering if anyone knew of an easy way to capture only the ip addresses on one side of a connection. I have a transparent Linux bridge with iptables enabled so that I can do network accounting with iptables for traffic passing across the bridge. However, I am doing this with an ipaddress for each host in the rules. I want to script a way to make sure I have a rule for each host on one side of the bridge. I know you can log ip data, but I was wondering if there was something available to just get a list of ip addresses, or maybe I am missing a way to do it in iptables.

Thank you for any ideas.

TonyZ

share|improve this question

1 Answer 1

Um, you mean iptables rules that will match the physical interfaces instead of the bridge interface?

iptables -A $CHAIN -m physdev --physdev-in $IN_IFACE -j $TARGET

Will that do?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.