[
https://issues.apache.org/jira/browse/CLOUDSTACK-10138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16268109#comment-16268109
]
ASF GitHub Bot commented on CLOUDSTACK-10138:
---------------------------------------------
bwsw closed pull request #2319: CLOUDSTACK-10138: Load br_netfilter in
security_group management script
URL: https://github.com/apache/cloudstack/pull/2319
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/scripts/vm/network/security_group.py
b/scripts/vm/network/security_group.py
index 9e3eeb062bb..f4bf87b670e 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -38,8 +38,11 @@
bash = Command("/bin/bash")
ebtables = Command("ebtables")
driver = "qemu:///system"
+br_netfilter_module = "br_netfilter"
+
cfo = configFileOps("/etc/cloudstack/agent/agent.properties")
hyper = cfo.getEntry("hypervisor.type")
+
if hyper == "lxc":
driver = "lxc:///"
@@ -61,6 +64,15 @@ def execute(cmd):
logging.debug(cmd)
return bash("-c", cmd).stdout
+def load_kernel_module(module_name):
+ module_proc_file = "/proc/modules"
+ idx = execute("grep -E '^%s' %s | cut -f1 -d' '" % (module_name,
module_proc_file)).find(module_name)
+ if idx == -1:
+ logging.debug("Module %s is absent. Load it." % (module_name))
+ execute("modprobe %s" % (module_name))
+ else:
+ logging.debug("Module %s is loaded. Skip loading." % (module_name,))
+
def can_bridge_firewall(privnic):
try:
execute("which iptables")
@@ -1149,8 +1161,13 @@ def getBrfw(brname):
brfwname = "BF-" + brname
return brfwname
+
def addFWFramework(brname):
try:
+ # Check if br_netfilter module is present. Further sysctl ops require
it online.
+ # Load if absent
+ load_kernel_module(br_netfilter_module)
+
execute("sysctl -w net.bridge.bridge-nf-call-arptables=1")
execute("sysctl -w net.bridge.bridge-nf-call-iptables=1")
execute("sysctl -w net.bridge.bridge-nf-call-ip6tables=1")
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Load br_netfilter in security_group management script
> -----------------------------------------------------
>
> Key: CLOUDSTACK-10138
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10138
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: cloudstack-agent
> Affects Versions: 4.10.0.0
> Environment: Ubuntu 14.04
> Reporter: Ivan Kudryavtsev
>
> When setting
> sysctl -w net.bridge.bridge-nf-call-arptables=1
> sysctl -w net.bridge.bridge-nf-call-iptables=1
> sysctl -w net.bridge.bridge-nf-call-ip6tables=1
> /usr/share/cloudstack-common/scripts/vm/network/security_group.py
> doesn't check that br_netfilter is load.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)