OpenWrt Forum Archive

Topic: P2P WDS Links

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying to setup P2P WDS links between my various boxes.

This is something that I used to have working in the Sveasoft firmware but they have decided to break in the latest release of the firmware and this is the last straw for me with regards that firmware.

I am running WhiteRussian RC4.

I have seperated the wifi and lan and moved the lan configuration onto br1.

I have disabled all wds encryption and iwconfig says the encryption key is off at both sides.

I have a wds0.49153 interface on both ends.

If I try to set an ip address on the wds0 interface it gets removed almost straight away I am guessing that hotplug is coming round and setting the interface back to 0.0.0.0.

Creating a new bridge BR0 allows the interface to come up and putting an ip address onto br0 allows the address to be pingged from the local host but not from the remote host.

I have removed the S45firewall script to make sure there is no firewall running that might be causing problems.

The route for the subnet that I am using is pointing to br0. br0 is showing as having the WDS interface in it. If I try and ping the other host then the counters on br0 increase but I dont see any packet counters increasing for traffic going down the wds0.49153 link.

I have set the boardflags to be 0x0118 and 0x0188 rather than the default 0x0318 and 0x0388.

If I do a logread then I see the following:-


Dec  1 04:55:38 (none) kern.info kernel: device wds0.49153 entered promiscuous mode
Dec  1 04:55:38 (none) kern.info kernel: br0: port 1(wds0.49153) entering learning state
Dec  1 04:55:43 (none) kern.info kernel: br0: port 1(wds0.49153) entering disabled state
Dec  1 04:55:43 (none) kern.info kernel: br0: port 1(wds0.49153) entering disabled state
Dec  1 04:55:43 (none) kern.info kernel: device wds0.49153 left promiscuous mode

This repeats every 5 seconds so I am guessing that the WDS link is not coming up properly.


Has anyone got any other suggestions as to where my problem might be or other things that I could try to try and get this to work?

(Last edited by dw_soothill on 1 Dec 2005, 06:15)

It sounds like you've done everything right. The hotplug script automatically adds the WDS links to br0; removing the firewall isn't necessary.

It may be the wireless link dropping, I'd suggest trying it with both APs in the same room just to verify the setup. If you want to disable hotplug and manually setup the link, "echo xxx > /proc/sys/hotplug" should be pretty effective.

The two AP's are actually sat next to each other under my desk.

If I run Kismet on either AP it sees the other one fine and they are broadcasting out on the same SSID as well.

I will have a go with the hotplug disabled later today.

I presume you meant "echo xxx > /proc/sys/kernel/hotplug"

(Last edited by dw_soothill on 1 Dec 2005, 07:39)

With hotplug disabled I have some interesting effects with the wds interface.

If I do an ifconfig it doesnt list the interface.

If I do "ifconfig wds0.49153 up" then the interface comes up for a few seconds and then disappears.

Doing a more on /proc/sys/kernel/hotplug it has xxx in it. I have tried removing the 01-wds from the hotplug.d directory before and saw exactly the same sort of problems where I couldnt get the interface to stay up.

(Last edited by dw_soothill on 1 Dec 2005, 07:51)

"ifconfig -a" shows all interfaces; otherwise it only shows the interfaces that are up.

/proc/sys/kernel/hotplug is the name of the script to run for hotplug events, normally /sbin/hotplug. Giving it a fake name will prevent it from running anything.

Hi, i'm also moving from alchemy to openwrt (v4 gs problem....) and i've almost done all i need.
I only stil have problems with wds in p2p mode.. i can connect  through wds in lan mode, but not p2p... i've read the faq, i understand i have some way to break the br0 common setup and split the wireless part from the lan part, but it seems i can't do it following the FAQ..
It gives me no particular error, but no ip is assigned to the wds0.etc interface.
Iget an error in the last command only..
i follow this example setup:

lan_ifname=vlan0
lan_proto=static
lan_ipaddr=192.168.1.25
lan_netmask=255.255.255.0

wifi_ifname=eth1
wifi_proto=static
wifi_ipaddr=192.168.2.25
wifi_netmask=255.255.255.0

wan_ifname=vlan1
wan_proto=dhcp

lan_ifnames=vlan0 eth2 eth3

Wan is not used, when i send the lan_ifnames command it reports that eth2 and eth3 devices do not exits (which seems reasonable).
I tried googling for more info but no luck...
Any idea?
Thanks,
Ricky

(Last edited by karyal on 3 Dec 2005, 17:27)

I have moved on quite alot since this original post.

I have modified /etc/hotplug.d/net/01-wds as follows:-

[ "${INTERFACE%%[0-9]*}" = "wds" ] && {
        if [ -n $(nvram get ${INTERFACE}_ipaddr) ]
        then
                ifconfig $INTERFACE $(/usr/sbin/nvram get ${INTERFACE}_ipaddr) up \
                netmask $(/usr/sbin/nvram get ${INTERFACE}_netmask)  \
                broadcast $(/usr/sbin/nvram get ${INTERFACE}_broadcast)
        else
                ifconfig $INTERFACE 0.0.0.0
                /usr/sbin/brctl addif br0 $INTERFACE
        fi
}

I then set the following nvram variables:-

wds0.xxxx_ipaddr=aa.bb.cc.dd
wds0.xxxx_broadcast=aa.bb.cc.dd
wds0.xxxx_netmask=aa.bb.cc.dd

This then brings up the interface with the correct ip address and netmask you just need to change xxxx to be your wds number the first one is 49153 and then they start incrementing.

Using this and ospf I now have a routed wireless backbone around the house with seperate subnets for each room and direct p2p links for the different rooms.

I havent at this point setup up any encryption on the links that will come next.

Interestingly my eth1 interfaces are showing as down on my routers as I have not needed to configure them.

I have just retrieved my last sveasoft firmware router and am abouts to reflash that to openwrt.

(Last edited by dw_soothill on 3 Dec 2005, 17:51)

dw_soothill wrote:

I have just retrieved my last sveasoft firmware router and am abouts to reflash that to openwrt.

Ok.. i did it, even if in a sligtly different way... i removed the wds from the bridge ('ive found it didn't work before because the interface is quite long and gets truncated in the ifconfig output), then i manually assigned an ip to the wds interface, and set up the routing daemon config file..
Now, i don't get how i can save this setup.. i know how to handle it under linux, but i'm a little confused by what is writable and what's read only on the box..
seems that part of /etc is writable, and part not, and i understood that the "good" way is not editing the config files in /etc, but setting things in nvram and then committing the modification.. but i need some practice on that....
Bye, Ricky

For those migrating from sveasoft, you may be interested in this modifed hotplug script (building on the work of dw_soothill)

It uses the existing sveasoft nvram variables to bring up the p2p links rather than creating a new set based on the wds0.xxxx if name.  It also calculates the broadcast address properly rather than having to store in nvram.

[ "${INTERFACE%%[0-9]*}" = "wds" ] && {

    WDSN=`echo $INTERFACE | sed 's/.*\.//'`
    WDSI=wl_wds$(($WDSN-49153+1))

        if [ -n $(/usr/sbin/nvram get ${WDSI}_ipaddr) ]
        then

                if_ip=$(/usr/sbin/nvram get ${WDSI}_ipaddr)
                if_netmask=$(/usr/sbin/nvram get ${WDSI}_netmask)
                if_broadcast=$(eval `ipcalc -b $if_ip $if_netmask`; echo $BROADCAST)
    
                ifconfig $INTERFACE $if_ip up \
                netmask $if_netmask  \
                broadcast $if_broadcast

        else
                ifconfig $INTERFACE 0.0.0.0
                /usr/sbin/brctl addif br0 $INTERFACE
        fi
}

KR's

Mark

(Last edited by maegibbons on 18 Dec 2005, 18:06)

maegibbons wrote:
[ "${INTERFACE%%[0-9]*}" = "wds" ] && {

    WDSN=`echo $INTERFACE | sed 's/.*\.//'`
    WDSI=wl_wds$(($WDSN-49153+1))

        if [ -n $(/usr/sbin/nvram get ${WDSI}_ipaddr) ]
        then

                if_ip=$(/usr/sbin/nvram get ${WDSI}_ipaddr)
                if_netmask=$(/usr/sbin/nvram get ${WDSI}_netmask)
                if_broadcast=$(eval `ipcalc -b $if_ip $if_netmask`; echo $BROADCAST)
    
                ifconfig $INTERFACE $if_ip up \
                netmask $if_netmask  \
                broadcast $if_broadcast

        else
                ifconfig $INTERFACE 0.0.0.0
                /usr/sbin/brctl addif br0 $INTERFACE
        fi
}

hello,

I am interested by this script but apparement it does not function.  I added the variables wl_wds1_ipaddr well and netmask but that does not function.

If somebody has the solution?

Thank you

florida wrote:

I am interested by this script but apparement it does not function.  I added the variables wl_wds1_ipaddr well and netmask but that does not function.

If somebody has the solution?

The script has 2 errors(tested on whiterussian rc5):
1. It seens 'ipcalc' doesn't use '-b' option, at least not in his last implementation, so remove it.
2. The author forget to add 'up' in the line 'ifconfig $INTERFACE 0.0.0.0'.

/etc/hotplug.d/net/01-wds now should look like this:

[ "${INTERFACE%%[0-9]*}" = "wds" ] && {

    WDSN=`echo $INTERFACE | sed 's/.*\.//'`
    WDSI=wl_wds$(($WDSN-49153+1))

        if [ -n $(/usr/sbin/nvram get ${WDSI}_ipaddr) ]
        then

                if_ip=$(/usr/sbin/nvram get ${WDSI}_ipaddr)
                if_netmask=$(/usr/sbin/nvram get ${WDSI}_netmask)
                if_broadcast=$(eval `ipcalc $if_ip $if_netmask`; echo $BROADCAST)
    
                ifconfig $INTERFACE $if_ip up \
                netmask $if_netmask  \
                broadcast $if_broadcast

        else
                ifconfig $INTERFACE 0.0.0.0 up
                /usr/sbin/brctl addif br0 $INTERFACE
        fi
}

Tuxerg

The discussion might have continued from here.