raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Nov 17, 2012 7:47 am

I´ll try with the channel. I also thought about bluetooth but it isn´t too easy to setup a bluetooth network on the android.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Nov 17, 2012 9:17 pm

didnt work out but I guess it is a problem with udhcpd

sudo ps ax | grep udhcpd:
2973 tty1 S+ 0:00 grep --color=auto udhcpd

I tried to remove wicd but it looks like it is immortal ;-)
apt-get remove wicd just just removed it from apt but it is still there in top and on startup.

However

I also get something similar to this:

udhcpd (v1.20.2) started
udhcpd: max_leases=235 is too big, setting to 19
udhcpd: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
udhcpd: is interface wlan0 up and configured?: Cannot assign requested address

wlan0 is up of course, my android already sees ot but it is the same
issue poing had:

"the phone either verifies and hangs on acquiring an IP address or hangs on verifying"

trying to get rid of wicd now


EDIT:

Okay somehow wicd isn´t anymore visible in top ... simply removed the binaries and configs ... not a clean way but what the hell...

Whatever, udhcpd still doesn´t like to run, log gives lot of entries of the above
"not found directory" message.

I wonder how to work with a fixed IP as I cannot set that on the android I think.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 18, 2012 9:31 am

I'd try a fresh Raspian install first, that way you'll know if it's an issue with your present install or a more basic thing.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 18, 2012 3:00 pm

nah... sure could do this but thats not the problem I think
I found out that on ifconfig my wlan0 shows up without any ip
thats obviously a problem but I couldn´t find out yet how to fix it...

etc/network/interfaces looks good to me

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 18, 2012 11:56 pm

raspbee wrote:nah... sure could do this but thats not the problem I think
I found out that on ifconfig my wlan0 shows up without any ip
thats obviously a problem but I couldn´t find out yet how to fix it...

etc/network/interfaces looks good to me
It's possible Wicd is still installed -- you have to uninstall several packages to get rid of it. Try:

Code: Select all

sudo apt-get remove --purge wicd python-wicd wicd-cli wicd-curses wicd-daemon wicd-gtk
The "--purge" option will remove all Wicd config files as well as the packages themselves. You will probably get several "Package (package) not installed, so not removed" messages. After apt-get finishes reboot and see if it works.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 9:34 am

- fresh SD written with Win32DiskImager
- Image: 2012-10-28-wheezy-raspbian.img

The raspberry pi is powered with a 2A 5V power supply
from an old IOMEGA zip drive, so the power should be enough.

A wireless mini-keyboard with touchpad from KeySonic ACK-340RF+
is used to control the raspberry. This is good but it good one serious bug.
You can´t type a } so it is always a bit tricky but I use to work remote with putty.

The WLAN device is made by LogiLink


once at first boot at the config menu:

- expand_rootfs
- keyboard layout (set to my required one)
- enable ssh
- start desktop on boot : no

connecting ETH0 cable

- update raspi config
- finish

now at prompt:

Code: Select all

[email protected] ~ $ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:26:00:85
          inet addr:192.168.2.22  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5813 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2840 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7818158 (7.4 MiB)  TX bytes:238088 (232.5 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)

wlan0     Link encap:Ethernet  HWaddr 7c:dd:90:17:a8:7d
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[email protected] ~ $ sudo lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 005: ID 0dc6:2301 Precision Squared Technology Corp. Wireless Touchpad Keyboard
now following the tutorial from http://elinux.org/RPI-Wireless-Hotspot:

Code: Select all

[email protected] ~ $ sudo apt-get install hostapd udhcpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  busybox
The following NEW packages will be installed:
  busybox hostapd udhcpd
0 upgraded, 3 newly installed, 0 to remove and 62 not upgraded.
Need to get 878 kB of archives.
After this operation, 1,751 kB of additional disk space will be used.
Do you want to continue [Y/n]?y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main busybox armhf 1:1.20.0-7 [438 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main hostapd armhf 1:1.0-3 [419 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main udhcpd armhf 1:1.20.0-7 [20.9 kB]
Fetched 878 kB in 3s (270 kB/s)
Selecting previously unselected package busybox.
(Reading database ... 57783 files and directories currently installed.)
Unpacking busybox (from .../busybox_1%3a1.20.0-7_armhf.deb) ...
Selecting previously unselected package hostapd.
Unpacking hostapd (from .../hostapd_1%3a1.0-3_armhf.deb) ...
Selecting previously unselected package udhcpd.
Unpacking udhcpd (from .../udhcpd_1%3a1.20.0-7_armhf.deb) ...
Processing triggers for man-db ...
Setting up busybox (1:1.20.0-7) ...
Setting up hostapd (1:1.0-3) ...
Setting up udhcpd (1:1.20.0-7) ...
udhcpd: Disabled. Edit /etc/default/udhcpd to enable it.

[email protected] ~ $ sudo nano /etc/udhcpd.conf
cleared the file and copied this in:

start 192.168.2.2 # This is the range of IPs that the hostspot will give to client devices.
end 192.168.2.20
interface wlan0 # The device uDHCP listens on.
remaining yes
opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
opt subnet 255.255.255.0
opt router 192.168.2.1 # The Pi's IP address on wlan0 which we will set up shortly.
opt lease 864000 # 10 day DHCP lease time in seconds


now enabling DHCPD:

Code: Select all

[email protected] ~ $ sudo nano /etc/default/udhcpd
DHCPD_ENABLED="no"
to
#DHCPD_ENABLED="no"

Code: Select all

[email protected] ~ $ sudo ifconfig wlan0 192.168.2.1
[email protected] ~ $ sudo nano /etc/network/interfaces
change the file to this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0

#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp


EDIT: ATTENTION! I MADE A TYPO HERE THAT CAUSED TROUBLES BELOW. IF YOU DO IT THE RIGHT WAY EVERYTHING SHOULD WORK PERFECT!

WRONG:

Code: Select all

[email protected] ~ $ sudo nano /etc/hostapd/hpstapd.conf
CORRECT:

Code: Select all

[email protected] ~ $ sudo nano /etc/hostapd/hostapd.conf
doesn´t exist so needs to be created:

interface=wlan0
driver=nl80211
ssid=Raspbee
hw_mode=g
channel=4
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I know the passphrase isn´t safe but that doesn´t matter at this moment.

Code: Select all

[email protected] ~ $ sudo nano /etc/default/hostapd
#DAEMON_CONF=""
to:
DAEMON_CONF="/etc/hostapd/hostapd.conf"

Code: Select all

[email protected] ~ $ sudo nano /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

Code: Select all

[email protected] ~ $ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[email protected] ~ $ sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
[email protected] ~ $ sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

[email protected] ~ $ sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

[email protected] ~ $ sudo nano /etc/network/interfaces
adding
up iptables-restore < /etc/iptables.ipv4.nat

Code: Select all

[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!
[email protected] ~ $ sudo service udhcpd start
Starting very small Busybox based DHCP server: Starting /usr/sbin/udhcpd...
udhcpd.

[email protected] ~ $ sudo update-rc.d hostapd enable
update-rc.d: using dependency based boot sequencing
[email protected] ~ $ sudo update-rc.d udhcpd enable
update-rc.d: using dependency based boot sequencing


[email protected] ~ $ sudo shutdown -r now
at boot sequence:

Code: Select all

[ ok ] Network interface Plugging Daemon...skip eth0...skip wlan0...done.
[FAIL] Startin advanced IEEE 802.11 management: hostapd failed!
[...]
[ ok ] Starting NTP server: ntpd.
Starting very small Busybox based DHCP server: Starting /usr/sbin/udhcpd...
udhcpd.
and from var/log/syslog:

Code: Select all

[...]
Nov 19 09:17:19 raspberrypi ntpd[4216]: ntpd [email protected] Fri May 18 20:30:57 UTC 2012 (1)
Nov 19 09:17:20 raspberrypi ntpd[4219]: proto: precision = 2.000 usec
Nov 19 09:17:20 raspberrypi ntpd[4219]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Nov 19 09:17:20 raspberrypi ntpd[4219]: Listen normally on 1 lo 127.0.0.1 UDP 123
Nov 19 09:17:20 raspberrypi ntpd[4219]: Listen normally on 2 eth0 192.168.2.22 UDP 123
Nov 19 09:17:20 raspberrypi ntpd[4219]: peers refreshed
Nov 19 09:17:20 raspberrypi ntpd[4219]: Listening on routing socket on fd #19 for interface updates
Nov 19 09:17:20 raspberrypi ntpd[4219]: restrict: error in address '::' on line 38. Ignoring...
Nov 19 09:17:20 raspberrypi ntpd[4219]: restrict: error in address '::1' on line 42. Ignoring...
Nov 19 09:17:20 raspberrypi udhcpd[4245]: udhcpd (v1.20.2) started
Nov 19 09:17:20 raspberrypi udhcpd[4245]: max_leases=235 is too big, setting to 19
Nov 19 09:17:20 raspberrypi udhcpd[4245]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 19 09:17:20 raspberrypi udhcpd[4245]: is interface wlan0 up and configured?: Cannot assign requested address
Nov 19 09:23:05 raspberrypi dbus[4167]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Nov 19 09:23:05 raspberrypi dbus[4167]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Nov 19 09:23:06 raspberrypi polkitd[4359]: started daemon version 0.105 using authority implementation `local' version `0.105'
Nov 19 09:23:06 raspberrypi dbus[4167]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Nov 19 09:23:06 raspberrypi dbus[4167]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'


[email protected] ~ $ ps -aux

root      3926  0.0  1.0   4884  2000 ?        Ss   09:17   0:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases e
ntp       4219  0.0  0.7   5500  1496 ?        Ss   09:17   0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 102:104


[email protected] /var/log $ sudo cat /var/log/syslog | grep "hostapd\|udhcpd"
Nov 19 09:13:06 raspberrypi udhcpd[3461]: udhcpd (v1.20.2) started
Nov 19 09:13:06 raspberrypi udhcpd[3461]: max_leases=235 is too big, setting to 19
Nov 19 09:13:06 raspberrypi udhcpd[3461]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 19 09:14:17 raspberrypi udhcpd[3461]: Received SIGTERM
Nov 19 09:17:20 raspberrypi udhcpd[4245]: udhcpd (v1.20.2) started
Nov 19 09:17:20 raspberrypi udhcpd[4245]: max_leases=235 is too big, setting to 19
Nov 19 09:17:20 raspberrypi udhcpd[4245]: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
Nov 19 09:17:20 raspberrypi udhcpd[4245]: is interface wlan0 up and configured?: Cannot assign requested address

[email protected] /var/log $ sudo service hostapd status
[FAIL] hostapd is not running ... failed!

[email protected] /var/log $ ps ax | grep udhcpd
 4434 pts/0    S+     0:00 grep --color=auto udhcpd
Last edited by raspbee on Mon Nov 19, 2012 9:59 am, edited 2 times in total.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 9:49 am

ahh me stupid, found a typo.... hope thats the problem

[email protected] ~ $ sudo nano /etc/hostapd/hpstapd.conf

should be

[email protected] ~ $ sudo nano /etc/hostapd/hostapd.conf

EDIT: YES IT WORKS! YEHAWWW!

This is just too cool. Now just some minor steps and I can control the raspberry pi from the mobile.

Thanks again for this tutorial!
Conclusion, my suggestion too for anyone who wants the same... create a fresh SD.
Success makes believers ;-)

I fix the typo above so noone gets confused by that post.

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 12:29 pm

could someone PLEASE answer this simple question..
I got the "hotspot" working .. then it didn't work after I shutdown and started up the pi.
reboot was ok...
what I discovered was that /etc/network/interfaces had to be changed in order for the
system to reread it?? and then I would get my fixed address asigned to wlan0! then I
could use it... what am I missing here???
Or maybe the question should be how can I make sure that wlan0 has an assigned fixed address
I got it down to simply sudo touch /etc/network/interfaces
does it have something to do with the fact that the clock is not functional because I
am "offline"?? this "hotspot" is more like an island..
sudo ifup wlan0 >> gives me "already configured"
then
sudo ifdown wlan0
and
sudo ifup wlan0
we are good to go ...
again I think in my case I need a way to have the system force a reread of the interfaces file..
thanks...

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 5:41 pm

maybe conflicting with eth0 ?

I just encountered that my ssh didn´t work anymore so
I switched the eth0 to static 192.168.2.75
and the wlan0 to 192.168.3.

now both works

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 5:50 pm

raspbee wrote:maybe conflicting with eth0 ?

I just encountered that my ssh didn´t work anymore so
I switched the eth0 to static 192.168.2.75
and the wlan0 to 192.168.3.

now both works
That's likely the issue, probably a routing conflict of some sort. I might change the tutorial to use a less common IP address range.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 6:44 pm

I am now trying to access this raspberry by its name but this doesn´t work
I thought thats defined in

/etc/hosts
and
/etc/hostname

but thats obviously not all
hmm yes... DNS... forgot about that

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 6:49 pm

raspbee wrote:I am now trying to access this raspberry by its name but this doesn´t work
I thought thats defined in

/etc/hosts
and
/etc/hostname

but thats obviously not all
hmm yes... DNS... forgot about that
You can try using mDNS (aka Bonjour). For example, if your Pi's hostname is berry, try using berry.local as the hostname. The ".local" will be interpreted as an mDNS address and will be searched for. Some distros will do this be default, others need to be configured.

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 9:51 pm

Hi,
I got lost! For some reasons I can see the AP from my iPad, but I can't connect, the iPad does not get a IP-Address.

So I'm wondering how to setup my eth0 and my wlan0 addresses. My LAN is configured like this:
192.168.2.0/24, router and DNS are on .1, router also runs DHCP for LAN.

So how should my /etc/network/interfaces look like? And what are the DHCP settings in hostapd?

Thanks for your help!
truehl
http://www.squeezeplug.de

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Nov 19, 2012 11:34 pm

The addresses for the AP are listed as 192.168.2.x in the tutorial. If you LAN already uses 192.168.2.x then you should replace something like 192.168.3.x for everything listed as 192.168.2.x in the tutorial.

raspbee
Posts: 40
Joined: Tue Sep 25, 2012 1:25 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Tue Nov 20, 2012 8:37 am

@truehl

This pretty much looks like the same problem I had.
If you have a network manager installed get rid of it... if this doesn´t help try with a fresh SD as I finally did with success.

@hunternet93

I´ll give it a try.

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Tue Nov 20, 2012 1:05 pm

I've changed the tutorial to use the 192.168.42.x range, which should stop the IP conflicts.

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Tue Nov 20, 2012 9:00 pm

Success at last!

I followed the tutorial and now it works! My false was that I did not use different network addresses for LAN and WLAN. Now with different IP ranges it works fine!

One thing I had to change was, I had to add a "auto wlan0" in /etc/network/interfaces. Without this wlan0 did not get an IP-address and nothing worked!

Thanks a lot to all involved, I'll add a function in my SqueezePlug project!
truehl
http://www.squeezeplug.de

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Nov 21, 2012 1:34 am

Glad to see it is working for you ..
I put the auto wlan0 in my interfaces file .. but
my installation is not consistent .. sometimes it works and
sometimes it doesn't .. by careful examination of the log
i found that for some reason when it fails I don't
get Starting DSN forwarder and DHCP server: dnsmasq message..
so I guess my question is why would this run sometimes and not others?
I am @ raspian 3.2.27 oct 18 2012 with version 346337 firmware .. should
I put on the 70 fixes??
I am trying this from a power off state .. the ethernet is NOT plugged in

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Nov 21, 2012 12:30 pm

Something is still not optimal.

I have a Samsung Nexus S Android phone and a Sony PRS-T2 E-Reader. They both connect without problems to my Linksys router over WiFi. The Android phone connects without problems to the Pi in about a second, but the E-Reader needs about a minute and sometimes several tries to connect. Sadly it's the E-Reader I want to use for my embedded project, as it has great visibility in sunlight and has a battery life of several days with constant use.

So there's somehow a difference between the functionality between Linksys router and the Pi with the Ralink RT5370 chip. This is not with the 2012-10-28 distro btw but with the specialized web distro. So I'll check the official distro again later today.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Nov 21, 2012 3:44 pm

Never mind, found the problem.

During all the testing, using two Pies and two dongles, the E-Reader registered "My_AP_Name" twice in the list of saved APs. Apparently when connecting it got confused. Removing the oldest entry solved the problem.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 3:33 pm

I followed the instructions. But i get


[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!

the /etc/network/interfaces is the following:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 3:38 pm

Piminiuser wrote:I followed the instructions. But i get


[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!

the /etc/network/interfaces is the following:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
Try to place a "auto wlan0" and a "auto eth0" on top of each interface line! That works for me!
truehl
http://www.squeezeplug.de

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 3:55 pm

truehl wrote:
Piminiuser wrote:I followed the instructions. But i get


[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!

the /etc/network/interfaces is the following:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
Try to place a "auto wlan0" and a "auto eth0" on top of each interface line! That works for me!
like this?

Code: Select all

auto lo
auto wlan0
auto eth0

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat


User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 4:06 pm

Piminiuser wrote:
truehl wrote:
Piminiuser wrote:I followed the instructions. But i get


[email protected] ~ $ sudo service hostapd start
[FAIL] Starting advanced IEEE 802.11 management: hostapd failed!

the /etc/network/interfaces is the following:

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
Try to place a "auto wlan0" and a "auto eth0" on top of each interface line! That works for me!
like this?

Code: Select all

auto lo
auto wlan0
auto eth0

iface lo inet loopback
iface eth0 inet dhcp

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat

No

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
truehl
http://www.squeezeplug.de

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 22, 2012 5:16 pm

copy past the txt. but still error when starting.

my /etc/udhcpd.conf looks like this:

Code: Select all


start 192.168.42.2 # This is the range of IPs that the hostspot will give to cl$
end 192.168.42.20
interface wlan0 # The device uDHCP listens on.
remaining yes
opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
opt subnet 255.255.255.0
opt router 192.168.42.1 # The Pi's IP address on wlan0 which we will set up sho$
opt lease 864000 # 10 day DHCP lease time in seconds
Is this good or wrong? Or is the best way start clean again? And how to do this? I have a openVPN installed on my pi, so i dont want to write a new clean image on the sd card.

Return to “Networking and servers”