3
# host-rules Start/Stop the networking host rules
5
# chkconfig: 2345 85 15
6
# description: Networking Host Rules for Multi Tenancy Protections
8
# Copyright 2010 OpenStack LLC.
11
# Licensed under the Apache License, Version 2.0 (the "License"); you may
12
# not use this file except in compliance with the License. You may obtain
13
# a copy of the License at
15
# http://www.apache.org/licenses/LICENSE-2.0
17
# Unless required by applicable law or agreed to in writing, software
18
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
20
# License for the specific language governing permissions and limitations
23
IPTABLES=/sbin/iptables
24
EBTABLES=/sbin/ebtables
25
ARPTABLES=/sbin/arptables
29
$IPTABLES -P FORWARD DROP
30
$IPTABLES -A FORWARD -m physdev --physdev-in eth0 -j ACCEPT
31
$IPTABLES -A FORWARD -m physdev --physdev-in eth1 -j ACCEPT
36
$EBTABLES -P FORWARD DROP
37
$EBTABLES -A FORWARD -o eth0 -j ACCEPT
38
$EBTABLES -A FORWARD -o eth1 -j ACCEPT
43
$ARPTABLES -P FORWARD DROP
44
$ARPTABLES -A FORWARD --opcode Request --in-interface eth0 -j ACCEPT
45
$ARPTABLES -A FORWARD --opcode Reply --in-interface eth0 -j ACCEPT
46
$ARPTABLES -A FORWARD --opcode Request --in-interface eth1 -j ACCEPT
47
$ARPTABLES -A FORWARD --opcode Reply --in-interface eth1 -j ACCEPT
52
$IPTABLES -P FORWARD ACCEPT
53
$IPTABLES -D FORWARD -m physdev --physdev-in eth0 -j ACCEPT
54
$IPTABLES -D FORWARD -m physdev --physdev-in eth1 -j ACCEPT
59
$EBTABLES -P FORWARD ACCEPT
60
$EBTABLES -D FORWARD -o eth0 -j ACCEPT
61
$EBTABLES -D FORWARD -o eth1 -j ACCEPT
66
$ARPTABLES -P FORWARD ACCEPT
67
$ARPTABLES -D FORWARD --opcode Request --in-interface eth0 -j ACCEPT
68
$ARPTABLES -D FORWARD --opcode Reply --in-interface eth0 -j ACCEPT
69
$ARPTABLES -D FORWARD --opcode Request --in-interface eth1 -j ACCEPT
70
$ARPTABLES -D FORWARD --opcode Reply --in-interface eth1 -j ACCEPT
102
echo $"Usage: $0 {start|stop|restart}"