Loading the 'pktgen' module on Ubuntu Server

Posted by StackedCrooked on Server Fault See other posts from Server Fault or by StackedCrooked
Published on 2010-10-20T13:10:35Z Indexed on 2012/04/16 5:33 UTC
Read the original article Hit count: 570

Filed under:

I would like to enable and use the pktgen module on Ubuntu Server. I have enabed the module by adding a line containing 'pktgen' to the /etc/modules file. After rebooting it seems that the module is successfully loaded because the directory /proc/net/pktgen exists.

However when trying to run the first sample I get these errors:

root@ubuntu:~# bash ./pktgen.conf-1-1 
Removing all devices
Adding eth4
Setting max_before_softirq 10000
Configuring /proc/net/pktgen/eth4
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
./pktgen.conf-1-1: line 9: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
cat: /proc/net/pktgen/eth4: No such file or directory
Running... ctrl^C to stop
Done

It turns out the script simply unable to write a file to the /proc/net/pktgen directory. When I try this manually it fails as well:

root@ubuntu:~# cd /proc/net/pktgen/
root@ubuntu:/proc/net/pktgen# touch eth4 
touch: cannot touch `eth4': No such file or directory

Can anyone help me make it work?

I'm using Ubuntu version: 2.6.32-21-server.

Fixed
I apologize for keeping this post not up to date. I was able to fix it. If I remember well the cause of the error was that eth4 did not exist, or did not have the 'online' status.

Anyway, it is fixed now.

© Server Fault or respective owner

Related posts about kernel-modules