Skip to content

Instantly share code, notes, and snippets.

@j-keck
j-keck / störfunk
Created November 13, 2014 09:40
lost packets, network latency and rate limit for testing purpose
linux:
# drop packets (10% probability)
iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP
# drop packets (10% probability), add latency (500ms) and limit bandwidth (1Mbps)
tc qdisc add dev eth0 root netem delay 250ms loss 10% rate 1mbps
@j-keck
j-keck / ubuntu: disable dhcp from dnsmasq-base
Created July 5, 2014 06:26
how to disable dhcp server (dnsmasq-base) on ubuntu
dnsmasq from package 'dnsmasq-base' starts with a (from libvirt) generated configuration: /var/lib/libvirt/dnsmasq/default.conf.
this configuration file is not directly editable because it gets overwritten from libvirt.
there is no possibility to set 'no-dhcp-interface=eth0' per 'libvirt'.
# ###########################################################
# deactivate dhcp in dnsmasq per libvirt
# dnsmasq listen on port 53 (dns) and 67 (dhcp)
j@ubuntu:~$ sudo netstat -taupen | grep -E ':53|:67'
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 0 9817 1218/dnsmasq