TIPS Debian 10 installation question

undrhil

Member
Joined
Feb 7, 2008
Messages
158
Reaction score
12
How can I make the name on my network connection be 'eth0' which the update script seems to want it to be, instead of enp0s3 or whatever it is currently?
 
make the name on my network connection be 'eth0' which the update script seems to want it to be, instead of enp0s3
I wrote a fix for that on Raspbian10.3 which is Debian 10 Buster based.
Look at
SOLVED Fix scipt for knockd when eth0 changed its name? due to dhcpcd deb policy.

The fix never went out on the automatic update for reason it hadn't been tested/adjusted for centOS

Note for the Raspbian the script checks and edits the file cmdline.txt to disable the new 'net.ifnames' add
Code:
 net.ifnames=0
to the kernel commandline; (but that may be different on deb 10 maybe.)

The file attached to that post is a "script 'fix-knockd-down' alters the knockd default options" so knockd can survive no matter which eth0 name you have.

Note your O.S. on different Hardware may differ. Also pay attention to your security as the NEW ifnames were to improve security, though on incrediblePBX2020 on RPi for Raspbian10 behind a NAT HW firewall - it probably isnot a problem.
 
Last edited:
I may be mistaken but I think /boot/commandline.txt that @ostridge mentioned is specific to Raspbian and/or Debian versions tailored to Raspberry Pi.

To be on the safe side and on the mainstream of Debian logic you would want to edit the file: /boot/grub/grub.cfg and search for all the lines that contain "linux /boot/vmlinuz- ..." and add at the end of each such line the variable initialization "net.ifnames=0" (without the quote marks).

This will work on Debian, Ubuntu, Linux Mint and most likely on any Debian/Ubuntu derivatives. You will be back to the eth0, eth1, .. scheme.

If you are running a VPS for instance you could check out the content of the /boot/grub/grub.cfg and most likely you will see the construct that I'm suggesting here which is the way most KVM VPS platforms do.

If you are interested in understanding the "why" of the "new" style device naming convention you can read this: https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
The last part of the write-up explains about the different options available.

Finally, if you ever want to do this on a Debian based system with a desktop/GUI, you may want to install "grub-customizer" which is a great grub bootloader edit/control utility. There on the "general settings" tab you can add to the "boot time kernel parameters" text box. It will then edit the actual /boot/grub/grub.cfg file properly for each instance of Linux OS loading.
 
What would be the reason not to start working with the new naming scheme (i.e. update the scripts)?

"eth0" is more familiar to me also, but since the new names are now the "normal" way Debian does things, I think it would be wise to consider adapting rather than forcing it backwards.
 
Here's the way we handle it in the new Incredible PBX 2021 release:
Code:
apt-get install knockd -y
sed -i 's|START_KNOCKD=0|START_KNOCKD=1|' /etc/default/knockd
test=`ifconfig | grep eth0`
if [ -z "$test" ]; then
 test2=`ifconfig | grep wlan0`
 if [ -z "$test2" ]; then
  devport=`ifconfig | head -n 1 | cut -f 1 -d ":"`
  echo "KNOCKD_OPTS=\"-i $devport\"" >> /etc/default/knockd
 else
  echo 'KNOCKD_OPTS="-i wlan0"' >> /etc/default/knockd
 fi
fi
 
What would be the reason not to start working with the new naming scheme (i.e. update the scripts)?

"eth0" is more familiar to me also, but since the new names are now the "normal" way Debian does things, I think it would be wise to consider adapting rather than forcing it backwards.
I guess the only reason would be that some legacy software still count on eth# type network interface designation. Otherwise I agree with you that the new scheme should be adopted and the link that I posted convincingly explains the why part to those who still have doubts about its wisdom.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top