OpenWrt Forum Archive

Topic: Fonera: setting up AP and STD

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

hi all!


i want to set up a wireless access point, with one fonera, and i want to connect to it with some others foneras (setted up in std mode).

it is possible?

i already red this documentation, but i don't understand how to do that i want..


well:


fonera AP:

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface lan                   
        option ifname   eth0           
        option proto    static         
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
                                     
config interface wan                 
        option ifname   ath0           
        option proto    static         
        option ipaddr   10.10.10.1     
        option netmask  255.255.255.0 

config route                         
        option interface lan           
        option target   default       
        option netmask  0.0.0.0       
        option gateway  192.168.1.100

#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wan
        option mode     ap
        option ssid     myssid
        option encryption    none


fonera STD:

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface lan                   
        option ifname   eth0           
        option proto    static         
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
                                             
config interface wan                 
        option ifname   ath0           
        option proto    static         
        option ipaddr   10.10.10.2     
        option netmask  255.255.255.0 

config route                           
        option interface wan           
        option target   default       
        option netmask  0.0.0.0       
        option gateway  10.10.10.1

#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wan
        option mode     std
        option ssid     myssid
        option encryption    none


what is the right configuration of the Fonera.AP and the Fonera.STD for working properly ?

(Last edited by Trew on 1 Dec 2007, 17:16)

it's sta, not std
you only need option network when using a bridge (you also have a configuration specified for the interface already)
you have the same ip address (and range) on two different networks. it could work if your using nat, though.
you can specify a (default) gateway address in the configuration for the interface, like this, but if config route works I don't see a problem with it:
config interface lan
        option type     bridge
        option ifname   "eth0.1"
        option proto    static
        option ipaddr   192.168.182.10
        option netmask  255.255.255.0
        option gateway  192.168.182.3

to be clear, there's no technical reason why you couldn't make this all the same network and bridge it, but I don't know anything about your setup or reasons, and there's good reasons for splitting things up.

i wanna do smething like this: http://img213.imageshack.us/img213/8692/apstaln6.jpg

but i don't understand which are the correctly configuration of each foneras (wireless and network files): can you show me how configure its?

(Last edited by Trew on 15 Dec 2007, 09:15)

(i've a set of 5 static IP (77.113.158.153/29), give me by my provider)


so, i understand that, the AP, want to be set with these parameters:
(with this AP configuration, i can connect to it with my portable pc, so, i think it's functionally)

fonera AP:

#vi /etc/confic/network
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   77.113.158.154
        option netmask  255.255.255.248
        option gateway  77.113.158.153
        option dns      208.67.222.222 208.67.220.220


#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     myssid
        option encryption none


but i don't understand which is the correctly configuration of the STA:

fonera STA:

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface lan                   
        option ifname   eth0     
        option type     bridge         
        option proto    static         
        option ipaddr   77.113.158.155
        option netmask  255.255.255.248
        option gateway  77.113.158.154
        option dns      208.67.222.222 208.67.220.220
                                             
#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  lan     
        option mode     sta
        option ssid     myssid
        option encryption    none



anyone can help me please?

(Last edited by Trew on 4 Dec 2007, 12:18)

i try to connect to the Fonera AP, using a pc, with a wireless card, and it's connect immediately..!

but, if i want to connect with the Fonera STA, how do i do?

is there anything to setup?

Hi,

I used a fonera in station-mode a few months ago, and a bridge between the wifi- and ethernet-interface never worked for me in stationmode, but I had a working configuration with routing between them.

and even if you get a bridged setup working, I guess you will run out of ip-addresses. so all your foneras will have an address but there will be no addresses left for clients which connects to them.
and your routing is also kind of messed up. if everything is bridged, the standardgateway of the foneras in stationmode should be 77.113.158.153 (if this is your real gateway) too, and not the ip of the AP.

Your AP configuration seems fine, but for the station-mode you should configure routing not bridging. try an configuration like that:

fonera STA:

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface wan                   
        option ifname   ath0     
        option proto    static         
        option ipaddr   77.113.158.155
        option netmask  255.255.255.248
        option gateway  77.113.158.153
        option dns      208.67.222.222 208.67.220.220

config interface lan                   
        option ifname   eth0               
        option proto    static         
        option ipaddr   192.168.10.1 # or some other private ip-subnet
        option netmask  255.255.255.0


                                             
#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wan     
        option mode     sta
        option ssid     myssid
        option encryption    none

so your wifi-device is the wan-interface, the ethernet port is the lan interface and dhcp, masquarading and dns-forwarding will work for the clients connected to the foneras in station modes out of the box.

yes, ok, but in STA Fonera, i'm less of the route that send to client (eth0) the packages received (ath0) from the AP Fonera.. is it correct?

(Last edited by Trew on 6 Dec 2007, 09:43)

Trew wrote:

yes, ok, but in STA Fonera, i'm less of the route that send to client (eth0) the packages received (ath0) from the AP Fonera.. is it correct?

sorry, maybe I can help, but I really have no idea what you are asking

eleon216 wrote:

sorry, maybe I can help, but I really have no idea what you are asking

sorry for my worst topic..

i wanna do smething like this: http://img213.imageshack.us/img213/8692/apstaln6.jpg

can you give me the correct configuration files (dhcp, network, wireless) of each Foneras ?

Fonera AP:
wireless: ?
network: ?
dhcp: ?
ruote: ?

Fonera STA:
wireless: ?
network: ?
dhcp: ?
route: ?


thanks so much,
Trew

(Last edited by Trew on 15 Dec 2007, 09:15)

Hi,

you wrote that you get 5 public ip-addresses. do you want to to use public-addresses for the foneras of jack and sahra then you need to bridge the wifi and ethernet of the AP, if you want it like in your example then you need configure nat between them. and should shara an jack be able to "talk" to each other? because then you should configure a routed setup without nat on both sta-foneras.

but a working configuration which will be like your diagram could look like this:

AP:

/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 interface wan
        option ifname   eth0
        option proto    static
        option ipaddr   77.113.158.101
        option netmask  255.255.255.0
        option gateway 77.113.158.100

config interface lan
        option ifname   ath0
        option proto    static
        option ipaddr   10.10.10.1
        option netmask  255.255.255.0

/etc/config/wireless:

config wifi-device  wifi0
        option type     atheros
        option channel  11


config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     myssid
        option encryption none

Jacks and Saras fonera STA-mode:

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface wan                   
        option ifname   ath0     
        option proto    static         
        option ipaddr   10.10.10.2 # and for the other sta-fonera 10.10.10.3
        option netmask  255.255.255.0
        option gateway  10.10.10.1

config interface lan                   
        option ifname   eth0               
        option proto    static         
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


                                             
#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wan     
        option mode     sta
        option ssid     myssid
        option encryption    none


this config  worked for me but you can also try to get a wds-connection working. This wasn´t a posibillity for my because I had only limited access to the AP, but you have full access to all devices so maybe you should have a look at http://forum.openwrt.org/viewtopic.php?id=11849 with this setup you can bridge everything together and it should be easy to interconnect between all pcs.

hi eleon!

eleon216 wrote:

do you want to to use public-addresses for the foneras of jack and sahra then you need to bridge the wifi and ethernet of the AP. if you want it like in your example then you need configure nat between them. and should shara an jack be able to "talk" to each other? because then you should configure a routed setup without nat on both sta-foneras.

so and so.. i want only that Sara (fonera STA) and Jack (fonera STA) able to go on internet by passing through Trew (fonera AP).
nothing other.

but a working configuration which will be like your diagram could look like this:

i've setup my Fonera access point, like this (your) configuration:

Fonera AP (Trew):

# vi /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 interface lan
        option ifname   eth0
        option proto    static
        option ipaddr   77.113.158.101      # forced by my isp
        option netmask  255.255.255.248        # forced by my isp
        option gateway  77.113.158.100         # forced by my isp
        option dns      208.67.222.222 208.67.220.220

config interface wlan
        option ifname   ath0
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


# vi /etc/config/wireless

config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wlan
        option mode     ap
        option ssid     myssid
        option encryption none


now, i want to test it, so, i take a PC (with a wireless card) and i connect to Fonera AP, for test it..

so, i've this results:

- form openwrt console, i'm able to ping some host over internet.
- from the PC, i cannot ping internet.
- from the PC i can only ping the Fonera ath0 (192.168.1.1) and the fonera eth0 (77.113.158.101).
- from the PC, if i traceroute the real gateway (77.113.158.100), i have this results:

1  4ms  2ms  3ms  192.168.1.1
2  *  *  *  Richiesta scaduta.

so, i understand that the packages non able to route from 192.168.1.1 to 77.113.158.101, and so to 77.213.158.100.

how can i correct this?


this config  worked for me but you can also try to get a wds-connection working.

ok, after this AP-STA networking, i will test WDS too..!

(Last edited by Trew on 7 Dec 2007, 01:35)

Ok you ISP force the ipaddress and the subnetmask, but I don´t think you are forced to name the interface "lan", or are you? It cannot work if you change the interface names! masquarading (NAT), dns forwarding and so on is working from the lan-interface to the wan-interface, and the firewall settings also works with the wan-interface.
so the ethernet-port (eth0) of the fonera-AP needs to be named "wan"-interface and the wifi needs to be the "lan"-interface. it is not relavant if it is connected to something what you call "lan". so if you use my config (ok, exept the wrong subnetmask and the missing dns-servers) you should be able to access the internet from a client connected to the wifi of your accesspoint.

your config could work too, but then you need to configure the routing and firewall-rules yourself, and I don´t think you want to do this smile


so once again the config for the ap:

# vi /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 interface wan
        option ifname   eth0
        option proto    static
        option ipaddr   77.113.158.101      # forced by my isp
        option netmask  255.255.255.248        # forced by my isp
        option gateway  77.113.158.100         # forced by my isp
        option dns      208.67.222.222 208.67.220.220


config interface lan
        option ifname   ath0
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


# vi /etc/config/wireless

config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     myssid
        option encryption none


and to your config of your wifi-network (lan): keep in mind that the ip-subnet of the wan- and lan- side of the sta-foneras need to be different so don´t use 192.168.1.0/24 for both. or just use the config from my last posting

(Last edited by eleon216 on 7 Dec 2007, 10:10)

eleon216 wrote:

It cannot work if you change the interface names!

sorry..!

your config could work too, but then you need to configure the routing and firewall-rules yourself, and I don´t think you want to do this

exactly smile

so, i config my Fonera AP (Trew), like your configuration:

# vi /etc/config/dhcp
config dhcp
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

config dhcp
        option interface        wan
        option start    100
        option limit    150
        option leasetime        12h

# vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     myssid
        option encryption none

# vi /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 interface wan
        option ifname   eth0
        option proto    static
        option ipaddr   77.113.158.101
        option netmask  255.255.255.248
        option gateway  77.113.158.100
        option dns      208.67.222.222 208.67.220.220

config interface lan
        option ifname   ath0
        option proto    static
        option ipaddr   10.10.10.1
        option netmask  255.255.255.0

and all works perfectly!!
i can connect with my PC (with wireless card), and i'm able to browse internet!!
i can also browse files of all computer connected to the foneraAP!
wow!! thanks very, very, very much!!


and to your config of your wifi-network (lan): keep in mind that the ip-subnet of the wan- and lan- side of the sta-foneras need to be different so don´t use 192.168.1.0/24 for both. or just use the config from my last posting

so, for the configuration of the Foneras STA (Jack and Sara), you say that:

# vi /etc/config/dhcp
config dhcp
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

config dhcp
        option interface        wan
        option start    100
        option limit    150
        option leasetime        12h

#vi /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  11

config wifi-iface
        option device   wifi0
        option network  wan     
        option mode     sta
        option ssid     myssid
        option encryption    none

#vi /etc/confic/network
config interface loopback       
        option ifname   lo           
        option proto    static         
        option ipaddr   127.0.0.1     
        option netmask  255.0.0.0     
                                       
config interface wan                   
        option ifname   ath0     
        option proto    static         
        option ipaddr   10.10.10.2     # and, for the other sta-fonera: 10.10.10.3
        option netmask  255.255.255.0
        option gateway  10.10.10.1

config interface lan                   
        option ifname   eth0               
        option proto    static         
        option ipaddr   192.168.1.1      # and, for the other sta-fonera: 192.168.2.1
        option netmask  255.255.255.0

and all works perfectly!!
using a PC, i can connect with FoneraSTA to FoneraAP, and i'm able to browse internet form PC!!
spectacular!! thanks very much, too!!


thanks thanks thanks ELEON,
Trew

(Last edited by Trew on 9 Dec 2007, 10:58)

now, my configuration, is like this: http://img213.imageshack.us/img213/8692/apstaln6.jpg
and all conputer can browse internet very well!


so, if i want to communicate through them (broswe files) ?
example:

TrewPC----cable----FoneraAP))))wireless((((FoneraSTA----cable----JackPC

simple: i wanna that TrewPC can talk to JackPC, and JackPC can talk to TrewPC


have i to configure any route? which?

is it possible? or i have to setup an adhoc mode?

(Last edited by Trew on 15 Dec 2007, 09:16)

Hi,

I think that isn't really easy to configure a way through all this nat routers (fonera).

I think you should configure it to 1 network with 3 bridges. But this need a NAT Router for your provider that is configured to LAN 192.168.0.1/24 and WAN: 77.113.158.101/255.255.255.248 gw 77.113.158.100 dns <the ips>



/////////////////////// CONFIGURATION /////////////////////////////////////////////////

Trew
PC:
IP: 192.168.0.10/24
GW/DNS: 192.168.0.1

Fonera:
/etc/config/network
## Ethernet
config interface lan
        option ifname   eth0
    option type    bridge
        option proto    static
        option ipaddr   192.168.0.2
        option netmask  255.255.255.0
    ## This option are optional. This options are not really needed by the bridge but for updates and soon
        option gateway  192.168.0.1
        option dns      208.67.222.222 208.67.220.220

/etc/config/wireless
config wifi-device  wifi0
        option type     atheros
    option channel  1
    option mode 11bg
    option diversity 0
    option txantenna 1
    option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     wssid
        option hidden   0
        option bgscan   0
        option encryption none


The other PCs and Foneras configure like this:

PCs:
192.168.0.20/24  # and 30   // or something else
GW/DNS: 192.168.0.1

/etc/config/network
## Ethernet
config interface lan
        option ifname   eth0
    option type    bridge
        option proto    static
        option ipaddr   192.168.0.3  # and 4 for the third fonera
        option netmask  255.255.255.0
    ## This option are optional. This options are not really needed by the bridge but for updates and soon
        option gateway  192.168.0.1
        option dns      208.67.222.222 208.67.220.220

/etc/config/wireless
config wifi-device  wifi0
        option type     atheros
    option channel  1
    option mode 11bg
    option diversity 0
    option txantenna 1
    option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     sta
        option ssid     wssid
        option encryption none



I have never test this configuration before because I don't have a second fonera. The Bridge should running well.

Little Tip (But can't garuanteded that this will work, but it may be.)

If you don't have a NAT Router then you can open your provider network over your bridges. Let the bridges how they are configured and only configure your client to your provider settings.

example PC Trew
ipaddr   77.113.158.101
netmask  255.255.255.248
gateway  77.113.158.100
dns      208.67.222.222 208.67.220.220

and PC Trew get another IP to configure the fonares, too
ipaddr 192.168.0.10/24

and soon for the other PC.


Hope it helps.
regards
j0inty.sL

j0inty wrote:

But this need a NAT Router for your provider
If you don't have a NAT Router then you can open your provider network over your bridges
Hope it helps.
regards
j0inty.sL

yes, but i haven't any router.. and i can't apply your configuration..

i think that an access point may be not properly used for this my configuration request..!

Access Point is only a point of internet access, isn't it?!

(Last edited by Trew on 11 Dec 2007, 00:17)

Trew wrote:

yes, but i haven't any router.. and i can't apply your configuration..

Thats why i give you the tip. For that soluition you don't need a seperate NAT Router.

j0inty wrote:

Little Tip (But can't garuanteded that this will work, but it may be.)

If you don't have a NAT Router then you can open your provider network over your bridges. Let the bridges how they are configured and only configure your clients to your provider settings.

example PC Trew
ipaddr   77.113.158.101
netmask  255.255.255.248
gateway  77.113.158.100
dns      208.67.222.222 208.67.220.220

and PC Trew get another IP to configure the fonares, too
ipaddr 192.168.0.10/24

and soon for the other PC.

Access Point is only a point of internet access, isn't it?!

No an Access Point (at WLAN) is the endpoint for a WLAN Client to the network where the AP is in.

j0inty wrote:

Thats why i give you the tip. For that soluition you don't need a seperate NAT Router

mmmh..
then, i don't understand how i have to configure all pc and fonera..

Hi,

that means that you setup the fonera so I had posted it. But the clients get your provider Config and the FoneraConfigPC get a second ip that is in the same network like the foneras.

Bridges work on Layer2 (MAC-Address) and not Layer3 (IP-Address)...so it ist possible to run more than one network over a bridge.

regards

how can i do it practically?

(Last edited by Trew on 11 Dec 2007, 09:54)

Trew wrote:

how can i do it practically?

Hi,

that was only one way to configure your network. I think this is the easiest and better way for your problem.

Because If you use brigdes you don't need ip/port forwarding rules and soon for the internal communication.

I would configure it how I said above.

Trew Fonera like this:

vi /etc/config/network
## Ethernet
config interface lan
        option ifname   eth0
    option type    bridge
        option proto    static
        option ipaddr   192.168.0.2
        option netmask  255.255.255.0

/etc/config/wireless
config wifi-device  wifi0
        option type     atheros
    option channel  1
    option mode 11bg
    option diversity 0
    option txantenna 1
    option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     wssid
        option hidden   0
        option bgscan   0
        option encryption none

Other both Foneras

/etc/config/network
## Ethernet
config interface lan
        option ifname   eth0
    option type    bridge
        option proto    static
        option ipaddr   192.168.0.3  # and 4 for the third fonera
        option netmask  255.255.255.0

/etc/config/wireless
config wifi-device  wifi0
        option type     atheros
    option channel  1
    option mode 11bg
    option diversity 0
    option txantenna 1
    option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     sta
        option ssid     wssid
        option encryption none

Now you restart all foneras (Trew his fonera at first), then you configure the PCs with static provider IP like this:

Trew PC's
ipaddr   77.113.158.101
netmask  255.255.255.248
gateway  77.113.158.100
dns      208.67.222.222 208.67.220.220

and Trew PC get a second IP to be able to connect to the foneras to configure it.
ipaddr   192.168.0.1
netmask  255.255.255.0

The other PC get an IP like this

Other PC's
ipaddr   77.113.158.102  # and 103 for the third PC
netmask  255.255.255.248
gateway  77.113.158.100
dns      208.67.222.222 208.67.220.220

But becarefull and have always in mind that all tree PC are now connected directly to the Internet so they need a Firewall and Antivirus protection. And you should use a WLAN Encryption like wpa or wpa2. But this needs some configurations settings more. Lets try to get it stable without encryption at first.

Troubleshooting:
1.
It may be that the default iptables rules (firewall in the fonera) can block traffic from the network. Have you straight problems you can connect to the foneras and disable the firewall. !!! BUT THIS ISN'T A GOOD CHOICE !!!

2.
The bridge on Trew Fonera didn't run ??? Check the /etc/hostapd.conf

# In case of madwifi driver, an additional configuration parameter, bridge,
# must be used to notify hostapd if the interface is included in a bridge. This
# parameter is not used with Host AP driver.
bridge=br-lan

# Driver interface type (hostap/wired/madwifi; default: hostap)
driver=madwifi

you say that: "and Trew PC get a second IP to be able to connect to the foneras to configure it."
yes but, how?
if i set an ip (77.113.158.101), on the ethernet protocol, how can i set another ip (192.168.1.1) ?

(Last edited by Trew on 11 Dec 2007, 16:00)

Are you a windows user ???

Then you have to go to the NetworkConnection -> Properties --> IP-Protokoll -> Properties --> more (or so)
I don't know it exactly.

ehm.. sorry, i'm a mac user..!
muahahahaha, is there problems?