Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openstack-build-ubuntu
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
David Johnson
openstack-build-ubuntu
Commits
b32f6568
Commit
b32f6568
authored
Oct 27, 2016
by
David Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add control net anti-spoofing ebtables rules for linuxbridge support.
parent
733bace8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
25 deletions
+13
-25
setup-linuxbridge-node.sh
setup-linuxbridge-node.sh
+13
-25
No files found.
setup-linuxbridge-node.sh
View file @
b32f6568
...
...
@@ -289,10 +289,6 @@ if [ ! ${HAVE_SYSTEMD} -eq 0 ] ; then
systemctl daemon-reload
fi
logtend
"linuxbridge-node"
exit
0
#
# Install a basic ARP reply filter that prevents us from sending ARP replies on
# the control net for anything we're not allowed to use (i.e., we can reply for
...
...
@@ -307,36 +303,28 @@ OURNET=`ip addr show br-ex | sed -n -e 's/.*inet \([0-9\.\/]*\) .*/\1/p'`
OURPORT
=
`
ovs-ofctl show br-ex |
sed
-n
-e
"s/[
\t
]*
\(
[0-9]*
\)
(
${
EXTERNAL_NETWORK_INTERFACE
}
.*
\$
/
\1
/p"
`
#
# Ok, make the anti-ARP spoofing rules live, and also place them in the right
# place to be picked up by our neutron openvswitch agent so that when it
# remove_all_flows() it also installs our "system" defaults.
# Ok, make the anti-ARP spoofing rules live, and ensure they get
# saved/loaded across reboot.
#
m
kdir
-p
/etc/neutron/ovs-default-flow
s
FF
=
/etc/neutron/ovs-default-flows/br-ex
touch
${
FF
}
m
aybe_install_packages ebtable
s
service_enable ebtables
service_restart ebtables
FLOW
=
"dl_type=0x0806,nw_proto=0x2,arp_spa=
${
ctlip
}
,actions=NORMAL"
ovs-ofctl add-flow br-ex
"
$FLOW
"
echo
"
$FLOW
"
>>
$FF
ebtables
-A
FORWARD
-p
0x0806
--arp-opcode
2
--arp-ip-src
${
ctlip
}
-j
ACCEPT
for
addr
in
$PUBLICADDRS
;
do
FLOW
=
"dl_type=0x0806,nw_proto=0x2,arp_spa=
${
addr
}
,actions=NORMAL"
ovs-ofctl add-flow br-ex
"
$FLOW
"
echo
"
$FLOW
"
>>
$FF
ebtables
-A
FORWARD
-p
0x0806
--arp-opcode
2
--arp-ip-src
${
addr
}
-j
ACCEPT
done
# Allow any inbound ARP replies on the control network.
FLOW
=
"dl_type=0x0806,nw_proto=0x2,arp_spa=
${
OURNET
}
,in_port=
${
OURPORT
}
,actions=NORMAL"
ovs-ofctl add-flow br-ex
"
$FLOW
"
echo
"
$FLOW
"
>>
$FF
ebtables
-A
FORWARD
-p
0x0806
--arp-opcode
2
--arp-ip-src
${
OURNET
}
--in-interface
${
EXTERNAL_NETWORK_INTERFACE
}
-j
ACCEPT
# Drop any other control network addr ARP replies on the br-ex switch.
FLOW
=
"dl_type=0x0806,nw_proto=0x2,arp_spa=
${
OURNET
}
,actions=drop"
ovs-ofctl add-flow br-ex
"
$FLOW
"
echo
"
$FLOW
"
>>
$FF
ebtables
-A
FORWARD
-p
0x0806
--arp-opcode
2
--arp-ip-src
${
OURNET
}
-j
DROP
# Also, drop Emulab vnode control network addr ARP replies on br-ex!
FLOW
=
"dl_type=0x0806,nw_proto=0x2,arp_spa=172.16.0.0/12,actions=drop"
ovs-ofctl add-flow br-ex
"
$FLOW
"
echo
"
$FLOW
"
>>
$FF
ebtables
-A
FORWARD
-p
0x0806
--arp-opcode
2
--arp-ip-src
172.16.0.0/12
-j
DROP
logtend
"linuxbridge-node"
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment