OpenWrt Forum Archive

Topic: openwrt as client and as AP.

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

Hello,

Here is the scenario i am trying to achieve.

Internet----WR1---------WR2-------client

WR1 is the wireless router which is connected to internet. This is not running openwrt. (It's IP is say 192.168.1.1)
WR2 is running openwrt and should be connected to WR2 (wireless). It should get DHCP IP from WR1. (this is like client to WR1)
Client should connect to WR2 but should get DHCP IP from WR1. (it should act as a dumb AP).

I have the below config. I was able to get WR2 get IP from WR1 and is able to connect to internet but could not get client get IP.
I am running on Atheros based chipset.

/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 'switch_vlan'
      option 'vlan'       '1'
      option 'device'     'eth0'

config interface lan
        option ifname   'eth0.1 eth0.2'
        option type     bridge
        option proto    dhcp
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
        option defaultroute 1

config interface 'wan'
        option proto 'dhcp'

/etc/config/wireless

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option macaddr  <some mac address>
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     openwrt
        option encryption 'psk2'
        option key 'password'

config wifi-iface 'wan'
        option device 'radio0'
        option network 'wan'
        option mode 'sta'
        option encryption 'psk2'
        option ssid     mynewssid
        option key 'mynewpasswd'


Not sure if i am missing any config or something i am doing wrong. Any help or pointers is appreciated. I have tried disabling firewall.

Thanks

Thanks. I looked at that link before and tried those steps as well. It did not work for me. The only difference is that.

"First connect the router to internet, by connecting an ethernet cable between the openwrt's router WAN port and the main router."

i did not do the above step because I want my openwrt to connect to main router wireless, not with an ethernet cable.

abc_bbc_in wrote:

i did not do the above step because I want my openwrt to connect to main router wireless, not with an ethernet cable.

That could be the reason you have issues, nothing in that link is wired, all is about wireless
And if you don't install Relayd package Client has to be in a dif. subnet from main router

The discussion might have continued from here.