Re: Blocking a mac address

Richard Stearn <[email protected]>
Newsgroups gmane.comp.security.ipcop.user
Organization Someday
Message-ID <[email protected]>
[email protected] wrote:

Hi Stinga

> I have a mac address I which to block from accessing thre internet, it 
> is on the blue network
> 
> [device] [blue] : [ipcop] : [red] --> (bad places)
> 
> I am trying to block all traffic including https.
> I am running squid and squidguard and seems that this is interfering 
> somehow, I can block all traffic but it seems that I can't block https.

Have you tried:

iptables -A CUSTOMINPUT -m mac --mac-source <mac address> -j DROP

You might need to put that rule in CUSTOMPREROUTING rather than CUSTOMINPUT
to catch the packets before they are handed to squid.

iptables -A CUSTOMPREROUTING -t nat -m mac --mac-source <mac address> -j DROP


> On a similar note I would like to track the traffic of specific mac 
> address's as well.
> I want to be able to put a rule in so that I can see the amount of 
> traffic a specific mac address is using across all ports.
> 
> Maybe I can't do it by mac address due to NAT?
> I though I should be able to put a rule of two in to say if traffic is 
> going to this mac address then <do something> then with iptables -nvxL 
> FOO I sgould be able to see the packets and bytes processed?
> 

On the accounting front.  For small number of MAC's it is doable by
creating a chain and then invoking the chain with a rule that has
the 'mac' module loaded.

iptables -N COUNTER
iptables -A CUSTOMINPUT -m mac --mac-source <mac address> -j COUNTER

There does not appear to be a way of adding an accounting rule for a
MAC address.  IP address yes, MAC address no.  I have a bodged
writeipac.pl for adding accounting by IP address.

All the above has been done on IPCop 1.4.21, for 2.x YMMV

Trust the above makes sense.
-- 
Regards
	Richard


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
IPCop-user mailing list
[email protected]
Manage your subscription or unsubscribe
https://lists.sourceforge.net/lists/listinfo/ipcop-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.