View source for USB Networking
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to USB Networking.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to USB Networking.
By default Neo1973 has usb0 interface working due to Ethernet gadget (g_ether) compiled into kernel.
Modprobe usbnet module and configure usb0 interface (as root):
ifconfig usb0 192.168.0.200 netmask 255.255.255.0
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:
1. ping the Neo with
# ping -I usb0 192.168.0.202
2. add a route to your Neo:
# /sbin/route add -host 192.168.0.202/32 dev usb0
3 log in to the Neo
# ssh root@192.168.0.202
Took from Hotplugging usbnet post by Marcin 'Hrw' Juszkiewicz.
For Debian or similar distros: Edit /etc/network/interfaces file ():
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
For Red Hat or similar distros
Edit /etc/sysconfig/network-scripts/net.hotplug:
After this statement:
case $INTERFACE in # interfaces that are registered after being "up" (?)
Add the following:
usb0) ifconfig usb0 192.168.0.200 netmask 255.255.255.0 route add 192.168.0.202 usb0 iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT exit 0 ;;
For Gentoo or similar distros:
# Neo1973 config_usb0=( "192.168.0.200 netmask 255.255.255.0" )
# cd /etc/init.d # ln -s net.lo net.usb0
And now when you connect phone (which has 192.168.0.202 IP) it gets connection to world automatically.
Then ssh root@192.168.0.202 with empty password to get into phone.
If you get fed up with typing root@192.168.0.202, on your PC edit /etc/hosts and add an entry for 'phone'
192.168.0.202 phone
then edit ~/.ssh/config (or create it) and add
host phone user root
then all you need to do is type
# ssh phone
You might want to use keys to bypass the login prompt too.
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |