Wireless network?

Re: Wireless network?

Postby fvdw » Wed Feb 19, 2014 10:37 pm

short how to to setup wireless connection form my notes. I can be missing some items but basically this it is how to do it.

make a configuration file and put it in /etc/wpa_supplicant
example conf file (wpa_supplicant.conf)
Replace your-sid and your-passkey by the the actual values set in your wlan (keep the quotes as shown)
Note that these names are case sensitive !
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
update_config=1

network={
ssid="your-ssid"
scan_ssid=1
psk="your-passkey"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=TKIP
}


check if your driver is loaded (wlan0 must be available)
Code: Select all
iwconfig

If it is not found then the driver is not or not correctly loaded and it won't work

bring up interface
Code: Select all
ifconfig wlan0 up


connect to wifi access point
Code: Select all
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B


get an ip address from dhcp server
Code: Select all
udhcpc -b -i wlan0 -q -s /etc/simple.script

In principle now the wlan should be up.

To keep connection when your LAN cable is disconnected you need to adapt the route table
add route for wlan0 (replace xxx.yyy.xxx.yyy by actual ip of your gateway)
Code: Select all
route add default gw xxx.yyy.xxx.yyy dev wlan0


now you should be able to bring down the wired connection
Code: Select all
ifconfig eth0 down

But if you do that then the connection you are using will be lost, and you should use the wireless ip to connect.

You can go here for more information to set it up using command files to switch between fixed and wlan connection (after you set up the connection with wpa_supplicant and obtaining ip)
viewtopic.php?f=4&t=1485&p=12798#p12793 and here viewtopic.php?f=4&t=1485&p=12798#p12795

some helpful commands
to check status
Code: Select all
wpa_cli status

To see which networks your dongle sees and get more info
Code: Select all
iwlist wlan0 scanning
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Wireless network?

Postby steean » Mon Mar 03, 2014 8:07 pm

Hey, thanks for the guide. I've been busy, but I WILL try this out as soon as I get the chance. I take it that the wired network connection is default on reboot..?
steean
 
Posts: 19
Joined: Mon Aug 22, 2011 4:49 pm

Re: Wireless network?

Postby steean » Mon Mar 03, 2014 8:36 pm

Hm. I tried out the first few steps, but can't get any further.. When I execute
Code: Select all
iwconfig

I get
Code: Select all
-sh: iwconfig: not found


also, when I execute

Code: Select all
ifconfig wlan0 up


I notice how it says

Code: Select all
Link encap:Ethernet


and I wonder if that's correct..
steean
 
Posts: 19
Joined: Mon Aug 22, 2011 4:49 pm

Re: Wireless network?

Postby fvdw » Mon Mar 03, 2014 9:00 pm

oops, my fault 15-1 is missing some files for wireless tools

attached a patch, you can upload it using the upload patch menu in the webinterface
put the zip file in the share with name "fvdw"
use as control code "unzip" (without the quotes) in the web interface upload file window
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Wireless network?

Postby steean » Sun Mar 09, 2014 5:48 pm

Ok, so I installed your patch and I was able to get my NAS connected to the router and acquire an IP-address. I was not able to reach any services via the wireless IP (ping, ssh, web-gui or shares). I didn't bring the Ethernet down, so maybe that's it...? Does fvdw only publish services through one interface at a time?
steean
 
Posts: 19
Joined: Mon Aug 22, 2011 4:49 pm

Re: Wireless network?

Postby matzi » Sat Mar 29, 2014 9:06 pm

I did all the steps again on my nwsp2 and ended just like steean.

You know that it worked for me with fvdw 14, but 15.1 seems to have problems. IP is assigned in the router but i cannot access the webinterface. There is a error message when calling udev with the simple script:

root@fvdwsl-base:/ # /etc/simple.script: line 1: can't open !DOCTYPE: no such file
> /etc/simple.script: line 1: html: not found
> /etc/simple.script: line 2: syntax error: unexpected newline
> Sending discover...
> Sending select for 192.168.178.35...
> Lease of 192.168.178.35 obtained, lease time 864000
> /etc/simple.script: line 1: can't open !DOCTYPE: no such file
-sh: /etc/simple.script:: not found
root@fvdwsl-base:/ # /etc/simple.script: line 1: html: not found
-sh: /etc/simple.script:: not found

I do not remember I had this message with fvdw 14. Has something changed there?
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Wireless network?

Postby fvdw » Sun Mar 30, 2014 3:00 pm

yes there are changes made to udev in version 15-1.

we will need to look at this
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Wireless network?

Postby fvdw » Sun Mar 30, 2014 5:22 pm

:scratch I can not reproduce your error

seems to work all normal
Code: Select all
root@nwsp2-5:/ # udhcpc -b -i wlan0 -q -s /etc/simple.script
udhcpc (v1.21.0) started
Sending discover...
Sending select for 192.168.1.33...
Lease of 192.168.1.33 obtained, lease time 86400
root@nwsp2-5:/ #


this nwsp2 is running 15-1 (with wireless tools patch)

but indeed the webinterface doesn't respond on the wlan ip

---edit
temporary you can solve it by giving this command (replace the ip by the actual one assigned by dhcp server)
Code: Select all
/sbin/ifconfig wlan0 192.168.1.33 netmask 255.255.255.0

now you can connect to webinterface using this ip
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Wireless network?

Postby matzi » Mon Mar 31, 2014 7:40 pm

Yep,
the workaround helps. After this IP assignement ifconfig shows the correct IP4 adress. Witout that only an IP6 us assigned from udhcpc. Why that? Could there be a mistake in simple.script

I attach the verbose output of udhcpc here:

root@fvdwsl-base:/ # /sbin/udhcpc -b -v -i wlan0 -q -s /etc/simple.script
Adapter index 8
MAC 00:0d:81:ac:5b:ad
udhcpc (v1.21.0) started
Executing /etc/simple.script deconfig
/etc/simple.script: line 1: can't open !DOCTYPE: no such file
/etc/simple.script: line 1: html: not found
/etc/simple.script: line 2: syntax error: unexpected newline
Entering listen mode: raw
Opening raw socket on ifindex 8
Got raw socket fd
Attached filter to raw socket fd
Created raw socket
Adapter index 8
MAC 00:0d:81:ac:5b:ad
Sending discover...
Waiting on select 3 seconds
Received a packet
Adapter index 8
MAC 00:0d:81:ac:5b:ad
Sending select for 192.168.178.35...
Waiting on select 3 seconds
Received a packet
Lease of 192.168.178.35 obtained, lease time 864000
Executing /etc/simple.script bound
/etc/simple.script: line 1: can't open !DOCTYPE: no such file
/etc/simple.script: line 1: html: not found
/etc/simple.script: line 2: syntax error: unexpected newline
Entering listen mode: none


Please note that I did not have simple.script in my installation after upgrade to 15.1. I had to pick it up from the other thread from dec. last year. Do you use a different simple.script now?
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Wireless network?

Postby fvdw » Mon Mar 31, 2014 8:04 pm

no I did not change the "simple.script"

I did not have time yet to look to this

but I do not get a message you mention
simple.script: line 1: can't open !DOCTYPE: no such file

the udhcp call works ok only the assigning of ip to the wlan0 interface doesn't happen
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

PreviousNext

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 5 guests