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

iptables禁止某个mac地址上网

时间:2019-01-12 15:32:19      阅读:338      评论:0      收藏:0      [点我收藏+]

标签:时间   tail   https   nbsp   detail   details   博客   智能   tar   

iptables -I FORWARD  -m mac --mac-source  60:14:B3:7D:6B:39 -j DROP
上面这条命令测试过是可行,禁止这个mac地址上网,马上禁止马上生效
iptables -I FORWARD  -m mac --mac-source 60:14:B3:7D:6B:39 -j ACCEPT
解除禁止
----------------------------------------------------------------------------------------------------------------------------------------------------------
以下未经测试
----------------------------------------------------------------------------------------------------------------------------------------------------------
//下面的不一定对可以参考
iptables -I FORWARD  -m mac --mac-source 00:00:00:00:00:01 -m time --timestart 8:15 --timestop 12:30 -j DROP
把上面的修改语句放到 rc.local 内
00:00:00:00:00:01 填mac
timestart 8:15 开始时间
--timestop 12:30 结束时间

域名过滤
iptables -I FORWARD  -m mac --mac-source 00:00:00:00:00:01 -m time --timestart 8:15 --timestop 12:30 -j DROP
iptables -I FORWARD --dst 66.66.66.66 -j DROP
66.66.66.66 改为目标过滤的ip
域名 暂时智能用 ip来

文件 在 /etc/rc.local
---------------------
作者:坚持每天写一篇博客
来源:CSDN
原文:https://blog.csdn.net/dai_xiangjun/article/details/40213485
版权声明:本文为博主原创文章,转载请附上博文链接!

iptables禁止某个mac地址上网

标签:时间   tail   https   nbsp   detail   details   博客   智能   tar   

原文地址:https://www.cnblogs.com/ricks/p/10259631.html

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