OpenWrt Forum Archive

Topic: fonera client mode troubles

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

I'm trying to set up my fonera in client mode so that the PHP-server on it can wget a website.
But I have some problems, I have to wait very long before the wifi is connected, and when it's connected it cannot access any site. (no route to host)
Gateway and DNS-server are correct, they point to my router.

Here are 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 interface lan
    option ifname    'eth0'
    option proto    'static'
    option ipaddr    '192.168.123.3'
    option netmask    '255.255.255.0'
    option gateway    '192.168.123.1'
    option dns    '192.168.123.1'

/etc/config/wireless:

config wifi-device  wifi0
    option type     atheros
    option distance    '200'
    option diversity    '0'
    option txantenna    '0'
    option rxantenna    '0'

config wifi-iface
    option device    wifi0
    option ssid    'HomeWifi'
    option mode    'sta'
    option encryption    'psk'
    option txpower    '18'
    option bgscan    '1'
    option key    'jsdhbfsqdghfh'
    option key1    ''
    option key2    ''
    option key3    ''
    option key4    ''
    option network    'lan'
    option server    ''
    option port    ''

The routing table:

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.123.0   *               255.255.255.0   U     0      0        0 eth0
192.168.123.0   *               255.255.255.0   U     0      0        0 ath0
default         192.168.123.1   0.0.0.0         UG    0      0        0 eth0

Wget a google page:

root@OpenWrt:~# wget http://www.google.com
Connecting to www.google.com [64.233.183.147:80]
wget: cannot connect to remote host (64.233.183.147): No route to host

Can somebody help me to fix those problems, please?

(Last edited by lospiratos on 12 May 2007, 13:44)

Yeah, client-mode sucks with every WiFi on Linux.

In my tests with Kamikaze on Fonera I only got routed client-mode with static IP and max. WEP encryption working!

Can I see you working config files?

Since it was just a test, I lost the config files... Sorry.

Maybe somebody else can help me?

@ lospiratos :
well , i think if we know more about your configuration , we can bring a litte bit more sunshine to you  :-)
maybe it's a firewall problem , it was very helpfull if you post the output from
iptables -L -n -v
and
iptables -t nat -L -n -v
and
ps auxww
so we can see what iptables do with the incoming data and ps auxww show us if dnsmasq and udhcpc are running .....
if you won't post the firewall rules , please have a look at that and make shure that you have setup your iptables right
as far as i know , Iptables on Kamikaze are not configured for incoming data over wifi ( nat firewall , masquerading  and so on ...)
you can setup  iptables yourself , i think it was described in the wiki (client mode )
have a nice day .

Here is the output of the commands, but I first want that openwrt connects faster to my wifi network, now it takes round 10 minutes to connect.
Are my configuration files correct?

This is my configuration:
Internet-----Router))))))))(((((((((Openwrt
I want that the php server on openwrt can access internet files.

And how can I let my Openwrt connect to my router with a script?

iptables -L -n -v

root@OpenWrt:~# iptables -L -n -v
Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID
  505 57686 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp option=!2 flags:0x02/0x02
  317 20041 input_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 input_wan  all  --  wan0   *       0.0.0.0/0            0.0.0.0/0
  317 20041 LAN_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     47   --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID
    0     0 TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 forwarding_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 forwarding_wan  all  --  wan0   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  eth0   eth0    0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  eth0   wan0    0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID
  855  202K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
   18  1081 output_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   18  1081 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain LAN_ACCEPT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     all  --  wan0   *       0.0.0.0/0            0.0.0.0/0
  317 20041 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
root@OpenWrt:~#

iptables -t nat -L -n -v

root@OpenWrt:~# iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 350 packets, 20971 bytes)
 pkts bytes target     prot opt in     out     source               destination
   79  3792 NEW        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW
  350 20971 prerouting_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 prerouting_wan  all  --  wan0   *       0.0.0.0/0            0.0.0.0/0

Chain POSTROUTING (policy ACCEPT 11 packets, 668 bytes)
 pkts bytes target     prot opt in     out     source               destination
   10   610 postrouting_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 MASQUERADE  all  --  *      wan0    0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 11 packets, 668 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain NEW (1 references)
 pkts bytes target     prot opt in     out     source               destination
   79  3792 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 50/sec burst 100
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
root@OpenWrt:~#

ps auxww

root@OpenWrt:~# ps auxww
  PID  Uid     VmSize Stat Command
    1 root        400 S   init
    2 root            SWN [ksoftirqd/0]
    3 root            SW< [events/0]
    4 root            SW< [khelper]
    5 root            SW< [kthread]
   20 root            SW< [kblockd/0]
   31 root            SW  [pdflush]
   32 root            SW  [pdflush]
   33 root            SW< [kswapd0]
   34 root            SW< [aio/0]
   44 root            SW  [mtdblockd]
  151 root            SWN [jffs2_gcd_mtd1]
  159 root        284 S   klogd
  162 root        408 S   logger -s -p 6 -t
  163 root        240 S   init
  189 root        328 S   /sbin/syslogd -C16 -m 0
  391 root        228 S   /sbin/hotplug2 --persistent --max-children 5
 1308 root        328 S   crond -c /etc/crontabs
 1317 root        336 S   /usr/sbin/dropbear -p 22
 1348 root        328 S   httpd -p 80 -h /www -r OpenWrt
 1354 root        288 S   pure-ftpd (SERVER)
 1419 nobody      372 S   dnsmasq -F 192.168.123.100,192.168.123.250,255.255.25
 1429 root       2340 S   php /home/lcd/lcd.php
 3162 root        380 S   /bin/sh /sbin/hotplug-call iface
 3167 root        940 S   wpa_supplicant -Bw -D wext -i ath0 -c /var/run/wpa_su
 3194 root        272 S   /usr/sbin/ntpclient -s -h pool.ntp.org -p 123
 3612 root        560 S   /usr/sbin/dropbear -p 22
 3672 root        468 S   -ash
 4083 root        388 R   ps auxww
root@OpenWrt:~#

anyone?

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.123.0   *               255.255.255.0   U     0      0        0 eth0
192.168.123.0   *               255.255.255.0   U     0      0        0 ath0
default         192.168.123.1   0.0.0.0         UG    0      0        0 eth0

this is almost surely incorrect, as you have the internet traffic going only over the lan interface, and have the same subnet on both..

ok. good news. finally routed client-mode (static and dhcp) works now smile everything configured in the config files (/etc/config/network and /etc/config/wireless).

i have compiled kamikaze_7.06 with latest madwifi driver from /trunk/package/madwifi.

for my tests i used a fritzbox 7170 (ap) and the fonera (routed client-mode) with wep 128bit, psk and psk2. all works.

edit: i have updated the wiki page: ClientModeKamikazeStyleHowto

(Last edited by forum2006 on 3 Jun 2007, 12:39)

bridged client mode actually works the same way currently, with only minor changes in the config files, if any of you were considering trying smile.
if you are using a madwifi device for the access point you must also tell it to accept bridged traffic
option wds 1, on both ends

The end of all fonera/meraki mini client mode troubles (this is directly from the wiki):
2.0.1. How to Automatically configure Client/Ad-hoc Client/Client+Repeater Mode on a Fonera or Meraki mini

Visit Meltyblood's site for more Openwrt/Legend firmware upgrades: http://fon.testbox.dk 1. Read the instructions and get the tar.gz package from here http://fon.testbox.dk/packages/NEW/LEGE … entscript/

That's it. The package of scripts self-installs and will ask you questions to configure your wired and wireless connections. Your current configuration will be backed up and can be restored with the "aprestore" command. Type in "clientmode" after installation to configure client mode. This is currently the easiest and most complete means of having client mode on an Atheros router. These scripts are incompatible with firmwares that use NVRAM. They are included in the Legend Rev4.5 firmware, which will soon be released on the site.

The discussion might have continued from here.