X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sbin%2Fgrml-sniff;h=cbb8ec1272bbdbe7062da3a1be785b69c2dd46f7;hb=0c5295bc84618bed1e33e153db888a93b61428a6;hp=cf418336270cf89b148371b21cd690b374000309;hpb=4dd28e782446cb5101be9cb1ce5eb3d4df4003e3;p=grml-network.git diff --git a/sbin/grml-sniff b/sbin/grml-sniff index cf41833..cbb8ec1 100755 --- a/sbin/grml-sniff +++ b/sbin/grml-sniff @@ -16,18 +16,13 @@ usage_info() einfo "Configure via $CONFIG_FILE - see man 8 grml-sniff" ; eend 0 } -if ! [ -r "$CONFIG_FILE" ] ; then - eerror "$CONFIG_FILE could not be read." - exit 1 -fi - -. "$CONFIG_FILE" - -if [ -z "$BRIDGE_DEVICES" ] ; then - eerror "Bridge devices (\$BRIDGE_DEVICES) not set in $CONFIG_FILE" - exit 1 +if [ -r "$CONFIG_FILE" ] ; then + . "$CONFIG_FILE" +else + ewarn "Could not read $CONFIG_FILE" fi +# defaults if unconfigured [ -n "$BRCTL" ] || BRCTL='brctl' [ -n "$BRIDGE_NAME" ] || BRIDGE_NAME='br0' [ -n "$BRIDGE_DEVICES" ] || BRIDGE_DEVICES='eth0 eth1' @@ -50,6 +45,10 @@ case "$1" in check4root || exit 1 einfo "Starting sniffing setup" eindent + + einfo "Disabling IPv6 to avoid neighbor solicitation/multicast traffic" + echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 + einfo "Creating bridge device" brctl addbr "$BRIDGE_NAME" eend $? @@ -103,6 +102,9 @@ case "$1" in ifconfig "$BRIDGE_NAME" down || /bin/true brctl delbr "$BRIDGE_NAME" eend $? + + einfo "Re-enabling IPv6" + echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6 eoutdent ;;