LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2022, 10:35 PM   #1
guthrie
Member
 
Registered: Jul 2003
Location: Iowa
Distribution: Debian
Posts: 32

Rep: Reputation: 15
network configuration - eth0?


I have a new install of Debian 5.10, and all works fine, but I want to convert from DHCP to a static IP.
I think I know all the details (!) of how to do this - but in my /etc/network/interfaces.d/setup file it declares:
"iface etho inet dhcp"
But all of the other tools (ip, nmcli, lspci) show that the network interface is enp4s0.

I understand that on boot is is supposed to be changed, and indeed dmesg shows:
"enp4s0 renamed from eth0"

trying: systemctrl status networking
fails; saying "Cannot find device etho".
(before I made any changes)

I tried changing /etc/network/interfaces.d/setup to use enp4s0 instead of the original installation eth0, no effect.

What to do? And why is the setup as installed not valid with the systemctrl check?
 
Old 11-11-2022, 11:24 PM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,810
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
You can force your ethernet interface to keep the traditional name eth0 by including on your kernel command lines in grub.cfg and /etc/default/grub net.ifnames=0. You can configure static IP using systemd using systemctl to disable whichever network system (and automatic resolver) is in control, enabling systemd-networkd instead, and creating /etc/systemd/network/eth0.network containing its configuration:
Code:
[Match]
Name=eth0

[Network]
Address=###.###.###.###/24
DNS=###.###.###.### [###.###.###.###] [###.###.###.###]
Gateway=###.###.###.###
IPv6AcceptRA=no
LinkLocalAddressing=no
Finish up by creating a static /etc/resolv.conf and uninstalling or otherwise disabling whatever was automatically generating it, e.g. resolvconf package. More detail here.
 
1 members found this post helpful.
Old 11-12-2022, 03:29 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,708

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
The kernel version is 5.10, the debian version is 11 aka bullseye.

If you are running a desktop the easiest way is to use the networking manager applet i.e. the network icon in the upper right, select network settings and switch to a static ip address. If not using a desktop use the nmcli utility.

Networking is controlled by network manager versus the traditional networking scripts by default unless you switch back.
 
  


Reply

Tags
network confguration



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fix:UDP packet send through vlan(eth0.4092), reaching at both eth0 and eth0.4092 arjuncr Linux - Networking 1 02-19-2019 02:37 PM
I deleted the Eth0 configuration information from vim ifcfg eth0. How to retrieve it? godwin.a Linux - Newbie 1 02-08-2014 02:58 AM
vnStat - if pointed to eth0 will it aggregate eth0 and eth0:1 alias stardotstar Linux - Networking 0 07-20-2010 07:49 PM
[SOLVED] Network eth0 activated upon boot in ifcfg-eth0; but no network connection after login TomRaaijmakers Linux - Networking 1 06-17-2010 08:29 AM
Problems with eth0 and Configuration tools for eth0 MRMadhav Fedora 3 11-14-2006 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration