suricata, find interface in absence of default gateway

This commit is contained in:
t3chn0m4g3 2016-08-09 23:26:03 +00:00
parent b6707b70ba
commit 79790c51a9
2 changed files with 5 additions and 5 deletions

View file

@ -88,11 +88,6 @@ fuSURICATA () {
mkdir -p /data/suricata/log
chmod 760 -R /data/suricata
chown tpot:tpot -R /data/suricata
# Get IF, disable offloading, enable promiscious mode
myIF=$(ip route | grep $(hostname -I | awk '{print $1 }') | awk '{print $3 }')
/sbin/ethtool --offload $myIF rx off tx off
/sbin/ethtool -K $myIF gso off gro off
/sbin/ip link set $myIF promisc on
}
case $1 in

View file

@ -7,6 +7,11 @@ After=docker.service
Restart=always
ExecStartPre=-/usr/bin/docker stop suricata
ExecStartPre=-/usr/bin/docker rm -v suricata
# Get IF, disable offloading, enable promiscious mode
ExecStartPre=-myIF=$(/sbin/ip route | /bin/grep $(/bin/hostname -I | /usr/bin/awk '{print $1 }') | /usr/bin/awk '{print $3 }')
ExecStartPre=-/sbin/ethtool --offload $myIF rx off tx off
ExecStartPre=-/sbin/ethtool -K $myIF gso off gro off
ExecStartPre=-/sbin/ip link set $myIF promisc on
ExecStartPre=/bin/bash -c '/usr/bin/clean.sh suricata off'
ExecStart=/usr/bin/docker run --name suricata --cap-add=NET_ADMIN --net=host --rm=true -v /data/suricata:/data/suricata dtagdevsec/suricata:latest1610
ExecStop=/usr/bin/docker stop suricata