diff --git a/delay-jitter-packetloss.sh b/delay-jitter-packetloss.sh new file mode 100644 index 0000000..a28189f --- /dev/null +++ b/delay-jitter-packetloss.sh @@ -0,0 +1,13 @@ +# +# Add output delay, jitter and packet loss. +# +# +-- delay +-- lost percent +# +-- interface | +-- jitter | +-- burst +# v v v v v +tc qdisc add dev eth1 root netem delay 10ms 1ms distribution normal loss 4% 10% + +# Change. +tc qdisc change dev eth1 root netem delay 10ms 1ms distribution normal loss 4% 10% + +# Delete. +tc qdisc del dev eth1 root netem diff --git a/virtualbox.sh b/virtualbox.sh index 854ce5f..6395694 100644 --- a/virtualbox.sh +++ b/virtualbox.sh @@ -8,7 +8,7 @@ VBoxManage list hostinfo VBoxManage list bridgedifs VBoxManage list ostypes - + # Create a vm. VBoxManage createvm -name VMNAME @@ -56,15 +56,15 @@ --cableconnected5 on --cableconnected6 on --cableconnected7 on --cableconnected8 on \ --macaddress1 00001D3C5F00 --macaddress2 00001D3C5F01 --macaddress3 00001D3C5F02 --macaddress4 00001D3C5F03 \ --macaddress5 00001D3C5F04 --macaddress6 00001D3C5F05 --macaddress7 00001D3C5F06 --macaddress8 00001D3C5F07 \ - + # NIC with NAT. VBoxManage modifyvm VMNAME --nic1 nat - + # NIC host only. VBoxManage modifyvm VMNAME --nic1 hostonly --hostonlyadapter1 vboxnet0 - + # NIC with udp tunnel. - VBoxManage modifyvm VMNAME --nic1 generic --nicgenericdrv1 UDPTunnel --nicproperty1 dest=127.0.0.1 --nicproperty1 dport=9000 --nicproperty1 sport=9001 + VBoxManage modifyvm VMNAME --nic1 generic --nicgenericdrv1 UDPTunnel --nicproperty1 dest=127.0.0.1 --nicproperty1 dport=9000 --nicproperty1 sport=9001 # NIC bridged with real host interface. VBoxManage modifyvm VMNAME --nic1 bridged --bridgeadapter1 eth1 @@ -74,7 +74,7 @@ # VM serial port to host tcp server socket. VBoxManage modifyvm VMNAME --uart1 0x3f8 4 --uartmode1 tcpserver 2000 - + # See the vm configuration. VBoxManage showvminfo VMNAME @@ -86,7 +86,7 @@ # Create a hdd disk. VBoxManage createmedium disk --filename hdddisk.vdi --size 2048 --format VDI --variant Standard - + # Add hdd to vm. VBoxManage storageattach VMNAME --storagectl sata --port 0 --type hdd --mtype normal --medium FILENAME.vdi @@ -115,7 +115,7 @@ # Compact a hdd. VBoxManage modifymedium FILENAME.vdi --compact - + #----- Serial port to host pipe ----- # Install socat: