Skip to content

Instantly share code, notes, and snippets.

@boina-n
Created October 22, 2017 16:05
Show Gist options
  • Save boina-n/8f439b461cc2a7d103bccd7a41c4d62c to your computer and use it in GitHub Desktop.
Save boina-n/8f439b461cc2a7d103bccd7a41c4d62c to your computer and use it in GitHub Desktop.
TcprewriteAndReplay.sh
Interface DE : 172.16.1.[1-63]
ifconfig |grep -B3 172.16
# Depuis le serveur DNS
dif=bond1
dip=$(ip addr show dev $dif | egrep -o '(addr:)?([0-9]*\.){3}[0-9]*' | head -n1)
dmac=$(ip link show dev $dif | egrep -o '(link/ether:)?([0-9a-f]{2}\:){5}[0-9a-f]{2}' |head -n1)
echo -e "dmac=$dmac \ndip=$dip"
coller la sortie sur le'injecteur.
sif=bond1
sip=$(ip addr show dev $sif | egrep -o '(addr:)?([0-9]*\.){3}[0-9]*' | head -n1)
smac=$(ip link show dev $sif | egrep -o '(link/ether:)?([0-9a-f]{2}\:){5}[0-9a-f]{2}' |head -n1)
time=$(date +"%Y%m%d-%H.%M.%S")
echo $time
tcprewrite -i pcaps/traficnominal/traficnominal.pcap -S 0.0.0.0/0:$sip/32 --enet-smac=$smac --enet-vlan=del -D 0.0.0.0/0:$dip/32 --enet-dmac=$dmac -C -o pcaps/tmp/injection.$time
resperf = outils test de charge. (resultat = la charge maximal)
tcpreplay
tcprewrite : récriture des captures.
tcpreplay : = test de d'endurence.
tcpreplay --enable-file-cache --timer=gtod -i bond1 -p 1000 -l0 pcaps/tmp/injection.$time
tcpreplay -i $sif -p 35000 -l0 pcaps/tmp/injection.$time
[root@pfq-dns-iso10-a ~]# sar -n DEV 1 1000
[ set de 10 tirs avec resperf]
dig @$host boina.fr
host=172.16.1.2
for i in seq {1..9}; do resperf -d pcaps/resperf/queries_01-07-2008_and_queries1819_and_queries-pointe.log -s $host -f inet -p 53 -e 2> /dev/null |grep throughput ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment