Jan 102013
 

So a few people have tried to follow Part 3 of this series of posts, and had issues with the connections once everything is setup.
The main cause for that, was that hostapd would take away the IP address of wlan0 for some reason.
I worked around it by modifying the /etc/init.d/hostapd startup file.

In that file, there is a switch case statement which controls what the file does depending on how you run the file.

The example below is what you will see part way down the file. What we need to do is add in some commands into that block of code.

case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE" -- $DAEMON_OPTS >/dev/null
log_end_msg "$?"
;;
stop)

The command we will need to add are :
ifup wlan0

Which brings up wlan0 with the specified IP address. The IP address should have been setup in Part 3 of this series.

So the above block of code will now become –

case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE" -- $DAEMON_OPTS >/dev/null
log_end_msg "$?"
ifup wlan0
;;
stop)

This will force wlan0 to come up after hostapd is started.

Alternatively to force wlan0 to use an ip.address, replace ifup wlan0 with this
ifconfig wlan0 10.0.0.1 netmask 255.255.255.0 up
Hopefully this helps everyone when they come to making their Pi a WiFi Router ! 😀

Share

  One Response to “How To : Use The Raspberry Pi As A Wireless Access Point/Router Part 3…A!”

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)