OpenWrt can't acces host in Lan

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have managed to configure an old router (linksys WRT160NL) as a wifi client using OpenWrt 17.01.4 to connect my raspberry pi to my network and have internet. The configuration is as follows



Main router is at 192.168.0.1 (wan).



Raspberry is at 192.168.1.222 (lan), connected via cable to the OpenWrt router which I can access with 192.168.1.1 or 192.168.0.30 from my main pc.



But I can't connect to my raspberry from my main pc on wan. My configs are



/etc/config/firewall: https://pastebin.com/NUgCsnUQ



/etc/config/network: https://pastebin.com/pCRsaAWs



I followed this guide.







share|improve this question


























    up vote
    0
    down vote

    favorite












    I have managed to configure an old router (linksys WRT160NL) as a wifi client using OpenWrt 17.01.4 to connect my raspberry pi to my network and have internet. The configuration is as follows



    Main router is at 192.168.0.1 (wan).



    Raspberry is at 192.168.1.222 (lan), connected via cable to the OpenWrt router which I can access with 192.168.1.1 or 192.168.0.30 from my main pc.



    But I can't connect to my raspberry from my main pc on wan. My configs are



    /etc/config/firewall: https://pastebin.com/NUgCsnUQ



    /etc/config/network: https://pastebin.com/pCRsaAWs



    I followed this guide.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have managed to configure an old router (linksys WRT160NL) as a wifi client using OpenWrt 17.01.4 to connect my raspberry pi to my network and have internet. The configuration is as follows



      Main router is at 192.168.0.1 (wan).



      Raspberry is at 192.168.1.222 (lan), connected via cable to the OpenWrt router which I can access with 192.168.1.1 or 192.168.0.30 from my main pc.



      But I can't connect to my raspberry from my main pc on wan. My configs are



      /etc/config/firewall: https://pastebin.com/NUgCsnUQ



      /etc/config/network: https://pastebin.com/pCRsaAWs



      I followed this guide.







      share|improve this question














      I have managed to configure an old router (linksys WRT160NL) as a wifi client using OpenWrt 17.01.4 to connect my raspberry pi to my network and have internet. The configuration is as follows



      Main router is at 192.168.0.1 (wan).



      Raspberry is at 192.168.1.222 (lan), connected via cable to the OpenWrt router which I can access with 192.168.1.1 or 192.168.0.30 from my main pc.



      But I can't connect to my raspberry from my main pc on wan. My configs are



      /etc/config/firewall: https://pastebin.com/NUgCsnUQ



      /etc/config/network: https://pastebin.com/pCRsaAWs



      I followed this guide.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 15:12

























      asked Mar 7 at 15:05









      k76u4vkweek547v7

      1012




      1012




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          According to the guide you linked, you set up your OpenWrt router with masquerade. In other words, for every connection the RaspPi initiates, the OpenWrt will pretend that itself is making the requests instead of the RaspPi. By design, this doesn't work the other way round: When you access the OpenWrt from your main PC, it's really the OpenWrt; and the IP address of the RaspPi is not accessible.



          In general, what you are trying to do (bridging a LAN to a WLAN station in client mode) is difficult to do for technical reasons (the WLAN protocol only uses 3 MAC addresses instead of the 4 MAC addresses needed to make this work properly).



          There are workarounds, but they all have their gotchas and drawbacks. Which of them to use depend on what exactly are you trying to achieve by putting a RaspPi behind a WLAN router: Is the RaspPi the only device for which you want to do that? Do you only need to access special ports on the RaspPi? Etc.



          Edit



          Two options for the purpose mentioned in the comments:



          1) To use the old Router as a glorified Wifi-Dongle for the RaspPi, have a look at wlan_kabel. This is a program that uses packet sockets to directly bridge the WLAN network interface to the LAN network interface. As a consequence, the Router won't be reachable over WLAN anymore.



          I've no idea if this program is available for OpenWrt, or if you need to cross-compile it.



          2) To access the application on the RaspPi that controls the printer, find out which port it uses, then use port forwarding to make this port (or several ports) accessible under the IP of the Router.






          share|improve this answer






















          • I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
            – k76u4vkweek547v7
            Mar 7 at 15:57










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428768%2fopenwrt-cant-acces-host-in-lan%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          According to the guide you linked, you set up your OpenWrt router with masquerade. In other words, for every connection the RaspPi initiates, the OpenWrt will pretend that itself is making the requests instead of the RaspPi. By design, this doesn't work the other way round: When you access the OpenWrt from your main PC, it's really the OpenWrt; and the IP address of the RaspPi is not accessible.



          In general, what you are trying to do (bridging a LAN to a WLAN station in client mode) is difficult to do for technical reasons (the WLAN protocol only uses 3 MAC addresses instead of the 4 MAC addresses needed to make this work properly).



          There are workarounds, but they all have their gotchas and drawbacks. Which of them to use depend on what exactly are you trying to achieve by putting a RaspPi behind a WLAN router: Is the RaspPi the only device for which you want to do that? Do you only need to access special ports on the RaspPi? Etc.



          Edit



          Two options for the purpose mentioned in the comments:



          1) To use the old Router as a glorified Wifi-Dongle for the RaspPi, have a look at wlan_kabel. This is a program that uses packet sockets to directly bridge the WLAN network interface to the LAN network interface. As a consequence, the Router won't be reachable over WLAN anymore.



          I've no idea if this program is available for OpenWrt, or if you need to cross-compile it.



          2) To access the application on the RaspPi that controls the printer, find out which port it uses, then use port forwarding to make this port (or several ports) accessible under the IP of the Router.






          share|improve this answer






















          • I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
            – k76u4vkweek547v7
            Mar 7 at 15:57














          up vote
          1
          down vote













          According to the guide you linked, you set up your OpenWrt router with masquerade. In other words, for every connection the RaspPi initiates, the OpenWrt will pretend that itself is making the requests instead of the RaspPi. By design, this doesn't work the other way round: When you access the OpenWrt from your main PC, it's really the OpenWrt; and the IP address of the RaspPi is not accessible.



          In general, what you are trying to do (bridging a LAN to a WLAN station in client mode) is difficult to do for technical reasons (the WLAN protocol only uses 3 MAC addresses instead of the 4 MAC addresses needed to make this work properly).



          There are workarounds, but they all have their gotchas and drawbacks. Which of them to use depend on what exactly are you trying to achieve by putting a RaspPi behind a WLAN router: Is the RaspPi the only device for which you want to do that? Do you only need to access special ports on the RaspPi? Etc.



          Edit



          Two options for the purpose mentioned in the comments:



          1) To use the old Router as a glorified Wifi-Dongle for the RaspPi, have a look at wlan_kabel. This is a program that uses packet sockets to directly bridge the WLAN network interface to the LAN network interface. As a consequence, the Router won't be reachable over WLAN anymore.



          I've no idea if this program is available for OpenWrt, or if you need to cross-compile it.



          2) To access the application on the RaspPi that controls the printer, find out which port it uses, then use port forwarding to make this port (or several ports) accessible under the IP of the Router.






          share|improve this answer






















          • I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
            – k76u4vkweek547v7
            Mar 7 at 15:57












          up vote
          1
          down vote










          up vote
          1
          down vote









          According to the guide you linked, you set up your OpenWrt router with masquerade. In other words, for every connection the RaspPi initiates, the OpenWrt will pretend that itself is making the requests instead of the RaspPi. By design, this doesn't work the other way round: When you access the OpenWrt from your main PC, it's really the OpenWrt; and the IP address of the RaspPi is not accessible.



          In general, what you are trying to do (bridging a LAN to a WLAN station in client mode) is difficult to do for technical reasons (the WLAN protocol only uses 3 MAC addresses instead of the 4 MAC addresses needed to make this work properly).



          There are workarounds, but they all have their gotchas and drawbacks. Which of them to use depend on what exactly are you trying to achieve by putting a RaspPi behind a WLAN router: Is the RaspPi the only device for which you want to do that? Do you only need to access special ports on the RaspPi? Etc.



          Edit



          Two options for the purpose mentioned in the comments:



          1) To use the old Router as a glorified Wifi-Dongle for the RaspPi, have a look at wlan_kabel. This is a program that uses packet sockets to directly bridge the WLAN network interface to the LAN network interface. As a consequence, the Router won't be reachable over WLAN anymore.



          I've no idea if this program is available for OpenWrt, or if you need to cross-compile it.



          2) To access the application on the RaspPi that controls the printer, find out which port it uses, then use port forwarding to make this port (or several ports) accessible under the IP of the Router.






          share|improve this answer














          According to the guide you linked, you set up your OpenWrt router with masquerade. In other words, for every connection the RaspPi initiates, the OpenWrt will pretend that itself is making the requests instead of the RaspPi. By design, this doesn't work the other way round: When you access the OpenWrt from your main PC, it's really the OpenWrt; and the IP address of the RaspPi is not accessible.



          In general, what you are trying to do (bridging a LAN to a WLAN station in client mode) is difficult to do for technical reasons (the WLAN protocol only uses 3 MAC addresses instead of the 4 MAC addresses needed to make this work properly).



          There are workarounds, but they all have their gotchas and drawbacks. Which of them to use depend on what exactly are you trying to achieve by putting a RaspPi behind a WLAN router: Is the RaspPi the only device for which you want to do that? Do you only need to access special ports on the RaspPi? Etc.



          Edit



          Two options for the purpose mentioned in the comments:



          1) To use the old Router as a glorified Wifi-Dongle for the RaspPi, have a look at wlan_kabel. This is a program that uses packet sockets to directly bridge the WLAN network interface to the LAN network interface. As a consequence, the Router won't be reachable over WLAN anymore.



          I've no idea if this program is available for OpenWrt, or if you need to cross-compile it.



          2) To access the application on the RaspPi that controls the printer, find out which port it uses, then use port forwarding to make this port (or several ports) accessible under the IP of the Router.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 7 at 17:22

























          answered Mar 7 at 15:49









          dirkt

          14k2930




          14k2930











          • I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
            – k76u4vkweek547v7
            Mar 7 at 15:57
















          • I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
            – k76u4vkweek547v7
            Mar 7 at 15:57















          I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
          – k76u4vkweek547v7
          Mar 7 at 15:57




          I am using the router basically as a wifi dongle. I just need to connect to it from my main pc. I may want to use a second port on the WLAN to give a notebook stronger signal. but my main concer is being able to see the raspi from my main network since it controls the printer.
          – k76u4vkweek547v7
          Mar 7 at 15:57












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428768%2fopenwrt-cant-acces-host-in-lan%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)