Networking – Can’t connect via LuCI or SSH from WAN side network to Raspberry Pi 1B running OpenWRT 14.07

networkingopenwrtraspberry pirouter

Main Problem

I have 2 networks and can only connect to LuCI from hosts on one of those networks. I can't figure out why I can't connect to LuCI from hosts in the other network. I'm having the exact same problem with SSH access as well. What confuses me is that I can ping the Rπ from both networks. I'm suspicious that it's a firewall config issue or something. I don't think it's a routing issue because I can ping Rπ from both networks (but it could be as I'm a noob).

Physical Setup

I have a modem connected to a Netgear router (router1) via WAN port. One of the Netgear's LAN ports is connected to a WAN interface on my Rπ1B (router2) and another Netgear LAN port is connected to a computer (computer1). There's another computer (computer2) connected to the LAN interface on the Rπ1B. Here's a summary and diagram of the setup:

Network 1: 192.168.0.0/25

  • Netgear (router1) LAN interface: 192.168.0.1
  • Rπ1B (router2) WAN interface 192.168.0.5
  • computer1 192.168.0.50

Network 2: 192.168.0.128/25

  • Rπ1B (router2) LAN interface 192.168.0.129
  • computer2 192.168.0.150

enter image description here

More Details

Computer1

From network1 (192.168.0.0/25), computer1 (192.168.0.50/25) can successfully ping 192.168.0.1 and 192.168.0.5 on network1 but not 192.168.0.129 on network2. Using Google Chrome, computer1 successfully reaches the web interface for the Netgear at http://192.168.0.1 but gets ERR_CONNECTION_REFUSED when trying to connect to LuCI at http://192.168.0.5 and gets ERR_CONNECTION_TIMED_OUT when trying to connect to LuCI at http://192.168.0.129. Computer1 cannot connect to 192.168.0.5 or 192.168.0.129 via SSH.

Computer2

From network2(192.168.0.128/25), computer2 (192.168.0.150/25) can successfully ping 192.168.0.1 and 192.168.0.5 on network 1, and 192.168.0.129 on network 2. Computer2 can connect to all these routers' Web interfaces via Google Chrome (192.168.0.1, 192.168.0.5, and 192.168.0.129). And computer2 can connect to 192.168.0.5 and 192.168.0.129 via SSH.

Ultimately, I'm trying to use Google Chrome on computer1 to access LuCI via http://192.168.0.5, since it's technically on the same network as the Rπ's WAN interface.

Best Answer

Figured it out. It's a firewall issue. Here's the source that provided the solution: http://blog.differentpla.net/blog/2015/05/27/openwrt-ssh-wan

To enable access from hosts on the WAN side of the Rπ1B running OpenWRT 14.07 (network 1: 192.168.0.0/25 in the diagram):

  1. Access the LuCI Web interface from a host on the LAN side of the Rπ
  2. Navigate: Network -> Firewall -> Traffic Rules
  3. Under the heading Open ports on router, give your firewall input rule a name, select the appropriate protocol (TCP for both SSH and LuCI), and enter the appropriate port (22 for SSH and 80 for LuCI)

If you're a Linux Ninja, I'm sure you can use iptables form the console to do the same thing. And I think that if you want WAN side access via SSH and LuCI, you'll need to setup one firewall input rule for each service.

Also, be careful because this doesn't seem to be recommended if you're concerned with network security.

Related Question