quarta-feira, 14 de abril de 2010

Ethernet over USB with N900 and Gentoo

Meta: It's been a while since I got my new N900. I sold my old device to Kleber and I acquired the new N900 from Etrunko, hell I wanted this gadget. This tutorial is for gentooers only, ubuntuers can connect and use it right away without any changes.


Since that date, I've been playing and hacking around this incredible device. Yesterday I was trying to debug why in hell my bloody bastard wifi connection keeps on dropping so often. Opening a terminal and checking dmesg or /var/log/messages on that tiny little screen was a pain, so I decided to try out the ethernet over usb.

You can follow all the above tutorial on a Gentoo box. The only problem I found was to find the correct modules in my kernel to load - as Gentoo doesn't behave as Ubuntu and loads the whole world in the memory. :P

So, here it is:

otubo@minivader ~ $ lsmod|grep usb
usbnet 17188 1 cdc_ether
mii 5212 1 usbnet

Find, compile (if not yet) and load these modules. These modules, with the correct udev rules will create a usb0 interface on both devices. Make sure the interfaces are configured properly to be on the same network.

That's it. Now you're able to plug you USB cable and have a full operational network with it. Enjoy! :-D

[update] DO NOT set a static mac add as said in the original tutorial. In my case, the module g_nokia didn't load just because of this.

2 comentários:

Anônimo disse...

hi, thanks for this post. I was wondering if you went one extra step and setup ip forwarding so you could use your lan internet connection from your n900? By that I mean: access the internet from your n900 using the lan your computer is connected to.

Thanks!

Eduardo Otubo disse...

This is an old scritp to share route packages between two interfaces, the idea should be the same. Any doubts, please let me know :-)

ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain

#script que faz o roteamento de pacotes [a maquina serve como um gateway]
#modprobe ipt_LOG
#modprobe ipt_REJECT
#modprobe ipt_MASQUERADE
#modprobe iptable_nat
#modprobe ip_conntrack_irc
#modprobe ip_conntrack_ftp
#modprobe ip_nat_ftp
#modprobe ip_nat_irc
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT

#Habilita o repasse de pacotes
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE