Transmit Test Signal Over Ethernet Port

Can someone point me in the right direction to write a program on my BBB to output on the ethernet a random test signal?

-how do I configure the ethernet port as an output?
-how do I write?send? from it?

Thanks