OpenWrt Forum Archive

Topic: Can't Connect to Internet

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

I have an ASUS wl320GE and despite alot of googling and looking at the basic.config wiki page I cannot connect it to the internet. I would like to do so via my normal router (a virgin superhub 2). If it makes a difference there is only 1 ethernet port on the router, so I can't plug into the superhub and make changes on the computer at the same time.

I think I want to connect through plain ethernet, so what do I put in these fields (heres the example)

uci set network.wan.proto=static
uci set network.wan.ipaddr=74.125.115.103
uci set network.wan.netmask=255.255.255.0
uci set network.wan.gateway=74.125.115.1
uci set network.wan.dns='8.8.8.8 8.8.4.4'
uci commit network
ifup wan

Would the ipaddress be the ip of my router or my actual ip address the internet sees (or something else)? Same question for the gateway?

(Last edited by charlie_slh on 24 Feb 2015, 20:28)

How is the modem configured? Is it in bridged mode?
How does your ISP require you to establish a connection?
Have you tried to configure the WAN interface as a DHCP client?

eduperez wrote:

How is the modem configured? Is it in bridged mode?
How does your ISP require you to establish a connection?
Have you tried to configure the WAN interface as a DHCP client?

After looking through google, the user manual and the router settings bridged mode doesn't appear to be an option, only 'modem mode' where exclusively 1 ethernet port is available.

Again, I googled but couldn't find anything about how the ISP connection is made. I'm a student (this is part of a project, if it makes any difference I don't need a permanent connection, just to install a couple of packages then the router's going in a racing car) in rented accommodation.

DHCP settings are:

LAN
IP: 192.168.0.1
Subnet mask: 255:255:255:0

DHCP
[x]enabled
IP: 192.168.0.2-254
Max users: 253
Lease time: 1 day

Thanks. If it helps I also have easy access to a TP-Link powerline adapter.

If your modem is not in bridged mode, then you have two options:

* Configure your WAN as a DHCP client, and your LAN interface as a DHCP server, or a different 192.168.x network (this is the default configuration for OpenWrt, if I recall correctly). Your router will act as a router, an NAT all devices connected to it.

* Bridge your WAN and LAN interfaces together, give it a fixed IP address, and disable the DHCP server (this is the dumb-AP mode, see http://wiki.openwrt.org/doc/recipes/dumbap).

Bridging doesn't seem to be an option with this router which leaves configuring DHCP. The settings page help says the router is by default a DHCP server. I'm not sure I understand what you mean when you suggest setting WAN as client and LAN as server. Do you mean have the Superhub as a DHCP server (that is the current setting) and the WL320GE as client? If so, do I need to put this in /etc/config/network & /wireless as appropriate:

config 'switch' 'eth0' 
   option 'reset' '1' 

config 'switch_vlan' 'eth0_3' 
   option 'device' 'eth0' 
   option 'vlan' '0' 
   option 'ports' '3 5*' 

config 'interface' 'wan'
        option 'proto' 'dhcp'
        option 'ifname' 'eth0_3'

config wifi-iface
        option 'device'     'radio0' #Would this be right?
        option 'mode'       'sta' #Same question here?
        option 'ssid'       'Some Wireless Network'
        option 'encryption' 'psk2'
        option 'key'        '12345678'
        option 'network'    'wwan' #Again not sure about this bit

First two bits are from the WL320GE wiki, the third bit is slightly modified from the network wiki and the last bit is from the same page but obviously I haven't changed the details.
Thanks again, sorry if I'm being dim

(Last edited by charlie_slh on 25 Feb 2015, 13:23)

charlie_slh wrote:

Bridging doesn't seem to be an option with this router which leaves configuring DHCP. The settings page help says the router is by default a DHCP server. I'm not sure I understand what you mean when you suggest setting WAN as client and LAN as server. Do you mean have the Superhub as a DHCP server (that is the current setting) and the WL320GE as client? If so, do I need to put this in /etc/config/network & /wireless as appropriate:

config 'switch' 'eth0' 
   option 'reset' '1' 

config 'switch_vlan' 'eth0_3' 
   option 'device' 'eth0' 
   option 'vlan' '0' 
   option 'ports' '3 5*' 

config 'interface' 'wan'
        option 'proto' 'dhcp'
        option 'ifname' 'eth0_3'

config wifi-iface
        option 'device'     'radio0' #Would this be right?
        option 'mode'       'sta' #Same question here?
        option 'ssid'       'Some Wireless Network'
        option 'encryption' 'psk2'
        option 'key'        '12345678'
        option 'network'    'wwan' #Again not sure about this bit

First two bits are from the WL320GE wiki, the third bit is slightly modified from the network wiki and the last bit is from the same page but obviously I haven't changed the details.
Thanks again, sorry if I'm being dim

My last post was about configuring the OpenWrt router, not the Superhub (sorry if that was not clear); the Superhub must be configured as a router, and have a DHCP server active (the configuration at the image you posted seems fine to me).

What you want to accomplish seems almost the default configuration for OpenWrt, you just need to activate the Wifi part. I would not mess with the configuration files now, and try to do everything from Luci fist:

* Configure the LAN interface with a fixed 192.168.1.1 address, and add a DHCP server.
* Configure the Wifi as an access point, give it a name and a password, and bridge it to the LAN interface.
* Configure the WAN interface as a DHCP client and default gateway.
* Enable traffic from the LAN to the WAN, and activate masquerading.

There are a couple of options here. 

The first is basically what eduperez said.  Starting from a default configuration where the ethernet port is in lan, connect your PC to the ethernet port and log in at 192.168.1.1.
Then change the lan address something other than that of your main router, though in the same subnet.  For example if superhub 192.168.1.1, make the openwrt 192.168.1.2.  Also you need to set the gateway and DNS to the IP of your superhub.  Check the box that turns off DHCP.  Apply these changes all at once.

At this point you can connect your PC to the superhub like a regular user (wifi or wired) and connect the one ethernet port to another LAN port on the superhub.  Then browse to 192.168.1.2.  You should see that the time of day has been set via the internet.  You can then go to the software page and install packages.

The other option is to use the router as a router.  First set up wifi and connect your PC via wifi.  Then move the ethernet port to the wan network and leave that network at its default as a DHCP client.  If your superhub is using 192.168.1.X, you need to change the LAN address in openwrt to something else like 192.168.2.1.  After doing that, you will lose contact with the router until you disconect your PC and reconnect.  Plug in the ethernet cable to the superhub and continue to access the lan side via wifi.  Your PC and the router itself should now have internet.

The first method is probably more what you want for the eventual use of the router as a standalone device not connected to the internet.

Thanks both of ya I managed to get things working. Reflashed down to v10 so I could use Luci which made everything so much easier.

Hit another block, I've run out of space. I've only installed kmod-usb-core and kmod-usb-ohci, I tried to install kmod-usbip-server and an error came up.
These are the results of df:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1920      1920         0 100% /rom
tmpfs                     6696      1556      5140  23% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            1088      1072        16  99% /overlay
mini_fo:/overlay          1920      1920         0 100% /

I just need kmod-usbip-server & kmod-usbip-client installed so that shouldn't be too much space.

Edit: Based on some googling it seems like I'll have to compile my own os, which I'm doing with VMWare, Ubuntu and the how tos on the wiki.

(Last edited by charlie_slh on 1 Mar 2015, 15:02)

The discussion might have continued from here.