Debian (USB w/ DHCP and Bridging)

From OESF

(Difference between revisions)
Jump to: navigation, search

Line 7:

Line 7:

(fourthly, if your running some wacky old kernel and your z doesnt show up in usbview or in the system messages display when you plug it in, then youll need to look into building/installing some modules mentioned in [[Generic (USB)]] another paper as its not covered in this one...)
(fourthly, if your running some wacky old kernel and your z doesnt show up in usbview or in the system messages display when you plug it in, then youll need to look into building/installing some modules mentioned in [[Generic (USB)]] another paper as its not covered in this one...)
 +
For those interested in a guide on this topic focusing on Gentoo Linux, please see the following paper:
 +
[http://openzaurus.berlios.de/HowTos/Bridging_with_Gentoo HowTos/Bridging with Gentoo]
----
----

Revision as of 23:16, 4 May 2006

(firstly, DHCP server/client is nice and easiest but not necessary)

(secondly, in all examples replace X 's with you choice of suitable/relevant IP's)

(thirdly, if your running pdaxrom, youll most likely have to transfer all config file to you pc for editing via which ever means possible, as i couldnt get "vi" to work properly...)

(fourthly, if your running some wacky old kernel and your z doesnt show up in usbview or in the system messages display when you plug it in, then youll need to look into building/installing some modules mentioned in Generic (USB) another paper as its not covered in this one...)

For those interested in a guide on this topic focusing on Gentoo Linux, please see the following paper:

HowTos/Bridging with Gentoo


Taken from a post i made in the following thread, inspired by an earlier post in the same thread by NickNak introducing me to this method, but whose guide didnt work for me (telemetric_au).


The setup i got it working under is fairly common, but im confident it would also work with many others...

  • an ADSL Router/Hub/DHCP server connected to
    • a PPC Debian etch box via USB
    • and i386 Debian etch box via ethernet (also worked under sid)
      • which is in turn connected to my 5500's USB cradle


Contents

Step #1 - Install "bridge-utils" package

  • On your Z's "Host Box" run from a command prompt:

note: (ctrl+alt+F1) switch's to shell; ctrl+alt+F7 switch's to X, and ctrl+alt+F10 switch's to System Messages (handy for checking your z is recognized apon plugging in) ;)

apt-get install bridge-utils

(this gives you the "brctl" command used bellow)


Step #2 - Edit /etc/network/interfaces

  • Edit the file /etc/network/interfaces using a text editor running with root (su) access as displayed below, without changing anything else (i.e. other interfaces) which may allready be there but are not mentioned or adjusted in the following box of code.
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network/internet interface
auto eth0
iface eth0 inet static
address 0.0.0.0
netmask 0.0.0.0

# The Virtual Bridging Interface linking usb0 to eth0
auto br0
iface br0 inet dhcp
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
post-down brctl delbr br0

# The Zaurus's Connnection
allow-hotplug usb0
mapping hotplug
script grep
map usb0
iface usb0 inet static

# The following is a dummy address/netmask,
# and is only used initially to create the usb0 interface,
# so it can then be set to 0.0.0.0 just like eth0 :)

address 192.168.X.X
netmask 255.255.255.X
post-up ifconfig usb0 0.0.0.0 up
post-up brctl addif br0 usb0
post-down brctl delif br0 usb0


  • Optionally if you didn't want to use DHCP or dont have it running switch the setup code for br0 from above with the following.


# The Virtual Bridging Interface linking usb0 to eth0
auto br0
iface br0 inet static
address 192.168.X.X
netmask 255.255.255.X 
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
post-down brctl delbr br0

Step #3 - Restart your networking system

  • (without rebooting, by executing the following command line.)
/etc/init.d/networking restart


Step #4 - Configure your Zaurus

  • now depending on which ROM your running, the changes you may need to make may be different...
    • if you have GUI network setup interface use that:

check the automatically bring-up option if present set ip address, subnet, gateway, dns's as needed (with gateway being your pc's br0 IP (or usb0 or possibly even the eth0) IP *(not the router's) its a bit hard for me to be sure on the topic of static IP's as i only used it initially very shortly in OPIE...

    • if you dont have a GUI or prefer not to use one and have an /etc/network/interfaces file, edit it as follows:

For auto dhcp assigned address add/edit:

iface usb0 inet dhcp

For a static IP address add/edit:

iface usb0 inet static
#your z's address
address 192.168.X.X
#your computer's address (this will most likely be the address for br0,
#but may instead be usb0 if you needed to make usb0 static for some reason...) 
pointopoint 192.168.X.X
netmask 255.255.255.X
    • if you dont have an /etc/network/interfaces file but have an /etc/hotplug/usbdnet.conf file such as in pdaxrom edit it (either on your pc or via "vi" from the base root prompt (before pdaxrom) )

DHCP:

#IP=192.168.X.X
#NETMASK=255.255.255.X
DHCPS=no I
DHCPC=yes

Static:

#IP=192.168.X.X
#NETMASK=255.255.255.X
DHCPS=no
DHCPC=no


  • Specify the Zaurus's DNS if not allready specified with for example a GUI

edit /etc/resolv.conf to add the IP of your DNS server as found in your PC's /etc/resolv.conf which in my case was the router's address

nameserver X.X.X.X


Step #5 - Take a break

it hopefully should be all working sweet now internet included, so go lie down and get to sleep early for a change ;)

if not try contacting me via the oesf forums for some assistance if i can be of any...

here is a copy of my system messages from insertation through to IP assignment:

Apr 29 09:14:05 debian kernel: usb 2-1.3: new full speed USB device using uhci_hcd and address 5
Apr 29 09:14:06 debian kernel: usbcore: registered new driver cdc_ether
Apr 29 09:14:06 debian kernel: usb0: register 'zaurus' at usb-0000:00:1d.1-1.3, Sharp Zaurus SL-5x00, b6:70:52:a9:19:95
Apr 29 09:14:06 debian kernel: usbcore: registered new driver zaurus
Apr 29 09:14:06 debian kernel: device usb0 entered promiscuous mode
Apr 29 09:14:06 debian kernel: br0: port 2(usb0) entering learning state
Apr 29 09:14:21 debian kernel: br0: topology change detected, propagating
Apr 29 09:14:21 debian kernel: br0: port 2(usb0) entering forwarding state


for those interested im currently running kernel v. 2.6.15-1-686 with udev v. 0.089-1


Some References

http://www.gumstix.org/tikiwiki/tiki-index.php?page=Networking

http://www.stolk.org/debian/bluetooth.html

Personal tools