Access point as WiFi repeater with additional WiFi-dongleAccess point as WiFi repeater, optional with bridgeHowto migrate from networking to systemd-networkd with dynamic failoverRPI3 Raspbian Stretch regular connection on wlan0 AP on wlan1Wifi Repeater – Set Interface down by Default (dhcpcd)Wireless connecting of PIsAccess raspberry pi files through Samba or web browser without a routerhostapd accesspoint with connmanWiFi dongle need to be re-inserted after every restartHow to setup an acces point on 8812au driver using systemd networking?RPi as WIFI Access Point and VPN routerPi as WiFi RepeaterWifi access point works but not when roaming between networks of the same SSIDEthernet Blocks Internet of Wifi Access PointRaspberry Pi Zero W as a WiFi repeaterSetting up a Raspberry Pi as an access point - the easy wayPi Zero W Wifi repeater with OpenVPNMake wifi onboard as an access point and wifi dongle as a clientRPI wifi repeater - slow internet speedWifi Repeater – Set Interface down by Default (dhcpcd)
Can I make popcorn with any corn?
Do VLANs within a subnet need to have their own subnet for router on a stick?
Have astronauts in space suits ever taken selfies? If so, how?
What are these boxed doors outside store fronts in New York?
Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
Do I have a twin with permutated remainders?
Did Shadowfax go to Valinor?
Which models of the Boeing 737 are still in production?
Approximately how much travel time was saved by the opening of the Suez Canal in 1869?
Font hinting is lost in Chrome-like browsers (for some languages )
Test whether all array elements are factors of a number
How could an uplifted falcon's brain work?
Why dont electromagnetic waves interact with each other?
Can divisibility rules for digits be generalized to sum of digits
Why are electrically insulating heatsinks so rare? Is it just cost?
How to test if a transaction is standard without spending real money?
An academic/student plagiarism
What do you call a Matrix-like slowdown and camera movement effect?
Writing rule stating superpower from different root cause is bad writing
What does it mean to describe someone as a butt steak?
Python: next in for loop
Is it legal for company to use my work email to pretend I still work there?
Example of a continuous function that don't have a continuous extension
Access point as WiFi repeater with additional WiFi-dongle
Access point as WiFi repeater, optional with bridgeHowto migrate from networking to systemd-networkd with dynamic failoverRPI3 Raspbian Stretch regular connection on wlan0 AP on wlan1Wifi Repeater – Set Interface down by Default (dhcpcd)Wireless connecting of PIsAccess raspberry pi files through Samba or web browser without a routerhostapd accesspoint with connmanWiFi dongle need to be re-inserted after every restartHow to setup an acces point on 8812au driver using systemd networking?RPi as WIFI Access Point and VPN routerPi as WiFi RepeaterWifi access point works but not when roaming between networks of the same SSIDEthernet Blocks Internet of Wifi Access PointRaspberry Pi Zero W as a WiFi repeaterSetting up a Raspberry Pi as an access point - the easy wayPi Zero W Wifi repeater with OpenVPNMake wifi onboard as an access point and wifi dongle as a clientRPI wifi repeater - slow internet speedWifi Repeater – Set Interface down by Default (dhcpcd)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
There are some tutorials to make an access point a WiFi repeater using only the on-board WiFi chip of a Raspberry Pi. But I want to use an additional USB/WiFi dongle as second interface for the up-link to an internet router, in the hope it would simplify the configuration and avoid the limitations of the single interface solution.
How can I setup an access point as WiFi repeater using an additional USB/WiFi dongle?
wifi raspbian-stretch access-point
add a comment |
There are some tutorials to make an access point a WiFi repeater using only the on-board WiFi chip of a Raspberry Pi. But I want to use an additional USB/WiFi dongle as second interface for the up-link to an internet router, in the hope it would simplify the configuration and avoid the limitations of the single interface solution.
How can I setup an access point as WiFi repeater using an additional USB/WiFi dongle?
wifi raspbian-stretch access-point
add a comment |
There are some tutorials to make an access point a WiFi repeater using only the on-board WiFi chip of a Raspberry Pi. But I want to use an additional USB/WiFi dongle as second interface for the up-link to an internet router, in the hope it would simplify the configuration and avoid the limitations of the single interface solution.
How can I setup an access point as WiFi repeater using an additional USB/WiFi dongle?
wifi raspbian-stretch access-point
There are some tutorials to make an access point a WiFi repeater using only the on-board WiFi chip of a Raspberry Pi. But I want to use an additional USB/WiFi dongle as second interface for the up-link to an internet router, in the hope it would simplify the configuration and avoid the limitations of the single interface solution.
How can I setup an access point as WiFi repeater using an additional USB/WiFi dongle?
wifi raspbian-stretch access-point
wifi raspbian-stretch access-point
asked Mar 7 at 23:21
IngoIngo
8,9942950
8,9942950
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It is known that the Raspberry Pi can spawn an access point and connect as client to another wifi network simultaneously with its on board wifi chip. How to do that you can look at Access point as WiFi repeater, optional with bridge.
But using a second USB/WiFi dongle is simpler and depending on its hardware it may be possible to avoid the limitations of the single interface solution. With systemd-networkd and wpa_supplicant we have everything on the Raspberry Pi to setup what we want. There is no need to install additional software and fiddle with hostapd and dnsmasq. You have to switch to systemd-networkd and then simply set up wpa_supplicant one time for wlan0 as access point and one time for wlan1 as client. Then configure the interfaces and it's done. For reference I use Raspbian Stretch Lite 2018-11-13 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
done at 2019-03-07.
Enable systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# install helper
rpi ~$ sudo -Es
rpi ~# apt install rng-tools
# disable classic networking
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Configure wpa_supplicant for wlan0 as access point
To configure wpa_supplicant create these files with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable wpa_supplicant@wlan0.service
Configure wpa_supplicant for wlan1 as client
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="wlan@hoeft-online.de"
psk="anotherSecretPassword"
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl enable wpa_supplicant@wlan1.service
For the connection to the internet router we use network address translation (NAT). To setup it we extend the service for wlan1 with:
rpi ~# systemctl edit wpa_supplicant@wlan1.service
In the empty editor insert these statements, save them and quit the editor:
[Service]
ExecStartPre=/sbin/iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
ExecStopPost=-/sbin/iptables -t nat -D POSTROUTING -o wlan1 -j MASQUERADE
Configure interfaces
Create these two files:
rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 84.200.70.40
EOF
Because we don't have a bridge, we need two different subnets. Be aware that the static ip address for the access point wlan0 belongs to another subnet than that from wlan1.
rpi ~# cat > /etc/systemd/network/12-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF
Reboot.
That's it.
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "447"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f95072%2faccess-point-as-wifi-repeater-with-additional-wifi-dongle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It is known that the Raspberry Pi can spawn an access point and connect as client to another wifi network simultaneously with its on board wifi chip. How to do that you can look at Access point as WiFi repeater, optional with bridge.
But using a second USB/WiFi dongle is simpler and depending on its hardware it may be possible to avoid the limitations of the single interface solution. With systemd-networkd and wpa_supplicant we have everything on the Raspberry Pi to setup what we want. There is no need to install additional software and fiddle with hostapd and dnsmasq. You have to switch to systemd-networkd and then simply set up wpa_supplicant one time for wlan0 as access point and one time for wlan1 as client. Then configure the interfaces and it's done. For reference I use Raspbian Stretch Lite 2018-11-13 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
done at 2019-03-07.
Enable systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# install helper
rpi ~$ sudo -Es
rpi ~# apt install rng-tools
# disable classic networking
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Configure wpa_supplicant for wlan0 as access point
To configure wpa_supplicant create these files with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable wpa_supplicant@wlan0.service
Configure wpa_supplicant for wlan1 as client
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="wlan@hoeft-online.de"
psk="anotherSecretPassword"
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl enable wpa_supplicant@wlan1.service
For the connection to the internet router we use network address translation (NAT). To setup it we extend the service for wlan1 with:
rpi ~# systemctl edit wpa_supplicant@wlan1.service
In the empty editor insert these statements, save them and quit the editor:
[Service]
ExecStartPre=/sbin/iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
ExecStopPost=-/sbin/iptables -t nat -D POSTROUTING -o wlan1 -j MASQUERADE
Configure interfaces
Create these two files:
rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 84.200.70.40
EOF
Because we don't have a bridge, we need two different subnets. Be aware that the static ip address for the access point wlan0 belongs to another subnet than that from wlan1.
rpi ~# cat > /etc/systemd/network/12-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF
Reboot.
That's it.
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
add a comment |
It is known that the Raspberry Pi can spawn an access point and connect as client to another wifi network simultaneously with its on board wifi chip. How to do that you can look at Access point as WiFi repeater, optional with bridge.
But using a second USB/WiFi dongle is simpler and depending on its hardware it may be possible to avoid the limitations of the single interface solution. With systemd-networkd and wpa_supplicant we have everything on the Raspberry Pi to setup what we want. There is no need to install additional software and fiddle with hostapd and dnsmasq. You have to switch to systemd-networkd and then simply set up wpa_supplicant one time for wlan0 as access point and one time for wlan1 as client. Then configure the interfaces and it's done. For reference I use Raspbian Stretch Lite 2018-11-13 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
done at 2019-03-07.
Enable systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# install helper
rpi ~$ sudo -Es
rpi ~# apt install rng-tools
# disable classic networking
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Configure wpa_supplicant for wlan0 as access point
To configure wpa_supplicant create these files with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable wpa_supplicant@wlan0.service
Configure wpa_supplicant for wlan1 as client
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="wlan@hoeft-online.de"
psk="anotherSecretPassword"
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl enable wpa_supplicant@wlan1.service
For the connection to the internet router we use network address translation (NAT). To setup it we extend the service for wlan1 with:
rpi ~# systemctl edit wpa_supplicant@wlan1.service
In the empty editor insert these statements, save them and quit the editor:
[Service]
ExecStartPre=/sbin/iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
ExecStopPost=-/sbin/iptables -t nat -D POSTROUTING -o wlan1 -j MASQUERADE
Configure interfaces
Create these two files:
rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 84.200.70.40
EOF
Because we don't have a bridge, we need two different subnets. Be aware that the static ip address for the access point wlan0 belongs to another subnet than that from wlan1.
rpi ~# cat > /etc/systemd/network/12-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF
Reboot.
That's it.
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
add a comment |
It is known that the Raspberry Pi can spawn an access point and connect as client to another wifi network simultaneously with its on board wifi chip. How to do that you can look at Access point as WiFi repeater, optional with bridge.
But using a second USB/WiFi dongle is simpler and depending on its hardware it may be possible to avoid the limitations of the single interface solution. With systemd-networkd and wpa_supplicant we have everything on the Raspberry Pi to setup what we want. There is no need to install additional software and fiddle with hostapd and dnsmasq. You have to switch to systemd-networkd and then simply set up wpa_supplicant one time for wlan0 as access point and one time for wlan1 as client. Then configure the interfaces and it's done. For reference I use Raspbian Stretch Lite 2018-11-13 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
done at 2019-03-07.
Enable systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# install helper
rpi ~$ sudo -Es
rpi ~# apt install rng-tools
# disable classic networking
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Configure wpa_supplicant for wlan0 as access point
To configure wpa_supplicant create these files with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable wpa_supplicant@wlan0.service
Configure wpa_supplicant for wlan1 as client
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="wlan@hoeft-online.de"
psk="anotherSecretPassword"
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl enable wpa_supplicant@wlan1.service
For the connection to the internet router we use network address translation (NAT). To setup it we extend the service for wlan1 with:
rpi ~# systemctl edit wpa_supplicant@wlan1.service
In the empty editor insert these statements, save them and quit the editor:
[Service]
ExecStartPre=/sbin/iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
ExecStopPost=-/sbin/iptables -t nat -D POSTROUTING -o wlan1 -j MASQUERADE
Configure interfaces
Create these two files:
rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 84.200.70.40
EOF
Because we don't have a bridge, we need two different subnets. Be aware that the static ip address for the access point wlan0 belongs to another subnet than that from wlan1.
rpi ~# cat > /etc/systemd/network/12-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF
Reboot.
That's it.
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
It is known that the Raspberry Pi can spawn an access point and connect as client to another wifi network simultaneously with its on board wifi chip. How to do that you can look at Access point as WiFi repeater, optional with bridge.
But using a second USB/WiFi dongle is simpler and depending on its hardware it may be possible to avoid the limitations of the single interface solution. With systemd-networkd and wpa_supplicant we have everything on the Raspberry Pi to setup what we want. There is no need to install additional software and fiddle with hostapd and dnsmasq. You have to switch to systemd-networkd and then simply set up wpa_supplicant one time for wlan0 as access point and one time for wlan1 as client. Then configure the interfaces and it's done. For reference I use Raspbian Stretch Lite 2018-11-13 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
done at 2019-03-07.
Enable systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# install helper
rpi ~$ sudo -Es
rpi ~# apt install rng-tools
# disable classic networking
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Configure wpa_supplicant for wlan0 as access point
To configure wpa_supplicant create these files with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable wpa_supplicant@wlan0.service
Configure wpa_supplicant for wlan1 as client
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="wlan@hoeft-online.de"
psk="anotherSecretPassword"
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl enable wpa_supplicant@wlan1.service
For the connection to the internet router we use network address translation (NAT). To setup it we extend the service for wlan1 with:
rpi ~# systemctl edit wpa_supplicant@wlan1.service
In the empty editor insert these statements, save them and quit the editor:
[Service]
ExecStartPre=/sbin/iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
ExecStopPost=-/sbin/iptables -t nat -D POSTROUTING -o wlan1 -j MASQUERADE
Configure interfaces
Create these two files:
rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 84.200.70.40
EOF
Because we don't have a bridge, we need two different subnets. Be aware that the static ip address for the access point wlan0 belongs to another subnet than that from wlan1.
rpi ~# cat > /etc/systemd/network/12-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF
Reboot.
That's it.
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
answered Mar 7 at 23:21
IngoIngo
8,9942950
8,9942950
add a comment |
add a comment |
Thanks for contributing an answer to Raspberry Pi Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f95072%2faccess-point-as-wifi-repeater-with-additional-wifi-dongle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown