<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5"><div class="gmail_quote"><br>Hello ,<div><br></div><div>I want to use pktgen to do some UDP tests .</div>
<div>So I figured out that pktgen is built in the kernel I am using (2.6.32) and tried to use the bash script given in the internet .</div>
<div><br>
</div><div>Script :</div><div><div><br></div><div>#! /bin/sh</div><div>rmmod pktgen</div><div>cd /usr/src/kernels/linux-2.6.32/net/core</div><div>insmod pktgen.ko</div><div><br></div><div>PGDEV=/proc/net/pktgen/pg0</div>
<div>
function pgset() {</div><div> local result</div><div> echo $1 > $PGDEV</div><div> result=`cat $PGDEV | fgrep "Result: OK:"`</div><div> if [ "$result" = "" ]; then</div><div> cat $PGDEV | fgrep Result:</div>
<div> fi</div><div>}</div><div><br></div><div>function pg() {</div><div> echo inject > $PGDEV</div><div> cat $PGDEV</div><div>}</div><div><br></div><div>pgset "odev eth0"</div><div>pgset "dst 1.1.1.3"</div>
<div><br></div></div><div><br></div><div>I get the following error message :</div><div><br></div><div><div>./ipg: line 11: /proc/net/pktgen/pg0: No such file or directory</div><div>cat: /proc/net/pktgen/pg0: No such file or directory</div>
<div>cat: /proc/net/pktgen/pg0: No such file or directory</div><div>./ipg: line 11: /proc/net/pktgen/pg0: No such file or directory</div><div>cat: /proc/net/pktgen/pg0: No such file or directory</div><div>cat: /proc/net/pktgen/pg0: No such file or directory</div>
<div><br></div></div><div>I am running this as the 'root' user. </div><div>I don't understand how exactly pktgen is informed about the Ethernet interfaces on the system.</div><div><br></div><div>This is what I get for ls /proc/net/pktgen/ ,</div>
<div>kpktgend_0 kpktgend_1 kpktgend_2 kpktgend_3 kpktgend_4 kpktgend_5 kpktgend_6 kpktgend_7 pgctrl</div><div><br></div><div><br></div><div>Please let me know , what is going wrong.</div><div><br></div><div>Thanks !</div>
<div><br></div><div><br></div><div><br></div>
</div><br>
</div></div></blockquote></div><br>