OpenWrt Forum Archive

Topic: Linux no internet on ASUS WL-500gp joining existing wireless

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

I have been trying to solve this problem myself for about 2 weeks with searching on here to no avail.

I have it set to join existing wireless network in my house (sta mode) and devices connected via the LAN ports (eg my DVR) can access the Internet and download files.  However the linux part of the router has no internet connection (which I need because I have a USB sensor attached that I need to forward via XMPP to a server).  eg any address I ping is unreachable, even the IP of the wireless base station it has joined.

What did I do wrong in my config?

My network config looks like this:


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 'type' 'bridge'
    option 'ifname' 'eth0.0'
    option 'proto' 'static'
    option 'ipaddr' '192.168.1.5'
    option 'netmask' '255.255.255.0'

config 'interface' 'wan'
    option 'type' 'bridge'
    option 'ipv6' '1'
    option 'proto' 'dhcp'
    option '_ifname' 'eth0.1'
    option 'ifname' ' '


And my wireless config looks like this.

config 'wifi-device' 'wl0'
        option 'type' 'broadcom'
        option 'disabled' '0'
        option 'channel' '1'

config 'wifi-iface'
        option 'device' 'wl0'
        option 'encryption' 'psk2'
        option 'key' 'usairways'
        option 'ssid' 'HDNB'
        option 'network' 'lan'
        option 'mode' 'sta'

one of  your problems is that your wan ifname must be the wl0 not eth0.1 which is the ethernet wan port

(edited because my cut/paste of network file was not complete previously)

ttsherpa - thanks.  I guess that is "problem 1" as you say..  what are the others?   /etc/config/network now changed to:

config 'switch' 'eth0'
    option 'vlan0' '0 1 2 3 5*'
    option 'vlan1' '0 5'

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 'type' 'bridge'
    option 'ifname' 'eth0.0'
    option 'proto' 'static'
    option 'ipaddr' '192.168.1.5'
    option 'netmask' '255.255.255.0'

config 'interface' 'wan'
    option 'type' 'bridge'
    option 'ipv6' '1'
    option 'proto' 'dhcp'
    option 'ifname' 'wl0'



However no obvious change..  I still cannot ping anything - get "network is unreachable" errors.

route -n shows:

root@OpenWrt:/etc/config# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

even if I type something like 'nvram set br-lan_gateway=10.0.1.1' it looks the same as above.

also ifconfig shows this:

root@OpenWrt:/etc/config# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:751 errors:0 dropped:0 overruns:0 frame:0
          TX packets:503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:47621 (46.5 KiB)  TX bytes:65537 (64.0 KiB)

br-wan    Link encap:Ethernet  HWaddr 00:00:00:00:00:00 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:30552 (29.8 KiB)

eth0      Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:755 errors:0 dropped:0 overruns:0 frame:0
          TX packets:527 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:63071 (61.5 KiB)  TX bytes:71721 (70.0 KiB)
          Interrupt:4

eth0.0    Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:757 errors:0 dropped:0 overruns:0 frame:0
          TX packets:528 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:49623 (48.4 KiB)  TX bytes:69611 (67.9 KiB)

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:2304 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2304 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:154368 (150.7 KiB)  TX bytes:154368 (150.7 KiB)

wl0       Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:1216
          TX packets:30 errors:1 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3142 (3.0 KiB)  TX bytes:3332 (3.2 KiB)
          Interrupt:2 Base address:0x5000

(Last edited by hscottm on 22 Nov 2009, 03:40)

AP ==> STA (500gp)

This is your network setup isn't it? If so then anything at the AP end won't be able to access hosts connected to the 500gp because of its firewall. To be able to ping the 500gp you have to disable the 500gp firewall with iptables (can't remember the exact command). Another way is to set the 500gp as a Wireless Bridge (that is the 500gp being in the same subnet as the AP).

Also, what's the IP number of your AP?

(Last edited by playdude on 22 Nov 2009, 10:13)

ttsherpa wrote:

one of  your problems is that your wan ifname must be the wl0 not eth0.1 which is the ethernet wan port

No, wan ifname is empty which is okay. Wireless interfaces should not be referenced directly in /e/c/network, this leads to hotplug race conditions, especially in client mode.

~ JoW

hscottm wrote:

I have been trying to solve this problem myself for about 2 weeks with searching on here to no avail.

Your config in the first post is almost right, however the line

option 'network' 'lan'

in the wireless configuration must be

option 'network' 'wan'

to attach the wireless to the wan interface.

Regards,
JoW

ALl - thanks for the continued attempts to help.  Answering a few questions at once.

playdude asked about my setup.  Yes, I have an existing home wireless network that I am trying to configure this ASUS router to join (and then be able to access the Internet via that joined connection by both the LAN ports and also the linux shell within the router - I need both the linux command line to have internet access, and the LAN ports).  When I said I am having problems pinging, I mean problems while logged in to the ASUS router via the command line pinging OUT from the ASUS box.  I can vi the config files no problem.  The IP address of my access point is 10.0.1.1

jow suggested my original wan port configuration was ok, but said I needed to change the lan section to wan.  Which I did, but when I had that, I couldnt connect anymore and had to enter failsafe mode via telnet 192.168.1.1, and so I reverted to an in-between config and have access again:

config 'switch' 'eth0'
        option 'vlan0' '1 2 3 4 5*'
#       option 'vlan1' '0 5'

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 'type' 'bridge'
        option 'ifname' 'eth0.0'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.5'
        option 'netmask' '255.255.255.0'


I am no longer getting host unreachable errors, I am getting:
root@OpenWrt:~# ping www.google.com
ping: bad address 'www.google.com'

which implies to me I have a DNS problem (not that different than the original problem which had no route).  As of now, route -n gives me:

root@OpenWrt:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-wan

I presume the problem has something to do with the wan having a 192.168* IP and the AP having 10.0.1.1, but I have had no success in getting the ASUS to use a 10.0.* IP, since I cannot attach to it via LAN to connect to it.  Any continued help appreciated.

jow wrote:
hscottm wrote:

I have been trying to solve this problem myself for about 2 weeks with searching on here to no avail.

Your config in the first post is almost right, however the line

option 'network' 'lan'

in the wireless configuration must be

option 'network' 'wan'

to attach the wireless to the wan interface.

Regards,
JoW

Hi,

Maybe he is right, because what I did and worked for me is not exactly what you're trying. I used a second wireless as a client (STA) with a USB stick.
Anyway I would make sure first if the Asus is really connected to the other router using iwconfig wl0.
There should be no problem in getting 10.x.x.x addresses because in your LAN you use 192.168.whatever.
Also  bear in mind the problems with broadcom wireless with kernel 2.6

Regards

so how do I tell from what iwconfig says whether its really connected?  this is what I get - it looks ok to me..

wl0       IEEE 802.11-DS  ESSID:"HDNB" 
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:11:24:xx:xx:xx   
          Bit Rate=54 Mb/s   Tx-Power:32 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=5/5  Signal level=-27 dBm  Noise level=-92 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

also,  I have seen of the broadcom/2.6 issues but thought it was about connections in the first place (ie having no connection to the wireless).  how would it affect my problem?

(Last edited by hscottm on 23 Nov 2009, 00:29)

Wireless connection seems fine. As soon as the "Access Point:" bit is displayed, the connection is established. Now, if you use a static ip config on wan, your router has no conneciton to the outside worlds. Specify a default gateway with "option gateway" and a dns server with "option dns" in the wan interface configuration. Also make sure that the gateway is within the subnet you configured (192.168.1.x) .

From what you said earlier, apparently you don't get a DHCP address from your wan, try to use a static IP as JoW said


wl0       Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:1216
          TX packets:30 errors:1 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3142 (3.0 KiB)  TX bytes:3332 (3.2 KiB)
          Interrupt:2 Base address:0x5000

All:

thanks to changes suggested here, I now can "ping" from the command line internally on linux of my asus router (recall I am trying to connect a usb sensor to the internet and have it send info via xmpp).  I can ping now and seem to have an internet path from linux.  however, the LAN ports on the back have no connection to the Internet..  I seem to be getting close!

My recent changes were to switch my static IP to the same subnet as my home router (10.0.*) and to switch the option config to wan from lan in my wireless config..

I also note that despite having a connection via ping, my in-home router shows no DHCP connection for 10.0.1.10 (my ASUS router) so that is puzzling..

so what is the missing magic piece to actually have internet access from within the router (eg at the command line) AND on the back LAN ports?  I thought it was going to be as simple as switching 'wan' to 'lan' in the config - since its those ports I want - but that doesnt work..

  thanks again for all the help here..



--

current /etc/config/network:

config 'switch' 'eth0'
    option 'vlan0' '1 2 3 4 5*'
#    option 'vlan1' '0 5'

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 'type' 'bridge'
    option 'ifname' 'eth0.0'
    option 'proto' 'static'
        option 'ipaddr' '10.0.1.10'
    option 'netmask' '255.255.255.0'
    option 'gateway' '10.0.1.1'
    option 'dns' '10.0.1.1'

current /etc/config/wireless:


config 'wifi-device' 'wl0'
    option 'type' 'broadcom'
    option 'disabled' '0'
    option 'channel' '1'

config 'wifi-iface'
    option 'device' 'wl0'
    option 'encryption' 'psk2'
    option 'key' 'usairways'
    option 'ssid' 'HDNB'
    option 'network' 'wan'
    option 'mode' 'sta'

--

root@OpenWrt:~# arp -a
IP address       HW type     Flags       HW address            Mask     Device
10.0.1.57        0x1         0x2         00:25:BC:E5:6F:8E     *        br-wan
10.0.1.1         0x1         0x2         00:11:24:0D:81:21     *        br-wan
root@OpenWrt:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.1.0        0.0.0.0         255.255.255.0   U     0      0        0 br-wan
0.0.0.0         10.0.1.1        0.0.0.0         UG    0      0        0 br-wan

--

root@OpenWrt:~# ifconfig
br-wan    Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          inet addr:10.0.1.10  Bcast:10.0.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1644 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1903 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:645961 (630.8 KiB)  TX bytes:610493 (596.1 KiB)

eth0      Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1071 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1023 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:113960 (111.2 KiB)  TX bytes:124116 (121.2 KiB)
          Interrupt:4

eth0.0    Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1081 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1028 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:95392 (93.1 KiB)  TX bytes:120006 (117.1 KiB)

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:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1576 (1.5 KiB)  TX bytes:1576 (1.5 KiB)

wl0       Link encap:Ethernet  HWaddr 00:24:8C:9C:22:BF 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1809 errors:0 dropped:0 overruns:0 frame:3332
          TX packets:2384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:682332 (666.3 KiB)  TX bytes:680694 (664.7 KiB)
          Interrupt:2 Base address:0x5000

-


root@OpenWrt:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth0.0    no wireless extensions.

br-wan    no wireless extensions.

wl0       IEEE 802.11-DS  ESSID:"HDNB" 
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:11:24:0D:81:21   
          Bit Rate=54 Mb/s   Tx-Power:32 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=5/5  Signal level=-38 dBm  Noise level=-92 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

(Last edited by hscottm on 27 Nov 2009, 16:34)

well, scratch that.  I changed "wan" to "lan" in what was above again, rebooted, and things seem to be finally working as expected.

internal linux can ping out (and my usb sensor can use XMPP), and my LAN ports (including my DVR) can get DHCP addresses and see the internet!

Thanks again to all here for the help.

We're at a university and hope to deploy a few more ASUS routers for further testbeds of our sensors in homes.  We might end up working on some more "basic openwrt config 101" docs since it took us so long to figure this out - we figure there might be some other newbies who stumble along and need help. 

sincerely, scott

scott--since you got it working, can you post your final config files (network, wireless, and firewall)--or link to the "basic openwrt config 101" docs you refer to?

The discussion might have continued from here.