OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Bridge Usb0 And Wlan0
colin
post May 24 2007, 02:29 PM
Post #1





Group: Members
Posts: 7
Joined: 6-October 04
Member No.: 4,893



Hi,

I am sure the answer is in the forum somewhere, but I can not find it and I am stuck.

I have C1000 and have installed 3.5.4.1. I am trying to connect to the internet via my laptop using a bridge on the laptop between usb0 and wlan0. The wlan0 connects to my ADSL router.

I think I have followed the procedures on the OZ web site and in the pinned connection topic in this forum.

I have got it to the stage where the C1000 talks to the laptop and the laptop will talk to the world, but the bridge does not seem to forward between usb0 and wlan0 (no ping from the C1000 to anything other than the laptop.)

I am now stuck. The laptop is running slackware, and I will try on the slackware forum if that is the right place to ask.

Hope someone can help.

I have appended the output of some commands below.

Cheers,

Colin

So here what is set up laptop
+++++++++++++++++

// PROMISC is set and there is no IP address on wlan0 and usb0. The br0 bridge has an
// address assigned by dhcpcd

root@slain:/home/colin/Desktop/Zaurus# ifconfig
br0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.123.148 Bcast:192.168.123.255 Mask:255.255.255.0
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10477 errors:0 dropped:0 overruns:0 frame:0
TX packets:6261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5101013 (4.8 MiB) TX bytes:707382 (690.8 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:76 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6500 (6.3 KiB) TX bytes:6500 (6.3 KiB)

usb0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:5544 errors:0 dropped:0 overruns:0 frame:0
TX packets:3139 errors:24 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:432766 (422.6 KiB) TX bytes:213405 (208.4 KiB)

wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST NOTRAILERS RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:4945 errors:0 dropped:0 overruns:0 frame:0
TX packets:11351 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4738990 (4.5 MiB) TX bytes:1067462 (1.0 MiB)
Interrupt:20 Memory:c0200000-c0202000

// Laptop routing seems correct

root@slain:/home/colin/Desktop/Zaurus# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.123.0 * 255.255.255.0 U 0 0 0 br0
loopback * 255.0.0.0 U 0 0 0 lo
default router 0.0.0.0 UG 0 0 0 br0

// bridge claims to be forwarding in dmesg output
br0: port 2(usb0) entering learning state
br0: port 1(wlan0) entering learning state
br0: no IPv6 routers present
br0: topology change detected, propagating
br0: port 2(usb0) entering forwarding state
br0: topology change detected, propagating
br0: port 1(wlan0) entering forwarding state

// no net filtering in for the bridge
root@slain:/home/colin/Desktop/Zaurus# cat /proc/sys/net/bridge/*
0
0
0
0


on the C1000, 192.168.123.55, I have
+++++++++++++++++++++++


// It knows the route to the gateway, the router at IP address 192.168.123.254.
root@slain:/home/colin/Desktop/Zaurus# ssh 192.168.123.55
root@192.168.123.55's password:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.123.0 * 255.255.255.0 U 0 0 0 usb0
default 192.168.123.254 0.0.0.0 UG 0 0 0 usb0
#

irda0 Link encap:UNSPEC HWaddr xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx
NOARP MTU:2048 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:8
RX bytes:0 (0.0 cool.gif TX bytes:0 (0.0 cool.gif

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5999 errors:0 dropped:0 overruns:0 frame:0
TX packets:5999 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:664986 (649.4 KiB) TX bytes:664986 (649.4 KiB)

sit0 Link encap:UNSPEC HWaddr xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 cool.gif TX bytes:0 (0.0 cool.gif

usb0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.123.55 Bcast:192.168.123.255 Mask:255.255.255.0
inet6 xxxx: xxxx::xxxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3759 errors:0 dropped:0 overruns:0 frame:0
TX packets:6580 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:198769 (194.1 KiB) TX bytes:597037 (583.0 KiB)

//192.168.123.254 is the router and 192.168.123.148 is the latop
//traceroute shows the router is unreachable,

# traceroute 192.168.123.254
traceroute to 192.168.123.254 (192.168.123.254), 30 hops max, 40 byte packets
1 192.168.123.55 (192.168.123.55) 3026.23 ms !H 3031.38 ms !H 3039.61 ms !H
# traceroute 192.168.123.148
traceroute to 192.168.123.148 (192.168.123.148), 30 hops max, 40 byte packets
1 192.168.123.148 (192.168.123.148) 2.819 ms 4.624 ms 2.816 ms
#
Go to the top of the page
 
+Quote Post
samac
post May 26 2007, 12:46 AM
Post #2





Group: Members
Posts: 124
Joined: 5-December 04
Member No.: 5,774



Hi

My setup SL5500 connected via usb to a Slackware 11.0 box.

Cable internet via eth0.

eth0 dhcp
usb0 192.168.0.4
zaurus 192.168.0.5

When I plug in my zaurus I run a small script

CODE
#!/bin/bash
ifconfig usb0 192.168.0.4 netmask255.255.255.0 up
route add -host 192.168.0.5 usb0


This works for me.

Samac
Go to the top of the page
 
+Quote Post
speculatrix
post May 26 2007, 01:06 AM
Post #3





Group: Admin
Posts: 3,281
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149



can you not use masquerading/natting?

--- edit, here's how to do it - assuming that eth0 is the outbound interface on your PC

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Go to the top of the page
 
+Quote Post
colin
post May 26 2007, 02:16 PM
Post #4





Group: Members
Posts: 7
Joined: 6-October 04
Member No.: 4,893



Hi,

Thanks for your help guys.

Samac, this is the way I did it in the past. Only, I forgot how to put the gateway on the zaurus. I had put the router address in and I should have put the PC address. This is why I started looking around and saw the bridging solution that seemed simple. Now I have the gateway entry correct in the Zaurus, I can ping router to Zaurus and Zaurus to router. The problem is I can not ping past the router or get web access to the router maintinace page. This, I think, is a router issue.

speculatrix, I have tried the masquerading/natting, but I am missing something from my PC kernal as iptables is complaining that somethng is missing. I started to try to use natting when I read that wlan hardware could not spoof and so bridging would not work.

Anyway you have both helped move me on a bit so thanks. I wil try not using the masquerading for the moment. Masquerading will be my next step if I get stuck. At least I have managed to find why the iptables was hidden when I was configuring the kernal. I needed the x_tables first.

Cheers,

Colin
Go to the top of the page
 
+Quote Post
Da_Blitz
post Jun 5 2007, 02:28 AM
Post #5





Group: Members
Posts: 1,565
Joined: 7-April 05
From: Sydney, Australia
Member No.: 6,806



actually from what i can see there, its a combo of NAT'ing and bridging and its all mixed up

on your laptop i would start from scratch, i bet the problem is there as on the Zaurus you should only have to run "dhclient usb0", "pump usb0" or "udhcp -iusb0" (note no space) and the Z should pick up all the required settings from the router

the Z's route table should have the default entry pointing at the router, as well as the nameserver entry in /etc/resolv.conf, i find that last one gets me when i try and ping yahoo.com instead of an ip

in this case on the laptop i would first bridge the connections (usb0 and wifi0), then run dtclient on br0, make sure that neither wlan0 or usb0 has an IP address and if you can (not required) try to make sure the link in in the "down" state

after reading through it i would bet on the default route is stuffed up on the Z, if you have the gateway for the default path set to the laptop then you will need to set up NAT. try setting the default path to the router instead with

CODE
route del default
route add default gw <router IP>


otherwise test what connectivity you have, ie ping teh laptop, then the router then yahoo and post back what works
Go to the top of the page
 
+Quote Post
colin
post Jul 11 2007, 01:22 PM
Post #6





Group: Members
Posts: 7
Joined: 6-October 04
Member No.: 4,893



Thanks for the help guys.

I hunted around a bit more. It turns out that ndiswrapper does not support PROMISC, which is required for bridging. I have to use ndiswrapper, as the broadcom support is not quite there yet for bcm43xx.

I will use masquerading for now until the bcm43xx has better support for poor signal strength.

Cheers,

Colin
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th July 2014 - 11:16 AM