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.
|