0

I'm not sure if I phrased the question correctly, so sorry for any confusion there.

I have two routers. Routers are too far apart to connect them to each other using a cable.

First is connected to Interent and has a single wlan interface. All devices on the LAN connect to it via WiFi.

Second one has two wlan interfaces and no Internet connection.

Here is a diagram made by Cont7e that describes what I want to achieve (thanks!):

enter image description here

Windows 7 PC connects to the first one via WiFi, and to the second via Ethernet port. Another device connects to second router using Ethernet for now because I cannot get its WiFi working.

I want to connect the second device to Internet somehow.

I have installed a minimal OpenWRT install on the second router (not that I have any experience using it), and tried configuring the router to put one of the wlan interfaces into managed mode by editing its wireless configuration like so:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/ar934x_wmac'
        option htmode 'HT20'
        option disabled '0'

config wifi-iface
        option device 'radio0'
        option network 'wan'     <--- tried both 'wan' and 'lan'
        option mode 'sta'        <--- changed to 'sta'
        option encryption 'psk2' <--- encryption mode on other router
        option ssid 'SSID'       <--- other router's SSID
        option key 'KEY'         <--- other router's key

This did not produce the result I expected.

Is what I'm trying generally a good approach? How do I make this work?

EDIT: Added diagram kindly provided by Cont7e

2
  • Hi bvukelic. I did a simple design that you could include in your question for people to be clearer: i.imgur.com/h8d0nDG.png . For your problem, have you already searched the internet? There are ways to have a wireless "bridge" between 2 routers. See here if it might help: cyberciti.biz/networking/…
    – Con7e
    Jul 15, 2014 at 12:44
  • @Con7e Thanks for the diagram! Yeah, I've looked at various articles, but I'm generally a noob when it comes to networking. And thanks for the link. I'll take a look.
    – user128580
    Jul 15, 2014 at 13:43

1 Answer 1

0

I finally got around to solving this. I used a configuration called Masquerading in OpenWRT wiki.

The two routers are put on different subnets. Router with Internet is on 192.168.1.1/24. The second router is on 192.168.10.1/24.

The router without Internet is configured using OpenWRT. The 'lan' entry in /etc/config/network looks like this:

config interface 'lan'
        option ifname 'eth0.1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.10.1'    <-- make sure it's on different subnet
        option netmask '255.255.255.0'
        option ip6assign '60'

In the same file (/etc/config/network), the 'wan' entry must not contain ifname entry:

config interface 'wan'
        option proto 'dhcp'

Now we need to configure the Wi-Fi interface to connect to the other network. Edit /etc/config/wireless and modify the wifi-iface entry for the radio you want to use:

config wifi-iface
        option device 'radio0'
        option network 'wan'      <-- 'wan' here
        option mode 'sta'         <-- 'sta' for station mode
        option encryption 'psk2'  <-- whatever encryption is used on other router
        option ssid 'SSID'        <-- SSID of the other router
        option key 'PSK'          <-- password of the other router

After editing both files, run:

# ifup wan
# wifi

Now you should be able to connect to the Internet from any host connected to the router.

You must log in to answer this question.