Can't SSH into RP with OpenWrt

I am attempting on making a VPN Router following a tutorial (https://www.youtube.com/watch?v=jlHWnKVpygw&t=1480s), and it seems when I image my RP to OpenWrt, I cannot ssh into it.

I am connecting my RP to my laptop with a network cable, which I am sharing my WiFi to it. Although it is an open network as I live on my college residence, so I have no access to the router which is my reasoning for using the network cable and sharing wifi.

I believe it has something to do with OpenWrt as I imaged it just with headless debian and I was able to ssh fine into it, and I've come to a standstill.

Any help would be appreciated, thanks

stalling,

Welcome to the forum.
Did you watch the complete video on yt? He talks about 2 x Wifi adapter: "you will need 2 wifi adapters. (2:42)"
Because 1 x wifi is for connecting to internet (wan), the onboard eth-port and second wifi (lan) are to connect to (with pc, phone, whatever).
What type of RP do you have? Which image do you use?

The RP has only 1 channel on it's wifi, so how you wanna share this? With what?
If you combine onboard eth-port and wifi of the RP, you are not able to use the RP as router.

You need 2 different connections (wan and lan)! You could try: locally eth port, for pc, phone, whatever, but ONLY direct attached to eth port.
Remote = wifi, to connect to internet.

Keep those 2 connections always separated.

Did you try it from eth and wifi? Has the image wifi as primairy ethernet-port or the onboard eth-port?
Normally after image your RP you should be able to ssh into it on the eth-port (cable).
Maybe your image is corrupt, did you check the sha-256 code?

More info:

Hopefully it helps you further.

DG.

Wifi is disabled by default, so you have to first use the cable for first login and configuration.

  1. Make sure that the workstation is not connected to any other network.
  2. Verify that it has acquired dhcp settings from the OpenWrt
  3. Then ssh to openwrt.lan or 192.168.1.1
  4. Alternatively you can browse to the same addresses as above.

Hello DGdodo,

Thank you for replying and offering a hadn!

I am using a RaspberryPi 4B and the image file name is "openwrt-22.03.2-bcm27xx-bcm2711-rpi-4-squashfs-factory.img.gz", I chose the 4B download on OpenWrt.

What I mean by sharing is I have my network cable connected to my laptops eth port and the RP's eth port, and I am sharing my WiFi to my Ethernet.
image

I can only use it from ethernet until I ssh into it because of my network as it's open and at the moment I do not know how to set it to connect to wifi without ssh when it is open and requires no password.

How would I be able to check the code? Should I redownload OpenWrt?

Thanks a lot for the reply and troubleshooting!

1 Like

What do you mean by any other network? I am only connected on WiFi if that's what you're referring to

How would I verify that or where? I am completely new to OpenWrt.

I attempted to ssh into those and they have not worked. My pi's ip address is DHCP'd from the wifi network's server, and is from 192.168.137.1-255

My limited experience with RasPI involved using the RS232 to log in and enable ssh.
I did this on RPiB and RPi CM4

Have you tried RS232?

RS232 would be inappropriate for a Pi -- if anything, it would be a TTL UART connection (the difference is in the signaling voltage -- this is critical, though).

However, the OP can simply connect a display and a keyboard (assuming this is a standard RPi 3 or 4 that has HDMI + USB) and use the default terminal without any fuss, should they need to have a non-network means of connecting.

@stalling - turn off your connection sharing on your computer and disable wifi. Connect an ethernet cable directly between the built-in ethernet port on your Pi and your computer. Set the computer to obtain an address by DHCP. You computer should get an IP in the 192.168.1.0/24 network... then ssh should work: ssh root@192.168.1.1 (no password is necessary). From there you can configure your OpenWrt Pi as needed, including enabling wifi or changing network configs.

1 Like

OpenWrt has wifi disabled by default, so if you have not logged into it to enable it, you are connected to some other wifi.

This doesn't have to do with OpenWrt, rather than to check on your system what settings it has acquired from DHCP.

By default OpenWrt will act as DHCP server, so as @psherman mentioned, connect a cable in the lan port, connect to 192.168.1.1 by ssh or http, and do the basic configuration, like to enable the wifi and adjust the lan IP.

1 Like

I stand corrected in use of RS232 rather than Serial. Thanks.
And, yes I have done specifically this using the Prolific USB adapter with flyleads (albeit 5 years ago...)

I had not tried HDMI since I never expected an accesspoint to support this. So, thanks

Yup... makes sense. The Pi is a terrible AP due to the onboard wifi chipset, so in my mind, the Pi is a router that happens to have wifi, not an AP :wink:

1 Like

The Model B tears up SD cards and I have to toss them after a few months. EMMC is far more reliable.
CM4 is quite good IMO. I have them everywhere.

With OpenWrt, very few writes occur on the main storage (regardless of type) unless you have made configuration changes that would increase it (such as writing logs to that storage). Therefore, if you're experiencing failures on a traditional sd card based system (like the model b), something is not optimized on your configuration or maybe you have bad cards or other hardware issues with the main device.

(I can understand killing cards if you're using a general purpose OS like RaspberryPi OS and/or using them in a manner that has lots of write operations).

Yes. I was logging access and capturing data over USB-Serial for lab testing.
The CM4 have lasted over a year in same role

Thank you so much!

For some reason it completely crossed my mind to connect it to a display, and I was able to ssh into it afterwards on my laptop. I am a complete idiot and made a beginner mistake.

I wish you well and thanks for the help from everyone

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.