码迷,mamicode.com
首页 > 系统相关 > 详细

centos iptables 防火墙设置 mac过滤

时间:2015-12-16 19:09:42      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

 

1、阻止MAC地址为XX:XX:XX:XX:XX:XX主机的所有通信:

iptables -A INPUT -s 192.168.1.21 -m mac --mac-source XX:XX:XX:XX:XX:XX -j ACCEPT

[!] --mac-source address
Match source MAC address. It must be of the form XX:XX:XX:XX:XX:XX. Note that this only makes sense
for packets coming from an Ethernet device and entering the PREROUTING, FORWARD or INPUT chains.

 

2、可以写脚本限制MAC:

iptables -P FORWARD DROP

for mac in $(cat ipaddressfile); do

iptables -A FORWARD -m mac --mac-source $mac -j ACCEPT

done 

 

3、

centos iptables 防火墙设置 mac过滤

标签:

原文地址:http://www.cnblogs.com/yingsong/p/5051943.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!