Page 1 of 2

Help! Stuck at /etc/init.d/network restart

Posted: Mon Dec 06, 2010 7:49 am
by ozBillo
Hi guys,

I get stuck at the "/etc/init.d/network restart" step.
It just seems to hang there and the Air light never comes on.
I've left it for 10 minutes without any luck.
I've retried many times from the start but I keep getting stuck at the same point.

Here's my config settings...

Code: Select all

root@OpenWrt:~# vi /etc/config/wireless
config wifi-device  wl0
        option type     broadcom
        option channel  2

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

config wifi-iface
        option device   wl0
        option network  lan
        option mode     sta
        option ssid     Bills-Network
        option encryption psk
        option key      'thisisnotmyrealkey'
~
root@OpenWrt:~# vi /etc/config/network
#### 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    dhcp
        # option ipaddr 192.168.1.1
        # option netmask        255.255.255.0


root@OpenWrt:~# vi /etc/resolv.conf
nameserver 127.0.0.1
~
Any ideas?

Cheers,
Bill

Re: Help! Stuck at /etc/init.d/network restart

Posted: Mon Dec 06, 2010 8:52 am
by mightyohm
Well, safe to say it is not connecting to your wireless network.

Have you double-checked the wifi channel number and that you are well within range of your wireless network?

Have you tried changing the security of your wireless network by turning it off temporarily or moving to WEP (and updating the config file), to see if that changes anything?

Try the command "iwlist wl0 scan" to list your available networks. I'm not sure if it works on the version of OpenWrt on the router, and I can't test it right now. But it might be worth a shot.

Re: Help! Stuck at /etc/init.d/network restart

Posted: Mon Dec 06, 2010 10:20 am
by ozBillo
Hi Jeff,

You were right, my channel was wrong.
I'll change the config and give it another try.

Thanks for the help :)

Re: Help! Stuck at /etc/init.d/network restart

Posted: Mon Dec 06, 2010 11:34 am
by ozBillo
Still no luck, Jeff.
I am connecting to the router via ethernet using putty.
I suspect that might be complicating things.

I went thru the whole process again.
This time I used Tinkernuts settings (http://tinkernut.com/archives/2387)
and changed my LAN config like this...

option proto static
option ipaddr 192.168.15.103
option netmask 255.255.255.0
option gateway 192.168.15.1
option dns 8.8.8.8

I then restarted putty with 192.168.15.103 and did the network restart.
This time I got the following response...

udhcpc (v1.11.2) started
Sending discover...
root@OpenWrt:~:# Sending discover...
Sending discover...

Then it just sits there. Still no air light.

So, I've got a little further.

Any suggestions?

Re: Help! Stuck at /etc/init.d/network restart

Posted: Wed Dec 08, 2010 12:48 am
by jeroen94704
Try this:

- In /etc/config/wireless, change the option "network" for the wifi-iface to "wlan"
- In /etc/config/network, add a block identical to the "config interface lan", called "config interface wlan", and set the ifname option to wl0

Then restart the network.

This is how my network is configured, and it works for me.

Jeroen

Re: Help! Stuck at /etc/init.d/network restart

Posted: Wed Dec 08, 2010 9:09 am
by mightyohm
Can you post tinkernut's settings here so I don't have to watch the video to look at them? :)

I still maintain that the router is not associating with your wireless network. You can aid your troubleshooting immensely by making your network easier to associate with, ie. temporarily turning off encryption. Then you can set the encryption to 'none' and comment out the key in /etc/config/wireless and try restarting the network again.

Also, don't set the IP address and other settings for the LAN if you still have bridging turned on, that's bound to cause problems. Comment out the line that reads "option bridge" if you want to set the LAN ports to a fixed IP address (to make it easy to use putty to connect).

Here are the config files I am using, for reference:

/etc/config/wireless

Code: Select all

config wifi-device  wl0
	option type     broadcom
	option channel  5

	# REMOVE THIS LINE TO ENABLE WIFI:

config wifi-iface
	option device   wl0
	option network	wan
	option mode     sta
	option ssid     MYSSID 
	option encryption wep
	option key MYWEPKEY

/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
/etc/config/firewall

Code: Select all

config defaults
	option syn_flood	1
	option input		ACCEPT
	option output		ACCEPT 
	option forward		REJECT

config zone
	option name		lan
	option input	ACCEPT 
	option output	ACCEPT 
	option forward	REJECT

config zone
	option name		wan
	option input	ACCEPT
	option output	ACCEPT 
	option forward	REJECT
	option masq		1 

config forwarding 
	option src      lan
	option dest     wan


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT 

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	00:11:22:33:44:66
#	option target	REJECT 

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80 
#	option proto		tcp

# include a file with users custom iptables rules
#config include
#	option path /etc/firewall.user


### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT 

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

Re: Help! Stuck at /etc/init.d/network restart

Posted: Wed Dec 08, 2010 10:25 am
by ozBillo
Thanks Jeroen and Jeff for your suggestions.

I disabled security on my other router and commented out bridge as per your suggestion, Jeff.
Here are my current settings...

Code: Select all

root@OpenWrt:~# cat /etc/config/wireless
config wifi-device  wl0
        option type     broadcom
        option channel  1

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

config wifi-iface
        option device   wl0
        option network  lan
        option mode     sta
        option ssid     Bills-Network
        option encryption none

root@OpenWrt:~# cat /etc/config/network
#### 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
I did the network restart and, woohoo!! the air light came on.
I then tried pinging google...

Code: Select all

root@OpenWrt:~# ping www.google.com
ping: bad address 'www.google.com'
root@OpenWrt:~# ping 72.125.19.104
PING 72.125.19.104 (72.125.19.104): 56 data bytes
ping: sendto: Network is unreachable
So, I'm closer to success but obviously there are still some things that need fixing.
I'm a software developer but I must confess to being a little bit at sea when it comes to setting up wireless networks.

Any idea why my pings aren't working"?
I'm only about 2 meters from my main wireless router.

Re: Help! Stuck at /etc/init.d/network restart

Posted: Wed Dec 08, 2010 7:11 pm
by mightyohm
Edit wireless and change this line:

option network lan

to

option network wan

Also, take a look at the config files I posted.

Re: Help! Stuck at /etc/init.d/network restart

Posted: Thu Dec 09, 2010 1:36 pm
by ozBillo
Thanks, Jeff. Right again!

I did look at your config files but I had missed "option network wan" :oops:

Once that change was made it worked. Awesome!

I then re-enabled WPA on my main router and tried to get the Asus working with "option encryption psk". No luck.
I did a little reading and found out that the version of Openwrt we're using doesn't support WPA+AES (which my main router uses).
I changed it to WPA+TKIP and that worked okay.
I then changed it to WPA2+AES and changed the config/wireless to "option encryption psk2". That worked okay, too. Awesome.

Now, I just have to wait until my usb sound card arrives so I can make some noise!

Thanks again, Jeff, for all your help.
Very much appreciated.

Cheers,
Bill

Re: Help! Stuck at /etc/init.d/network restart

Posted: Thu Dec 09, 2010 8:25 pm
by mightyohm
Awesome! I didn't realize you could use WPA2-AES with OpenWrt, so thanks for educating me about that. I'll have to try it out. :)

Thanks and good luck!