Rpi connect without network

December 18, 2024, 16:42

yosif_stalin_gaming

Hi guys, is it possible to to make my rpi spin up a local network which I will use to connect via ssh And be able to connect to another network without losing connection. Onw thing I suppose can help is using multiple interfaces

thunder07337

Yes, setting up your own network would not be a problem. But where I see a problem is the connection from your device to it. A network alone is not enough, the network must also be connected to the Internet. If it doesn't have this, you can't connect to this network.

yosif_stalin_gaming

Why

thunder07337

If the network of the Pi is not in your network, you need a connection between the two networks. This can also simply be a cable or a wireless connection via WLAN. And if this is not possible because, for example, the Pi is far away, then you need the Internet, otherwise you would have to lay a line to it, because WLAN does not reach very far. Otherwise, I don't understand what exactly you want to achieve and you should write down exactly what you want to achieve.

thunder07337

And preferably with a description of the surroundings. Example: I want to set up the Pi in the garage, but I don't have a LAN connection there, so I want the Pi to be connected to my network via WLAN. Or: I want to use the Pi as a weather station and there is no Internet connection where it will be set up. The more details you give us, the better we can help.

thunder07337

<@605677090834219022> By the way, why do you call your post "Rpi connect without network" and then talk about a local network? That doesn't really make sense...

yosif_stalin_gaming

i will connect my phone to the rpi network

yosif_stalin_gaming

they will be in close proximity

yosif_stalin_gaming

like 2m to 5cm

yosif_stalin_gaming

is this not enough for a lan?

yosif_stalin_gaming

it will be available as a network i can connect to right ?

yosif_stalin_gaming

also is there is a possibility for a wired connection between the phone and the rpi i am for it too

thunder07337

1. please write your texts in a block, not in 100,000 sentences. English is not my mother tongue and I have to translate, so copying individual sentences every time is exhausting, thank you. 2. please don't confuse LAN(cable) with WLAN(wireless). 3. so instead of a router, the Pi should set up a network that you can log into via WLAN?

yosif_stalin_gaming

i thought WLAN and LAN were differing only in the range

yosif_stalin_gaming

ok

yosif_stalin_gaming

3rd point -> my answer: yeah preferably

yosif_stalin_gaming

but if it is easier with a cable connection, so be it

thunder07337

It doesn't matter whether the smartphone connects via WLAN or LAN. What the Pi needs is a DHCP server, because the Pi then has to set up the network and assign the IP addresses. It gets interesting with the internet connection because the Pi needs this to be able to make updates or install packages, for example. However, I have to go to bed now. So it's best to find out about DHCP servers.

oops.se

Search for RaspAP

yosif_stalin_gaming

thanks

yosif_stalin_gaming

I have been trying for a day to set it up but it just doesn't work should u try on a clean install, also there is still the possibility for direct connection with ethernet right?

yosif_stalin_gaming

I also tried manual setup with hostapd and dhcpcd it still does not work

yosif_stalin_gaming

?

thunder07337

You can always use cables, unless you've really messed up. But the statement: I also tried manual setup with hostapd and dhcpcd it still does not work Doesn't really help. What exactly did you do and what exactly isn't working? Without knowing what is not working and what you have done, nobody can help.

yosif_stalin_gaming

Which is easier to set up

thunder07337

Counter question: How is the Pi supposed to get Internet if it sets up its own network? It needs the Internet for updates and if something is not accessible within the network, it must be able to send the request on. So let me ask you again: what exactly are you planning to do? Why should the Pi set up the network itself? What is the final goal?

oops.se

A Raspberry Pi can have multiple interfaces (Physical or virtual) connected to other networks (Internet or local): The way that the Raspberry Pi decide which network to send the traffic to is done with the "routing table". In the routing table you can decide which network should the traffic be sent to and if there are several NIC (Network Interface Cards) connected to the same network, then will the metric decide the NIC priority. To get Dynamic IP allocation you need to setup a DHCP server. A DHCP server can service several network (by the listen to which NIC parameter). Different Linux Distros and versions uses different NM (Network Manager) and DHCP servers. So be aware that you need to know which Distro and what version you aim to deploy this on. This is the basics for networking in Linux and other OSs. So I would recommend that you change approach from "asking for a solution" to "describe what the goal is" as <@1187039958561726494> have recommended.