USB Networking

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m
(+cat)
Line 36: Line 36:
 
<span id="bottom"></span>  
 
<span id="bottom"></span>  
 
{{Languages|USB Networking}}
 
{{Languages|USB Networking}}
 +
 +
[[Category:Hardware]]

Revision as of 10:26, 16 July 2007

Contents

Neo1973 side

By default Neo1973 has usb0 interface working due to Ethernet gadget (g_ether) compiled into kernel.

Desktop side

Manual method

Modprobe usbnet module and configure usb0 interface:

ifconfig usb0 192.168.0.200 netmask 255.255.255.0

Automatic method

Took from Hotplugging usbnet post by Marcin 'Hrw' Juszkiewicz.

Edit /etc/network/interfaces file (in Debian or similiar distros):

allow-hotplug usb0
iface usb0 inet static
        address 192.168.0.200
        netmask 255.255.255.0
        network 192.168.0.0
        post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -P FORWARD ACCEPT

And now when you connect phone (which has 192.168.0.202 IP) it gets connection to world automatically.

Connecting to phone

Then ssh root@192.168.0.202 with empty password to get into phone.

Personal tools

Neo1973 side

By default Neo1973 has usb0 interface working due to Ethernet gadget (g_ether) compiled into kernel.

Desktop side

Manual method

Modprobe usbnet module and configure usb0 interface:

ifconfig usb0 192.168.0.200 netmask 255.255.255.0

Automatic method

Took from Hotplugging usbnet post by Marcin 'Hrw' Juszkiewicz.

Edit /etc/network/interfaces file (in Debian or similiar distros):

allow-hotplug usb0
iface usb0 inet static
        address 192.168.0.200
        netmask 255.255.255.0
        network 192.168.0.0
        post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -P FORWARD ACCEPT

And now when you connect phone (which has 192.168.0.202 IP) it gets connection to world automatically.

Connecting to phone

Then ssh root@192.168.0.202 with empty password to get into phone.