From ba05fd363b51de96f64649d8e812b400b273ea9e Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Fri, 5 Jun 2015 16:10:21 -0700 Subject: [PATCH] Warn if bridge netfilter (firewall) is enabled Newer linux kernels enable filtering on the linux bridge; this can prevent it from working in mininet! --- mininet/nodelib.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mininet/nodelib.py b/mininet/nodelib.py index a2f8707..8f6e711 100644 --- a/mininet/nodelib.py +++ b/mininet/nodelib.py @@ -7,6 +7,7 @@ This contains additional Node types which you may find to be useful. from mininet.node import Node, Switch from mininet.log import info, warn from mininet.moduledeps import pathCheck +from mininet.util import quietRun import re @@ -59,8 +60,14 @@ class LinuxBridge( Switch ): @classmethod def setup( cls ): - "Make sure our class dependencies are available" + "Check dependencies and warn about firewalling" pathCheck( 'brctl', moduleName='bridge-utils' ) + # Disable Linux bridge firewalling so that traffic can flow! + for table in 'arp', 'ip', 'ip6': + cmd = 'sysctl net.bridge.bridge-nf-call-%stables' % table + out = quietRun( cmd ).strip() + if out.endswith( '1' ): + warn( 'Warning: Linux bridge may not work with', out, '\n' ) class NAT( Node ):