add fake promisc setup scripts for tera mac-flipping.

This commit is contained in:
fumingwei
2020-12-03 16:53:34 +06:00
parent cf2e80c4d7
commit 75b1e7db47
4 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
[Service]
ExecStartPre=/bin/bash tera_fake_promisc_setup.sh

View File

@@ -0,0 +1,4 @@
set -ex
dp_adapter_ether_addr=$(ifconfig ens1f2 | grep ether | awk '{print $2}')
bpf_rule="ether dst $dp_adapter_ether_addr or ether dst 02:42:c0:a8:fd:03 or ether dst 02:42:c0:a8:fd:83 or ether dst 02:42:c0:a8:fd:82"
sed -i "/BSD_packet_filter=/s/=.*/=\"$bpf_rule\"/" etc/sapp.toml