I have OpenWrt on a Pi 4 snapshot Nov firmware.
Currently the Pi is connected as another host in my LAN.
I have set up OpenWrt as a Wifi client to the main wan side router/gateway.
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
config interface 'lan'
option ifname 'eth0'
option proto 'dhcp'
option type 'bridge'
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'wwan'
option proto 'dhcp'
The OpenWrt Pi connects to the main home router which gives it an ip address... I can ping that ip address from my laptop. I tested from LuCi and the OpenWrt Pi is connecting to the internet.
However, I cannot ssh in to that OpenWrt Pi. I though I could ssh to the ip address the main router gives to its wifi connection to the OpenWrt Pi? Instead the putty connection never connects and times out.
What do I need to change so I can ssh to the Pi even when it's network cable is disconnected and it is connected to the main outer as a wifi client?
The firewall may block the connection. Which firewall zone did you assign to wwan? Maybe it should be in the lan zone, which allows incoming connections to openwrt (the INPUT setting in the zone config).
Now I can ssh in to the ip address of that wwan interface. Great.
However, when I test by plugging out the network cable to the Pi running OpenWrt I can no longer access the LuCi Web interface from my laptop. I tried the ip of the wwan but Chrome says: "Site cannot be reached. Refused to connect".
It should work the same for http or ssh since you've set the default to accept input on all ports.
If you are using the correct IP and it is a firewall problem you would get "Connection refused".
Note that most browsers if http does not work they immediately try https and stick with it-- you need to edit the URL in the bar to try http again.
Great... I can get to the LuCI Web Interface now via the wwan interface. I had cleared browsing data several times and typed in http://192.168.1.6 but it still wasn't working... then I rebooted the Pi and it worked..
When you need to have access from the WWAN, it's probably better practice to have it in a separate zone rather than accept all traffic from WAN. This can come useful in case you come at a later time of not using the device and connect its WAN port directly to a modem.
That's generally speaking, but it's understood that this is more likely to happen with a regular router than with a Pi
Well, if you are going to make it the home router, connected by cable to the modem, then you shouldn't need the wwan interface. It should just be a regular AP-mode network.
What you need to consider, however, is how you are going to access the RPi by cable if you needed to. There are few options for the RPi:
Using a USB Ethernet adapter for the WAN and on-board Ethernet port for the LAN (it's better that way, so if something wrong happens with the USB adapter, you can still access the Pi.
Using a VLAN-capable switch, trunk both WAN and LAN on the on-obard Ethernet port.
Just do with the WiFi alone for the LAN access. If you keep an updated backup of your settings, when something goes wrong with the RPi you could just reslash the Micro SD card.
Just do with the WiFi alone for the LAN access, but carefully allow SSH access from the WAN side. There are risks involved, but can be minimised with proper precautions.
Yes.. I just wanted to see the Wifi client and AP modes in action and understand how to configure them. But I will connect the Pi/OpenWrt to the Modem by ethernet.
Well I definately want to cable the OpenWrt router to the LAN... I just realised the VLAN option is available to me as I have a TP-Link TL-SG105E.
But first I'm going to try a Linksys USB/Eth adapter, it seems less complicated!