On a fresh OpenWrt install on my device I will attempt to SSH over the device's hotspot:
$ ssh -v root@192.168.1.1
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /home/{ME}/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
This will just hang forever. Sometimes I get a "Network is unreachable" error. I can try this again after resetting the device and sometimes I will be able to SSH into the device.
This seems to coincide with LuCI. I cannot access 192.168.1.1 in a web browser when I cannot SSH into the device, but I can access the web interface when I can SSH into the device. The only thing I can do is keep resetting until it works.
I also have a second problem that's related. With Ethernet connected from the device to my local network, I cannot ping google.com but I can ping 8.8.8.8 from the device. With a serial connection to the device, I can run wifi up
and sometimes this will fix the issue and I can ping google.com. However after wifi up
, I cannot SSH into the device over the device's hotspot. This is a major issue as I'm trying to cut any dependency of the serial connection when setting up a new device. That is, I'd like to just work with the device via SSH tunnel.
So my goal is to:
- Reliably SSH into the device over the device's hotspot
- ping google.com (with device connected to local network via ethernet)
Edit: I have not made changes to /etc/config/network or /etc/config/wireless.
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix '{PREFIX}'
config interface 'lan'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device 'lan_dev'
option name 'eth0'
option macaddr '{MAC}'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '0'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'
/etc/config/wireless:
config wifi-device 'radio0'
option type 'mac80211'
option channel 'auto'
option hwmode '11g'
option path 'platform/10300000.wmac'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'ap_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid '{NAME}'
option encryption 'none'