Last active
December 17, 2015 07:49
-
-
Save you21979/5575706 to your computer and use it in GitHub Desktop.
L2ブリッジ用のMACフィルター
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEVICE=br0 | |
TYPE=Bridge | |
BOOTPROTO=none | |
ONBOOT=yes | |
DELAY=0 | |
STP=off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEVICE="eth1" | |
NM_CONTROLLED="yes" | |
ONBOOT="yes" | |
TYPE="Ethernet" | |
BOOTPROTO="none" | |
BRIDGE=br0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ファイアウォール停止(すべてのルールをクリア) | |
/etc/init.d/iptables stop | |
iptables -F | |
iptables -t nat -F | |
# デフォルトルール(以降のルールにマッチしなかった場合に適用するルール)設定 | |
iptables -P INPUT ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -N chk_mac | |
for macaddr in `cat /root/MAC_LIST/pc.txt` | |
do | |
iptables -A chk_mac -m mac --mac-source $macaddr -j RETURN | |
done | |
iptables -A chk_mac -j LOG --log-prefix "nonregistered MAC addr " | |
iptables -A chk_mac -j DROP | |
iptables -A FORWARD -m physdev --physdev-in eth1 -j chk_mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net.ipv4.ip_forward = 1 | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1 | |
net.bridge.bridge-nf-call-arptables = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VMWAREを使用してる時は管理ツールから仮想スイッチのセキュリティの設定で無差別モードを承諾するにする