Speno's Pythonic Avocado 19.6.2004

2004-06-19

Tacoma Narrows: Ethernet Bridge Update

I've made some progess on turning my iBook into an ethernet bridge, but nothing is working yet. I've built my patched kernel which is supposed to allow ethernet spoofing. It's not working, however, and I haven't had time to debug it. I posted on the libnet mailing list about it and the response was "total silence." I'll look for help elsewhere soon.

I did find an open-source solution for bridging in userland: tcpreplay. Assuming you can etherspoof, this syntax should do the thing:

% sudo tcpreplay -b -S 0 -i en0 -j en1

Also, the libdnet provides a nice python interface for sending raw ethernet frames (and more!). Check it out:

import dnet def bin2mac(b): """Turn binary mac address into nicer format.""" h = b.encode('hex_codec') return ':'.join([h[i:i+2] for i in range(0,len(h),2)]) intf = 'en0' packet = 'your raw ethernet frame here' datalink = dnet.eth('en0') mac = bin2mac(datalink.get()) print '%s has address %s' % (intf, mac) datalink.send(packet)

Take care.

This post references topics: python
posted at 08:58:40    #    comment []    trackback []
June 2004
MoTuWeThFrSaSu
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
282930    
May
2004
 Aug
2004

One python programmer's search for understanding and avocados. This isn't personal, only pythonic.

XML-Image Letterimage

© 2004-2005, John P. Speno