Author Topic: After upgrading Deb10 to Deb11 - No ip address on boot - Wasted 4 hr's  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1963
  • Country: dk
I have just upgraded my last Deb10 machine (The mailserver) , from Deb10 to Deb11.

Upgrading went reasonably well, just some minor quirks.
Then reboot , and the server was GONE  :--

Went to the console, and the system was booting & running fine.
But there were no ipv4 addreses assigned to the network interfaces  |O

I had no problem setting the ip address(es) with ifconfig.
So something was fishy with reading my config from /etc/network/interfaces

I have been upgrading 10+ debians from 10 to 11, and have never had any major issues.
Well besides discovering that python2.7 was gone in deb11, and my py scripts were failing. Was prob. listed somewhere in the release notes  :-\

So this one was new .....
No IPv4 ip addresses assigned to the interfaces
And nothing in the logs.

Everytime i rebooted or restarted the networking service, connection was lost. And only going to the console to "ifconfig" it ,would bring it back.

I noticed i had a directory in /etc/networking called ifupdown2 , and a it was indicated that the networking service was using it.

Code: [Select]
# systemctl status networking.service
● networking.service - Network initialization
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: active (exited) since Thu 2023-07-27 15:14:35 CEST; 9min ago
       Docs: man:interfaces(5)
             man:ifup(8)
             man:ifdown(8)
    Process: 336 ExecStart=/usr/share/ifupdown2/sbin/start-networking start (code=exited, status=0/SUCCESS)
   Main PID: 336 (code=exited, status=0/SUCCESS)
        CPU: 3.748s

Jul 27 15:13:23 server01 networking[336]: networking: Configuring network interfaces
Jul 27 15:14:35 server01 systemd[1]: Finished Network initialization.
Warning: journal has been rotated since unit was started, output may be incomplete.

Strange part was that it was not used on ANY of my other installs  :-//

Code: [Select]
# systemctl status networking.service
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sat 2023-07-22 08:00:20 CEST; 5 days ago
       Docs: man:interfaces(5)
    Process: 440 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
   Main PID: 440 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 2272)
     Memory: 6.4M
        CPU: 257msAdd ip address with CIDR netmask , and remove netmask , network & broadcast lines
     CGroup: /system.slice/networking.service

Jul 22 08:00:20 pippin systemd[1]: Starting Raise network interfaces...
Jul 22 08:00:20 pippin ifup[440]: ifup: waiting for lock on /run/network/ifstate.enp0s25
Jul 22 08:00:20 pippin systemd[1]: Finished Raise network interfaces.

After enabling a lot of debugging for interface activation, i just saw a python traceback wo. any usable info.

After much headscratching i did a :
Code: [Select]
root@server01:~# ifdown --force -a
root@server01:~# ifup -a
error: netlink: enp2s0: cannot add address 192.168.10.101/24 dev enp2s0: 'str' object has no attribute 'packed'
warning: enp2s0: post-up cmd '/sbin/route add -net 10.10.0.0 netmask 255.255.0.0 gw 192.168.10.1' failed: returned 7 (SIOCADDRT: Network is unreachable
)
warning: enp2s0: post-up cmd '/sbin/route add -net 10.20.0.0 netmask 255.255.0.0 gw 192.168.10.1' failed: returned 7 (SIOCADDRT: Network is unreachable
)
error: netlink: enp1s0: cannot add address 192.168.20.100/24 dev enp1s0: 'str' object has no attribute 'packed'

Note the lines with error:  )
error: netlink: enp1s0: cannot add address 192.168.20.100/24 dev enp1s0: 'str' object has no attribute 'packed


That is the "super informative" Debian error message you get when using ifupdown2 , and use the old ifconfig syntax in the interfaces file  :-- :-- :-- :--

After a bit of googling i found the "hint" here
https://forum.proxmox.com/threads/network-outage-after-apt-dist-upgrade-and-reboot-on-proxmox-6-1-7.72321/

I had to make this modification in my /etc/network/interfaces file , for ifupdown2 not to barf:
Add ip address with CIDR netmask , and remove netmask , network & broadcast lines.

Code: [Select]
Bad:
#
# server01 inside interface - Connected to local network
# IPv4 address
#
auto enp2s0
iface enp2s0 inet static
        address 192.168.10.101
        netmask 255.255.255.0   
        network 192.168.10.0   
        broadcast 192.168.10.255
#        gateway   192.168.10.1
        dns-nameservers 127.0.0.1
        dns-search server-lan.org
#

Good:
#
# server01 inside interface - Connected to local network
# IPv4 address
#
auto enp2s0
iface enp2s0 inet static
        address 192.168.10.101/24
#        gateway   192.168.10.1
        dns-nameservers 127.0.0.1
        dns-search server-lan.org
#





Bad:
#
# server01 outside interface - DMZ IP
# IPv4 address
#
auto enp1s0
iface enp1s0 inet static
        address 192.168.20.100
        netmask 255.255.255.0
        network 192.168.20.0
        broadcast 192.168.20.255
        gateway 192.168.20.1
        dns-nameservers 127.0.0.1
        dns-search server-lan.org



Good:
#
# server01 outside interface - DMZ IP
# IPv4 address
#
auto enp1s0
iface enp1s0 inet static
        address 192.168.20.100/24
        gateway 192.168.20.1
        dns-nameservers 127.0.0.1
        dns-search server-lan.org
#



That was 4 hr's of my life, that could have been spent better.


Edit:
Seems like ifupdown2 was already present on my Deb10 system, but there it worked wo. probs.  - Could be a Py3 issue , since Deb11 "killed" Py2.
It might have been installed when i installed iproute2, in order to play with VRF lookalike on linux.


/Bingo
« Last Edit: July 28, 2023, 04:27:00 pm by bingo600 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf