Configuring OpenWrt

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.

Configuring OpenWrt

Postby gijoe77 » Sat Jan 16, 2010 9:35 pm

(Using Asus WL-520GU)I am having difficulties configuring the mentioned files in Part 4:
1. Does the router have to be connected to a Wifi network before the files can be modified?
2. Using secure crt (telnet alternative) to connect router to Wifi network, but keep getting "password authentication failed". Re-installed OpenWrt already and still can't connect, any suggestions?
3. Where are the following files located?
root@OpenWrt:~# vi /etc/config/wireless; root@OpenWrt:~# vi /etc/config/network; etc.

Joe
gijoe77
 
Posts: 5
Joined: Fri Jan 15, 2010 1:00 am

Re: Configuring OpenWrt

Postby gijoe77 » Sun Jan 17, 2010 1:06 am

Found answers to the questions posted
1.No, router is unable to be connected to a Wifi network with current settings.
2. User id is 'root', then type chosen password.
3.who knows, but after SSH connection is acquired, just type the name of the files to be changed; hit enter the files appear, ready for editing.
gijoe77
 
Posts: 5
Joined: Fri Jan 15, 2010 1:00 am

Re: Configuring OpenWrt

Postby mightyohm » Sun Jan 17, 2010 11:33 am

The files are stored on the router. It has flash storage and a filesystem onboard.

Glad you are making progress!
User avatar
mightyohm
Site Admin
 
Posts: 286
Joined: Fri Apr 03, 2009 11:29 pm
Location: San Francisco, CA

Re: Cont....Configuring OpenWrt

Postby gijoe77 » Sun Jan 31, 2010 12:12 am

Part IV loosing it at the point of network restart

"connection to host lost", message appears after exceuting the following comand on cmd, "root@OpenWrt:/# /etc/init.d/network restart"
---------------------------------------------------
My set up looks like:
root@OpenWrt:~# vi /etc/config/wireless
config wifi-device wl0
option type broadcom
option channel 3 #my channel

# REMOVE THIS LINE TO ENABLE WIFI:
#option disabled 1
config wifi-iface
option device wl0
option network lan
option mode sta
option ssid Joe
option encryption psk #wpa encryption mode
option key xxxx #replaced x's with key

root@OpenWrt:~# vi /etc/config/network
#### Loopback configuration
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0.0"
option proto dhcp
#option ipaddr 192.168.1.1
#option netmask 255.255.255.0
#### WAN configuration
config interface wan
option ifname "eth0.1"
option proto dhcp

root@OpenWrt:~# vi /etc/resolv.conf

nameserver 127.0.0.1
-------------------------------------------------------

Have tried using static IP address 192.168.1.185 with gateway of 192.168.1.1 without success.

Any suggestions are appreciated...
gijoe77
 
Posts: 5
Joined: Fri Jan 15, 2010 1:00 am

Re: Configuring OpenWrt

Postby mightyohm » Mon Feb 01, 2010 9:21 pm

What exactly happens when you lose the connection? How are you connecting to the router? Serial or ethernet? If ethernet, what IP address?
User avatar
mightyohm
Site Admin
 
Posts: 286
Joined: Fri Apr 03, 2009 11:29 pm
Location: San Francisco, CA

Re: Configuring OpenWrt

Postby gijoe77 » Tue Feb 02, 2010 11:04 pm

I am executing, "root@OpenWrt:/# /etc/init.d/network restart" on the command prompt, after a few seconds I get, " "connection to host lost". I can't connect to the router after that.

The secure shell client looses the connection also. I am using the ssh client to edit the files like:
root@OpenWrt:~# vi /etc/config/wireless
root@OpenWrt:~# vi /etc/config/network

I am connecting via ethernet, using IP address of 192.168.1.1

Question,
Is my active router suppose to be on while am configuring the Asus router?
gijoe77
 
Posts: 5
Joined: Fri Jan 15, 2010 1:00 am

Re: Configuring OpenWrt

Postby mightyohm » Wed Feb 03, 2010 12:33 am

Ah-ha, I think I see what is happening. You are enabling DHCP on the LAN side of the router in /etc/config/network (because I told you to do it in the tutorial, so it is my fault). Since the LAN and WAN are bridged, to telnet back in via ethernet you would have to use the IP address that your wireless network is assigning the router with DHCP instead of 192.168.1.1. This is not the best way to do it (at the time I wrote the tutorial I was using the serial port to access the router so this stuff didn't matter). If you can figure out what IP address your home network is assigning the router, you should be able to ssh to that IP instead.

Or...
To simplify things and keep a known IP address, try changing your configs to something like this instead:

/etc/config/wireless:
Code: Select all
config wifi-device  wl0
   option type     broadcom
   option channel  3

   # REMOVE THIS LINE TO ENABLE WIFI:

config wifi-iface
   option device   wl0
   option network   wan
   option mode     sta
   option ssid     Joe
   option encryption psk
   option key xxxx


/etc/config/network:
Code: Select all
#### VLAN configuration
config switch eth0
   option vlan0   "1 2 3 4 5*"
   option vlan1   "0 5"


#### Loopback configuration
config interface loopback
   option ifname   "lo"
   option proto   static
   option ipaddr   127.0.0.1
   option netmask   255.0.0.0


#### LAN configuration
config interface lan
   #option type    bridge
   option ifname   "eth0.0"
   option proto   static
   option ipaddr   192.168.1.1
   option netmask   255.255.255.0


#### WAN configuration
config interface    wan
   option ifname   "eth0.1"
   option proto   dhcp
User avatar
mightyohm
Site Admin
 
Posts: 286
Joined: Fri Apr 03, 2009 11:29 pm
Location: San Francisco, CA

Re: Configuring OpenWrt

Postby gijoe77 » Sun Feb 07, 2010 10:19 pm

Jeff,

the new set up worked.....tackling the next part.

Thanks.
gijoe77
 
Posts: 5
Joined: Fri Jan 15, 2010 1:00 am

Re: Configuring OpenWrt

Postby mightyohm » Sun Feb 07, 2010 11:27 pm

Cool, I am glad you got it working! Have fun. :)
User avatar
mightyohm
Site Admin
 
Posts: 286
Joined: Fri Apr 03, 2009 11:29 pm
Location: San Francisco, CA


Return to Wifi Radio Project / Hacking the Asus WL-520gU

Who is online

Users browsing this forum: No registered users and 1 guest

cron