this post was submitted on 25 Jan 2025
31 points (100.0% liked)

Linux

49393 readers
1748 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I have a server running Debian that has been connected to WiFi for a long time, but I have since moved it and given it a wired connection. It still seems to be using WiFi though, and in my router settings it shows up as connected through WiFi and not through ethernet.

Now I want to make sure that I can switch over from WiFi to ethernet directly from an ssh-connection so I won't have to connect a screen to get direct access.

What is my best bet here? A lot of the tools I find used for different network operations are not pre-installed, and I don't want to be installing just everything being suggested. Can I solve this by installing network-manager and using nmcli?

EDIT: I also want to disable the wireless card.

EDIT2: No eth-interface shows up when running ip link show, EDIT3: but r8169 0000:02:00.0 enp2s0: renamed from eth0 shows up in dmesg and enp2s0 shows up in ip link show, so I guess it is recongized then.

[SOLVED] EDIT4: I made the modifications manually in etc/network/interfaces, and now it seems to work. I entered the following lines:

auto enp2s0
iface enp2s0 inet dhcp

And then it showed up in my router. I then continued to comment out the lines enabling the wireless interface, and after reboot it works fine still.

top 9 comments
sorted by: hot top controversial new old
[–] mbirth@lemmy.ml 9 points 5 days ago (1 children)

nmtui if you’re using NetworkManager, Or edit the /etc/netplan/*.yaml if your install uses netplan.io.

[–] cyberwolfie@lemmy.ml 2 points 5 days ago (1 children)

I don't think it uses netplan.io - it is a very standard Debian server install - netplan.io being Canonical, I guess that would typically be found on Ubuntu installs?

nmtui sounds nice. I didn't end up installing NetworkManager now, but it is something I will look more into, so I've noted it down. Learning networks is a big goal for this year.

[–] superkret@feddit.org 2 points 5 days ago

If it's a standard Debian install, look into /etc/network/interfaces .
If the wifi is configured in there, just replace the wifi interface name with that of your ethernet adapter, and delete the SSID and password lines.
But personally I'd use networkmanager and nmtui.

[–] just_another_person@lemmy.world 5 points 5 days ago* (last edited 5 days ago) (1 children)

'ip a' to show your active addresses

rfkill to hard disable wireless devices

nmtui if you want a simple way to change network configuration or disable something

[–] cyberwolfie@lemmy.ml 1 points 5 days ago

‘ip a’ to show your active addresses

Nice, now only my ethernet interface shows an IP after implementing the changes to etc/network/interfaces as described in an edit in the OP.

rfkill to hard disable wireless devices

rfkill was also not isntalled by default on my server, but I've installed it now and see that they (i.e. bluetooth and wifi) are unblocked, so I will now go learn how to block them. :)

nmtui if you want a simple way to change network configuration or disable something

Nice, I will check this out!

[–] Zenlix@lemm.ee 3 points 5 days ago (1 children)

You might be able to prepare a bag accept that does the switch and run that inside a tmux session. The connection would get lost, but don't the tmux session did not care the script would finish. Although that would require to have the exact working commands. If anything goes wrong you would have to plug directly into the server.

All I ever used was nmcli and I think it should work for this purpose. It was mostly pre installed. Rasbien as well as Debian had it or installed (the most used distros by me).

[–] cyberwolfie@lemmy.ml 1 points 5 days ago (1 children)

tmux has been on my to-learn list forever now. Seems it should be bumped up in priority.

NetworkManager was not installed on my system, but I will look into this later and check out nmcli and nmtui (as suggested below) to get familiar with these tools.

[–] Zenlix@lemm.ee 3 points 5 days ago (1 children)

Even if you do not use or like this approach, learning tmux is quite easy and quick and super useful. Just that you executed commands do not end when your ssh session crashes, that you can collaborate. Just attach multiple ssh sessions to one tmux session and everything, even the input, will be sync. In advance you get windows and split screen in any terminal.

[–] cyberwolfie@lemmy.ml 1 points 5 days ago

That sounds awesome