From charlesreid1

(Created page with "Making the Raspberry Pi into a wireless router Following http://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/ =instructions= ==installing software== fir...")
 
Line 61: Line 61:
}
}
</pre>
</pre>
==isc dhcp server config==
we just set some general, system-wide dhcp settings, so now we set things specific to the isc-dhcp-server software we'll be using to create a dhcp server.
edit the file <code>/etc/default/isc-dhcp-server</code>
change the following line:
<pre>
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#      Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="wlan0"
</pre>
==static ip in network config==
finally, edit the network configuration for the pi to give it a static ip address (since it will be defining its own private network, it hands out its own ip addresses, so it needs an address.)
start by taking your wireless card down:
<pre>
$ ifconfig wlan0 down
</pre>
now edit the file <code>/etc/network/interfaces</code> and add:
<pre>
iface wlan0 inet static
    address 192.168.10.1
    netmask 255.255.255.0
</pre>





Revision as of 23:27, 4 March 2016

Making the Raspberry Pi into a wireless router

Following http://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/

instructions

installing software

first install a daemon for taking care of access point and authentication server details:

$ apt-get install hostapd

then install a dhcp server:

$ apt-get install isc-dhcp-server

dhcp config

edit the file /etc/dhcp/dhcp.conf:

remove the lines

# ------------------------------------
# option definitions common to all supported networks...
##### option domain-name "example.org";
##### option domain-name-servers ns1.example.org, ns2.example.org;
# ------------------------------------

change the line:

# ------------------------------------
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# ------------------------------------

add the lines:

# http://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/
# Next we need to define the network and network addresses
# that the DHCP server will be serving. This is done by adding
# the following block of configuration to the end of file:

subnet 192.168.10.0 netmask 255.255.255.0 {
    range 192.168.10.10 192.168.10.20;
    option broadcast-address 192.168.10.255;
    option routers 192.168.10.1;
    default-lease-time 600;
    max-lease-time 7200;
    option domain-name "local-network";
    option domain-name-servers 8.8.8.8, 8.8.4.4;
}

isc dhcp server config

we just set some general, system-wide dhcp settings, so now we set things specific to the isc-dhcp-server software we'll be using to create a dhcp server.

edit the file /etc/default/isc-dhcp-server

change the following line:

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="wlan0"

static ip in network config

finally, edit the network configuration for the pi to give it a static ip address (since it will be defining its own private network, it hands out its own ip addresses, so it needs an address.)

start by taking your wireless card down:

$ ifconfig wlan0 down

now edit the file /etc/network/interfaces and add:

iface wlan0 inet static
    address 192.168.10.1
    netmask 255.255.255.0