pktgen.conf-1-1-ip6 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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
  22. CLONE_SKB="clone_skb 1000000"
  23. # NIC adds 4 bytes CRC
  24. PKT_SIZE="pkt_size 66"
  25. # COUNT 0 means forever
  26. #COUNT="count 0"
  27. COUNT="count 10000000"
  28. DELAY="delay 0"
  29. PGDEV=/proc/net/pktgen/eth1
  30. echo "Configuring $PGDEV"
  31. pgset "$COUNT"
  32. pgset "$CLONE_SKB"
  33. pgset "$PKT_SIZE"
  34. pgset "$DELAY"
  35. pgset "dst6 fec0::1"
  36. pgset "src6 fec0::2"
  37. pgset "dst_mac 00:04:23:08:91:dc"
  38. # Time to run
  39. PGDEV=/proc/net/pktgen/pgctrl
  40. echo "Running... ctrl^C to stop"
  41. trap true INT
  42. pgset "start"
  43. echo "Done"
  44. cat /proc/net/pktgen/eth1