Ubuntu/Bespin/Wifi Repeater: Difference between revisions
From charlesreid1
(Created page with "The goal of this writeup was to have two wifi interfaces for Bespin: * One wifi card to give it an IP on the home network * One wifi card to run a wifi repeater We could prob...") |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
The goal of this writeup was to have two wifi interfaces for Bespin: | The goal of this writeup was to have two wifi interfaces for Bespin: one to connect to the home network, and the other to run a repeater for the home network. We could probably do both functions with one network card, but I'm sick of dealing with dumb wifi issues. I just want something working. | ||
Here is the setup: | |||
* <code>wlan0</code> is the wifi device that connects to the home network (192.168.0.x) | |||
* <code>wlan1</code> is the wifi device that runs a hostapd wifi network with same auth info and IP space as the original router | |||
* <code>br0</code> bridges <code>wlan0</code> and <code>wlan1</code> so that devices on both wifi networks can talk to each other | |||
Make sure hostapd is installed, then install bridge utils: | |||
<pre> | |||
sudo aptitude install hostapd bridge-utils | |||
</pre> | |||
Set the hostapd configuration file: | |||
<code>/etc/default/hostapd</code> | |||
<pre> | |||
DAEMON_CONF="/etc/hostapd/hostapd.conf" | |||
</pre> | |||
Create the hostapd config file, and set up an SSID and passphrase that match the home network (not necessary, but allows clients to connect to whatever access point is the strongest automatically): | |||
<code>/etc/hostapd/hostapd.conf</code> | |||
<pre> | |||
# Set this to wlan0 if you are using an ethernet cable | |||
# to connect your Pi to the internet | |||
interface=wlan1 | |||
driver=nl80211 | |||
hw_mode=g | |||
channel=1 | |||
macaddr_acl=0 | |||
ignore_broadcast_ssid=0 | |||
ssid=home_network | |||
wpa_passphrase=same_passphrase_as_home_network | |||
auth_algs=1 | |||
wpa=3 | |||
wpa_key_mgmt=WPA-PSK | |||
wpa_pairwise=TKIP | |||
rsn_pairwise=CCMP | |||
</pre> | |||
Now configure the bridge in the network interfaces file: | |||
<code>/etc/network/interfaces</code> | |||
<pre> | |||
auto br0 | |||
iface br0 inet static | |||
address 192.168.0.x | |||
netmask 255.255.255.0 | |||
network 192.168.0.0 | |||
broadcast 192.168.1.255 | |||
gateway 192.168.0.1 | |||
bridge-ports wlan0 wlan1 | |||
</pre> | |||
Now you can start the hostapd service: | |||
<pre> | |||
sudo service hostapd start | |||
</pre> | |||
[[Category:Ubuntu]] | [[Category:Ubuntu]] | ||
[[Category:Bespin]] | [[Category:Bespin]] | ||
[[Category: | [[Category:Machine]] | ||
[[Category: | [[Category:Wireless]] | ||
Latest revision as of 00:59, 2 August 2020
The goal of this writeup was to have two wifi interfaces for Bespin: one to connect to the home network, and the other to run a repeater for the home network. We could probably do both functions with one network card, but I'm sick of dealing with dumb wifi issues. I just want something working.
Here is the setup:
wlan0is the wifi device that connects to the home network (192.168.0.x)wlan1is the wifi device that runs a hostapd wifi network with same auth info and IP space as the original routerbr0bridgeswlan0andwlan1so that devices on both wifi networks can talk to each other
Make sure hostapd is installed, then install bridge utils:
sudo aptitude install hostapd bridge-utils
Set the hostapd configuration file:
/etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Create the hostapd config file, and set up an SSID and passphrase that match the home network (not necessary, but allows clients to connect to whatever access point is the strongest automatically):
/etc/hostapd/hostapd.conf
# Set this to wlan0 if you are using an ethernet cable # to connect your Pi to the internet interface=wlan1 driver=nl80211 hw_mode=g channel=1 macaddr_acl=0 ignore_broadcast_ssid=0 ssid=home_network wpa_passphrase=same_passphrase_as_home_network auth_algs=1 wpa=3 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
Now configure the bridge in the network interfaces file:
/etc/network/interfaces
auto br0
iface br0 inet static
address 192.168.0.x
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.1.255
gateway 192.168.0.1
bridge-ports wlan0 wlan1
Now you can start the hostapd service:
sudo service hostapd start