vmware / photon

Minimal Linux container host
https://vmware.github.io/photon
Other
3.05k stars 696 forks source link

photon os 4.0 loses static ip after update 5-10 .61-5 .ph4-esx to 5.10.78-4.ph4-esx #1266

Open IgnacioProcisa opened 2 years ago

IgnacioProcisa commented 2 years ago

Hello, today I have updated photon 0s 4 from version 5-10 .61-5 .ph4-esx, having three security notifications.

My MVs have two network adapters, eth0 with static ip and eth1 with dynamic ip. Running smoothly. Prep versión partida1 Post versión post Operational & securityinfo Previo_LI Post update Networkctl status post_LI Static IP configured and not modify configuracionred_LI

After installing the updates, the eth0 adapter does not have the ip that is configured manually, doing an ip or an ifconfig the adapter appears without IP. If we do a networkctl, it tells me that the adapter is degraded and configuring. Checking in other VMs without updating the status is routable and configured.

I can only get ip again using a DHCP for the eth0 adapter.

What has happened?

ssahani commented 2 years ago

Can you attach Networkd logs from journal ? It seems these IP is dropped by kernel. Does restart Networkd restores your ip ?

Z3nto commented 2 years ago

Same issue here at a freshly installed Photon OS with ISO "photon-4.0-ca7c9e933.iso". After updating with tdnf update and a reboot, eth0 didn't use the configured Static IP. A restart of systemd-networkd didn't solve the problem. I've managed to solve the issue with deleting the file /etc/systemd/network/99-dhcp-en.network

Here are some screenshot while it was not working:

networkd log from journal image

networkctl status 2 image

/etc/systemd/network/99-static-en.network image

ssahani commented 2 years ago

Thanks for the data. If you see eth0 configured on 99-dhcp-en.network networkctl status 2

you need to rename 99-static-en.network file to 10-static-en.network` like that. Note that all configuration files are collectively sorted and processed in lexical order.

terefang commented 2 years ago

i have had the same issue on CBL Mariner.

the error was that the config file needs to be readable by group systemd-network

LaXiS96 commented 1 year ago

Same issue on a fresh install of 4.0 Rev2 from ISO (photon-minimal-4.0-c001795b8): after tdnf upgrade/tdnf distro-sync, /etc/systemd/network/99-dhcp-en.network is added alongside the existing /etc/systemd/network/99-static-en.network (which contains the manual IP configuration set up during installation), overriding the static configuration which breaks networking on a DHCP-less network.

Please use a higher priority for the installer-generated static network file, so it doesn't get overridden by the 99-dhcp catch-all.

joel72265 commented 1 year ago

Thanks for the data. If you see eth0 configured on 99-dhcp-en.network networkctl status 2

you need to rename 99-static-en.network file to 10-static-en.network` like that. Note that all configuration files are collectively sorted and processed in lexical order.

thank you, this fixed my issue after doing an update.

root@...[ ~ ]# tdnf -y install systemd (updated to systemd.x86_64.247.13-2.ph4) (a library update should not cause a network disconnect)

tapakund commented 1 year ago

Hi @joel72265 , I think renaming 99-static-en.network file to 10-static-en.network itself should solve your issue. Could you share from which version of systemd you upgraded it to 247.13-2?

joel72265 commented 1 year ago

Hi @tapakund, here are the steps I followed

VMware Photon OS 4.0 build 2f5aad892 root@ [ ~ ]# ping 8.8.8.8 (can ping) root@ [ ~ ]# ping 192.xxx.xxx.xxx (can ping LAN) root@ [ ~ ]# tdnf list systemd systemd.x86_64 247.10-6.ph4 @System root@ [ ~ ]# ls /etc/systemd/network 99-static-en.network root@ [ ~ ]# tdnf -y install systemd root@ [ ~ ]# systemctl restart systemd-networkd root@ [ ~ ]# tdnf list systemd systemd.x86_64 247.13-2.ph4 @System root@ [ ~ ]# ping 8.8.8.8 (can ping) root@ [ ~ ]# ping 192.xxx.xxx.xxx (cannot ping from LAN, cannot ping, SSH to Photon) root@ [ ~ ]# ls /etc/systemd/network 99-static-en.network 99-dhcp-en.network root@ [ ~ ]# rm /etc/systemd/network/99-dhcp-en.network root@ [ ~ ]# systemctl restart systemd-networkd root@ [ ~ ]# ping 8.8.8.8 (can ping) root@ [ ~ ]# ping 192.xxx.xxx.xxx (can ping LAN)