Access point as WiFi repeater with additional WiFi-dongleAccess point as WiFi repeater, optional with...

Computing the volume of a simplex-like object with constraints

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

How do we objectively assess if a dialogue sounds unnatural or cringy?

Paper published similar to PhD thesis

Create chunks from an array

Professor forcing me to attend a conference

Rationale to prefer local variables over instance variables?

Is every open circuit a capacitor?

Is it a Cyclops number? "Nobody" knows!

Remove object from array based on array of some property of that object

“I had a flat in the centre of town, but I didn’t like living there, so …”

I can't die. Who am I?

What is the meaning of option 'by' in TikZ Intersections

PTIJ: Aliyot for the deceased

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

What is the purpose of a disclaimer like "this is not legal advice"?

Learning to quickly identify valid fingering for piano?

Plagiarism of code by other PhD student

Where do you go through passport control when transiting through another Schengen airport on your way out of the Schengen area?

Under what conditions would I NOT add my Proficiency Bonus to a Spell Attack Roll (or Saving Throw DC)?

Naming Characters after Friends/Family

Can a Mimic (container form) actually hold loot?

The need of reserving one's ability in job interviews

Do natural melee weapons (from racial traits) trigger Improved Divine Smite?



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 wlan1RPi 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)













2















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?










share|improve this question



























    2















    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?










    share|improve this question

























      2












      2








      2








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      IngoIngo

      7,9192947




      7,9192947






















          1 Answer
          1






          active

          oldest

          votes


















          2














          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






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            2














            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






            share|improve this answer




























              2














              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






              share|improve this answer


























                2












                2








                2







                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






                share|improve this answer













                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 4 hours ago









                IngoIngo

                7,9192947




                7,9192947






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                    How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                    變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...