pktgen.conf-1-1-ip6-rdos 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. #modprobe pktgen
  3. function pgset() {
  4. local result
  5. echo $1 > $PGDEV
  6. result=`cat $PGDEV | fgrep "Result: OK:"`
  7. if [ "$result" = "" ]; then
  8. cat $PGDEV | fgrep Result:
  9. fi
  10. }
  11. # Config Start Here -----------------------------------------------------------
  12. # thread config
  13. # Each CPU has its own thread. One CPU example. We add eth1.
  14. # IPv6. Note increase in minimal packet length
  15. PGDEV=/proc/net/pktgen/kpktgend_0
  16. echo "Removing all devices"
  17. pgset "rem_device_all"
  18. echo "Adding eth1"
  19. pgset "add_device eth1"
  20. # device config
  21. # delay 0 means maximum speed.
  22. # We need to do alloc for every skb since we cannot clone here.
  23. CLONE_SKB="clone_skb 0"
  24. # NIC adds 4 bytes CRC
  25. PKT_SIZE="pkt_size 66"
  26. # COUNT 0 means forever
  27. #COUNT="count 0"
  28. COUNT="count 10000000"
  29. DELAY="delay 0"
  30. PGDEV=/proc/net/pktgen/eth1
  31. echo "Configuring $PGDEV"
  32. pgset "$COUNT"
  33. pgset "$CLONE_SKB"
  34. pgset "$PKT_SIZE"
  35. pgset "$DELAY"
  36. pgset "dst6_min fec0::1"
  37. pgset "dst6_max fec0::FFFF:FFFF"
  38. pgset "dst_mac 00:04:23:08:91:dc"
  39. # Time to run
  40. PGDEV=/proc/net/pktgen/pgctrl
  41. echo "Running... ctrl^C to stop"
  42. trap true INT
  43. pgset "start"
  44. echo "Done"
  45. cat /proc/net/pktgen/eth1