Configuring OpenWrt

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
gijoe77
Posts: 5
Joined: Fri Jan 15, 2010 12:00 am

Configuring OpenWrt

Post by gijoe77 »

(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 12:00 am

Re: Configuring OpenWrt

Post by gijoe77 »

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.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Configuring OpenWrt

Post by mightyohm »

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

Glad you are making progress!
gijoe77
Posts: 5
Joined: Fri Jan 15, 2010 12:00 am

Re: Cont....Configuring OpenWrt

Post by gijoe77 »

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...
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Configuring OpenWrt

Post by mightyohm »

What exactly happens when you lose the connection? How are you connecting to the router? Serial or ethernet? If ethernet, what IP address?
gijoe77
Posts: 5
Joined: Fri Jan 15, 2010 12:00 am

Re: Configuring OpenWrt

Post by gijoe77 »

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?
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Configuring OpenWrt

Post by mightyohm »

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
gijoe77
Posts: 5
Joined: Fri Jan 15, 2010 12:00 am

Re: Configuring OpenWrt

Post by gijoe77 »

Jeff,

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

Thanks.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Configuring OpenWrt

Post by mightyohm »

Cool, I am glad you got it working! Have fun. :)
Post Reply