[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: avahi-daemon.servic lässt sich nicht durch systemd killen



On Do, Okt 25 2018, Philipp Stanner wrote:

>>	    2. Gibt es eine andere Möglichkeit, wie Ich den mDNS-traffic blocken könnte?

Bau dir a dispatcher Script für NetworkManager:

    #!/bin/bash

    LANG='C'
    INTERFACE=$1  
    STATUS=$2
    NETWORK="MyWifiSSID"  # <-- edit this!
    CURRENT_NETWORK="$(nmcli -t -f NAME conn show --active)" 

    add_firewall_table() {
        nft add table public
        nft add chain public cleanup \{ type filter hook prerouting priority 0\; \}
        # Feel free to add more rules!
        nft add rule public cleanup udp dport mdns drop
    }

    remove_firewall_table() {
        nft delete table public
    }

    if [[ "$CURRENT_NETWORK" != "$NETWORK" ]]; then
       exit 0
    fi

    case "$STATUS" in
        up)        add_firewall_table;;
        down)      remove_firewall_table;;
    esac


Das Teil dann in z. B. in

    /etc/NetworkManager/dispatcher.d/10-fw-public.sh

ablegen and ausführbar machen, `chmod +x ...`. Wenn der NetworkManager
dann events macht, läufts das script and baut die nft rules ein.

S


Reply to: