OpenWrt Forum Archive

Topic: Fonera: AP mode

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

hi@all!

i'm going to use one Fonera like an home AP: i want to set up an access point, where i can connect with my wireless portables.

on the Fonera i've load the last Kamikaze kernel (7.09).

i've a range of 5 IPs, gived me by my provider: 77.113.158.154/29
my real gateway is 77.113.158.153, and so, i can use only 5 IPs: 77.113.158.154..155..156..157..158

i understand that to configure the Fonera, i've only to modify these 3 files: dhcp, wireless, network.

here:

#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

with this ^ configuration, all is correct, the portable PCs receive all parameter from dhcp, and they go online immediately.
they received an IP like one of these: 77.113.158.155..156..157..158

it's good, but i prefer that the Fonera assign me an IP like 192.168.1.1/24.. is it possible?

so, i try with this configuration:

# 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


# 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.154
        option netmask  255.255.255.248
        option gateway  77.113.158.153
        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/dhcp
config dhcp
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

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

but, with this ^ configuration, the portable PCs connect correctly to the Fonera, and receive all parameters from dhcp, but non able to go online..!

why this?
i don't know where i mistake!


thanks,
Trew


p.s.: form openwrt console, i'm able to ping some host over internet.
from the PCs, i cannot ping internet.
from the PCs i can only ping the Fonera ath0 (192.168.1.1) and the fonera eth0 (77.113.158.154).
from the PCs, if i traceroute the real gateway (77.113.158.153), 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.154, and so to 77.213.158.153.

how can i correct this?



all RESOLVED here: http://forum.openwrt.org/viewtopic.php?pid=60101#p60101
special thanks to ELEON!!

(Last edited by Trew on 7 Dec 2007, 12:43)

Hy,

what does an "iptables -L" and "netstat -rn" say ???

But something isn't clear for me. In your first config you make a wlan brigde an in the second one you make a really ap with nat routing, etc out of it. Have you ever take a look at the /etc/hostapd.conf ??? Can you post it here ???

reagards
j0inty.sL

with this Access Point configuration, i can connect with some PC (with wireless card), and i can browse internet very good:

# 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          #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   10.10.10.1
        option netmask  255.255.255.0

i can also browse files of all computer connected to the foneraAP!
i can ping and traceroute them, correctly!


your requests:

root@OpenWrt:~# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            state INVALID 
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
DROP       tcp  --  anywhere             anywhere            tcp option=!2 flags:SYN/SYN 
input_rule  all  --  anywhere             anywhere            
input_wan  all  --  anywhere             anywhere            
LAN_ACCEPT  all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     gre  --  anywhere             anywhere            
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset 
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable 

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            state INVALID 
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU 
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
forwarding_rule  all  --  anywhere             anywhere            
forwarding_wan  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            state INVALID 
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
output_rule  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset 
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable 

Chain LAN_ACCEPT (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain forwarding_rule (1 references)
target     prot opt source               destination         

Chain forwarding_wan (1 references)
target     prot opt source               destination         

Chain input_rule (1 references)
target     prot opt source               destination         

Chain input_wan (1 references)
target     prot opt source               destination         

Chain output_rule (1 references)
target     prot opt source               destination

and:

root@OpenWrt:~# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
77.113.158.97  0.0.0.0         255.255.255.248 U         0 0          0 eth0
10.10.10.0      0.0.0.0         255.255.255.0   U         0 0          0 ath0
0.0.0.0         77.113.158.101  0.0.0.0         UG        0 0          0 eth0

p.s.: i have modified only "dhcp", "network" and "wireless" files; all the rest is standard.

The discussion might have continued from here.