Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question

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


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.