OpenWrt Forum Archive

Topic: WR703N as bridge and simple server

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

Hello all! :-)

Ok, first of all here is what I'm using. The device in question is a TPLINK (1.6) TL-WR703N device. I've successfully flashed it with the latest recommended OpenWRT image for this device ("barrier breaker, 14.07"). No problem there -- the device works, I can get into luci and set options.

Though what I'm trying to do with this router I guess is slightly odd as I'm trying to do these two things at exactly the same time (not sure if it is possible). The first is to act as some sort of wifi to wired bridge (for computers that have no built-in wifi); the second, to be able to access (with, for example a USB memory stick connected to the WR703N) files from a usb memory stick from the wifi on the WR703N itself on another machine.

The first bit - acting aas a bridge - seemed to be pretty easy as by and large I've found openwrt just already seems to do this. In fact I'm sitting here right now looking at the older laptop with the WR703N plugged in running openwrt and I can use the 'net and access the luci interface as well.

The problem is the next bit -- getting the contents of a usb memory stick seen and exposed to another machine via either ftp or some sort of simple webserver.

I'm connecting to the internet btw via another router; that router itself is the "main" router through which all my machines connect to the internet through. I use static IP addresses as well (no DHCP). The "main" router's IP address btw is set to 192.168.0.1 . Here's what I have set on the WR703N btw;

LAN-
Address=192.168.0.24
Netmask=255.255.255.0

WIFI-
address=192.168.0.25
Netmask=255.255.255.0
Gateway=192.168.0.1

The strange thing is that I can use the WR703N right now just fine as a bridge -- I can connect to the 'net and ping websites with no problem. On the machine which the WR703N is connected to (via an ethernet cable; the machine has no wifi itself) I can ping IP address 192.168.0.24, but not 192.168.0.25 .  Also 192.168.0.1 fails to ping as well (which is weird, as I'd have thought if that IP address can't be seen the internet wouldn't work at all. There is no sign of 192.168.0.25 at all on any other machine.

Can anyone think if I've missed something at all?

thanks

ljones

(Last edited by ljones on 29 Jun 2015, 21:23)

Hey there.

Did you really *bridge*? Then you shouldn't have a LAN and a wifi interface up.

When having both, the wifi and the LAN interface inside of 192.168.0.0/24, then you're telling your device: The network 192.168.0.0/24 is on both lanes, so pick any lane, both are equal. That's certainly not true.

Could you please give us the content of your /etc/config/network in detail? I guess your eth0 interface is part of both, a bridge interface (in conjunction with wifi) on one hand and a single non-bridged interface on the other hand.

What about the 192.168.0.24 address? Can you reach it from one of your computers not being wired to the LAN port of your WR703N? If that's the case then simply your 192.168.0.25 interface is superfluous smile.

Regards,
Stephan.

You need to use 'relayd' to make a full bridge where everything on both sides of the wifi AP-client link appears to be in the same LAN.

Right now you probably have the wifi client in the WAN so the 703 is routing twice, making it impossible to reach back to users connected to the main router.

Ok, I managed to successfully install relayd and its assoicated luci part. Though I still haven't really got any further sad

Here's my /etc/config/network;

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fde3:7b72:e0e0::/48'

config interface 'lan'
    option ifname 'eth0'
    option force_link '1'
    option proto 'static'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ipaddr '192.168.0.25'

config interface 'wwan'
    option proto 'dhcp'
    option _orig_ifname 'wlan0'
    option _orig_bridge 'false'
    option ifname 'eth0'

config interface 'relay'
    option proto 'relay'
    list network 'lan'
    list network 'wwan'

and /etc/config/wireless;

config wifi-device 'radio0'
    option type 'mac80211'
    option hwmode '11g'
    option path 'platform/ar933x_wmac'
    option htmode 'HT20'
    option disabled '0'
    option channel '6'
    option txpower '30'
    option country 'GB'

config wifi-iface
    option ssid 'TP-LINK_2.4GHz_6D3C2C'
    option encryption 'psk2'
    option device 'radio0'
    option mode 'sta'
    option bssid 'XX:XX:XX:XX:XX:XX'
    option key '<my key>'

When having both, the wifi and the LAN interface inside of 192.168.0.0/24, then you're telling your device: The network 192.168.0.0/24 is on both lanes, so pick any lane, both are equal. That's certainly not true.

Not sure I really understand -- is 192.168.0.0 an IP address? Not ever seen that used -- or can the 0.0 be any numbers?

Also does realyd create a bridge as well, or do I need a bridge and relayd both?

If it helps, here's a picture of luci and the interfaces screen.

ljones

(Last edited by ljones on 2 Jul 2015, 16:22)

Had another go at all of this experimenting just a little :-) . Got just a little way further. BTW you can once again see the interfaces screen here.

What works?
-  I can see the internet from the WR703N no problem
- I'm using two IP addresses, 192.168.0.24 for the lan;  192.168.0.25 for the wifi
- The lan is actually using "br-lan" which I am guessing is the bridge between the two (I note the icon shows this too on the interfaces page)

What doesen't?
- Can't see 192.168.0.24 outside of the WR703N.

Here's a thought. Guessing slightly here and although I do have one (though it isn't working anymore) you can buy wireless to wifi bridges (eg vonets) online, for example off ebay (though they don't really have any other function beyond this). Thinking here that when you go to set them up the actual (vonets) bridge never really has an IP address per se. So should I be replicating something like this with openwrt; should I put everything on the WWAN side and the LAN dosen't "have" an IP address if you an see what I mean?

Anyways in the meantime again here's my config files;

/etc/config/network;

 
config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fdf3:b380:dddb::/48'

config interface 'lan'
    option ifname 'eth0'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ipaddr '192.168.0.24'

config interface 'wwan'
    option _orig_ifname 'wlan0'
    option _orig_bridge 'false'
    option proto 'static'
    option ipaddr '192.168.0.25'
    option netmask '255.255.255.0'
    option gateway '192.168.0.1'
    option dns '208.67.222.222 208.67.220.220'

/etc/config/wireless;

config wifi-device 'radio0'
    option type 'mac80211'
    option hwmode '11g'
    option path 'platform/ar933x_wmac'
    option htmode 'HT20'
    option disabled '0'
    option channel '6'
    option txpower '30'
    option country 'GB'

config wifi-iface
    option network 'wwan'
    option ssid 'TP-LINK_2.4GHz_6D3C2C'
    option encryption 'psk2'
    option device 'radio0'
    option mode 'sta'
    option bssid 'XX:XX:XX:XX:XX:XX'
    option key '<my key>'

ljones

Have now hopefully gotten some way further!

What works;
- Can connect to the internet via the wr703n ok
- Can see the wr703n externally (on another PC), .e.g ping 192.168.0.31
- Logging in via ssh on the computer directly connected to the wr703n (via an ethernet cable) works.

What dosen't work;
- Can't quite login via ssh externally on another PC. It will not accept my password :-( even though I know I have typed it correctly. I get prompts up for the password (i.e. password: ) but it is always refused. Dropbear is set to allow ssh password authentication, root user login and ssh forwarded ports.

ljones

Update: might have been a problem with port forwarding (wrong IP address -- 192.168.1.1, not 192.168.0.1!). Also zones wasn't right -- wan: wwan was set to reject,reject,reject should have been accept,accept,accept

ljones

The discussion might have continued from here.