OpenWrt Forum Archive

Topic: wlan working, but no ping

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

I have a Fonera with a kamikaze-image.

I want a wlan setup of the essid "testwifi2" that distributes ip-adresses. (and eth0 of a fixed IP)

I have the wlan-setup working, the router has a ip-address (192.171.1.1). I can connect to the wifi (iwconfig), I have a good link (60-80/100) and I set my laptop's IP to 192.171.1.2.

I cannot ping the router. No network traffic seems to get through.

I think I misconfigured something hugely. This is my config:

Thanks for your time and help.

=== /etc/networks ===

default 0.0.0.0
loopnet 127.0.0.0
wlan    192.171.0.0
lan     192.170.0.0

=== /etc/config/dhcp ===

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

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

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

config dhcp
        option interface        wan
        option ignore   1
=== /etc/config/network ===

# Copyright (C) 2006 OpenWrt.org

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   192.170.1.1
        option netmask  255.255.255.0

#config interface lan1
#       option ifname   eth0:1
#       option proto    dhcp

config interface wlan
        option ifname   wifi0
#       option type     atheros
        option proto    static
        option ipaddr   192.171.1.1
        option netmask  255.255.255.0

=== /etc/config/wireless ===

config wifi-device  wifi0
        option type     atheros
        option channel  5
        #option disabled        '0'

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1

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

=== /etc/dnsmasq.conf ===

# filter what we send upstream
domain-needed
bogus-priv
filterwin2k
localise-queries

# allow /etc/hosts and dhcp lookups via *.lan
local=/wlan/
domain=wlan
expand-hosts
no-negcache
resolv-file=/tmp/resolv.conf.auto

dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases

# use /etc/ethers for static hosts; same format as --dhcp-host
# <hwaddr> <ipaddr>
read-ethers

# other useful options:
# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
=== /etc/ethers ===

ifconfig says:
root@epsilon:~# ifconfig
ath0      Link encap:Ethernet  HWaddr 00:18:84:82:C1:4D
          inet addr:192.171.1.1  Bcast:192.171.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:319 (319.0 B)

eth0      Link encap:Ethernet  HWaddr 00:18:84:82:C1:4C
          inet addr:192.170.1.1  Bcast:192.170.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4124 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3890 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:329955 (322.2 KiB)  TX bytes:481180 (469.9 KiB)
          Interrupt:4 Base address:0x1000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1236 (1.2 KiB)  TX bytes:1236 (1.2 KiB)

wifi0     Link encap:Ethernet  HWaddr 00:18:84:82:C1:4D
          inet addr:192.171.1.1  Bcast:192.171.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:792 errors:0 dropped:0 overruns:0 frame:60847
          TX packets:438 errors:221 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:199
          RX bytes:49957 (48.7 KiB)  TX bytes:57626 (56.2 KiB)
          Interrupt:3 Memory:b0000000-b00ffffc

Remove 'option network wlan' from /etc/config/wireless, this is only used when you are bridging interfaces ('option type bridge' in /etc/config/network.) Also change 'option ifname wlan0' in the wlan section of /etc/config/network to 'option ifname ath0' (as this is the first atheros wifi-iface.) This should make things work as the wireless interface is the sole interface for the wlan network.

Oh my I feel so stupid. I did what you said, and it worked! (Thank you very much!) But only for a short time: I must have tinkered too much, and now (including rebooting, wifi up, /etc/init.d/network restart) I'm stuck again. My config is only different in the points you sayed (I looked at the diff), anyway, here is it again:

I'm quite confused now. Can you see any other mistakes? (Again, thanks for your time)

=== /etc/networks ===

default 0.0.0.0
loopnet 127.0.0.0
wlan    192.171.0.0
lan     192.170.0.0

=== /etc/config/dhcp ===

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

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

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

config dhcp
        option interface        wan
        option ignore   1
=== /etc/config/network ===

# Copyright (C) 2006 OpenWrt.org

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   192.170.1.1
        option netmask  255.255.255.0

#config interface lan1
#       option ifname   eth0:1
#       option proto    dhcp

config interface wlan
        option ifname   ath0
#       option type     atheros
        option proto    static
        option ipaddr   192.171.1.1
        option netmask  255.255.255.0

=== /etc/config/wireless ===

config wifi-device  wifi0
        option type     atheros
        option channel  5
        #option disabled        '0'

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1

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

=== /etc/dnsmasq.conf ===

# filter what we send upstream
domain-needed
bogus-priv
filterwin2k
localise-queries

# allow /etc/hosts and dhcp lookups via *.lan
local=/wlan/
domain=wlan
expand-hosts
no-negcache
resolv-file=/tmp/resolv.conf.auto

dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases

# use /etc/ethers for static hosts; same format as --dhcp-host
# <hwaddr> <ipaddr>
read-ethers

# other useful options:
# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
=== /etc/ethers ===

root@epsilon:~# ifconfig
ath0      Link encap:Ethernet  HWaddr 00:18:84:82:C1:4D
          inet addr:192.171.1.1  Bcast:192.171.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:99 errors:0 dropped:0 overruns:0 frame:0
          TX packets:147 errors:0 dropped:8 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10932 (10.6 KiB)  TX bytes:14202 (13.8 KiB)

eth0      Link encap:Ethernet  HWaddr 00:18:84:82:C1:4C
          inet addr:192.170.1.1  Bcast:192.170.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:379 errors:0 dropped:0 overruns:0 frame:0
          TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36257 (35.4 KiB)  TX bytes:38459 (37.5 KiB)
          Interrupt:4 Base address:0x1000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wifi0     Link encap:Ethernet  HWaddr 00:18:84:82:C1:4D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2055 errors:0 dropped:0 overruns:0 frame:45022
          TX packets:1314 errors:330 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:199
          RX bytes:122777 (119.8 KiB)  TX bytes:151324 (147.7 KiB)
          Interrupt:3 Memory:b0000000-b00ffffc

I solved the problem.

Just kidding, I'd never do a post like that...

Reconfiguring with ifconfig/iwconfig/wlanconfig worked, but not until I chose a new essid and netmask.

A weird problem I don't understand yet, but it's gone now.

The discussion might have continued from here.