Network configuration failed for interfaces

Problem:
two interfaces set. One DHCP, one static
Static failed to be identified
DHCP address is OK.

Expected outcome:

Foreman and Proxy versions:
2.3.3

Foreman and Proxy plugin versions:

Distribution and version:
CentOS 7.9

Other relevant data:
Here is the kickstart network part related produced :slight_smile:

eno4 interface

real=grep -l 24:80:0d:9e:e1:63 /sys/class/net/*/{bonding_slave/perm_hwaddr,address} 2>/dev/null | awk -F '/' '// {print $5}' | head -1
sanitized_real=echo $real | sed s/:/_/

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO=β€œnone”
IPADDR=β€œ10.16.203.115”
NETMASK=β€œ255.255.255.192”
GATEWAY=β€œ10.16.103.65”
DOMAIN=β€œpriv.manos.fr”
DEVICE=$real
HWADDR=β€œ24:80:0d:9e:e1:63”
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
DEFROUTE=yes
DNS1=β€œ10.15.22.10”
DNS2=β€œ10.15.22.11”
MTU=1500
EOF

ens192 interface

real=grep -l 90:36:9f:f1:ff:10 /sys/class/net/*/{bonding_slave/perm_hwaddr,address} 2>/dev/null | awk -F '/' '// {print $5}' | head -1
sanitized_real=echo $real | sed s/:/_/

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO=β€œdhcp”
DOMAIN=β€œinstall.manos.com”
DEVICE=$real
HWADDR=β€œ90:36:9f:f1:ff:10”
ONBOOT=yes
PEERDNS=no
PEERROUTES=no
DEFROUTE=no
MTU=1500
EOF

After installation, the eno4 is not set while the MAC is correct :slight_smile:

more /etc/sysconfig/network-scripts/ifcfg-eno4

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eno4
UUID=cb6d9586-310c-4c44-86b9-a83c32bda24c
DEVICE=eno4
ONBOOT=no

cat /sys/class/net/eno4/address

24:80:0d:9e:e1:63

Subnet is configured as static and IPAM to none:

parameters: (truncated)
foreman_subnets:

  • name: 10.16.103.64
    network: 10.16.103.64
    mask: 255.255.255.192
    gateway: 10.16.103.65
    dns_primary: 10.15.22.10
    dns_secondary: 10.15.22.11
    from: β€˜β€™
    to: β€˜β€™
    boot_mode: Static
    ipam: None
    vlanid:
    mtu: 1500
    nic_delay:
    network_type: IPv4
    description: β€˜β€™

Please what’s wrong ?
Regards

Here the list of file in /sys/class/net/eno4

ls /sys/class/net/eno4
addr_assign_type carrier device duplex ifindex name_assign_type phys_port_name queues tx_queue_len
address carrier_changes dev_id flags iflink netdev_group phys_switch_id speed type
addr_len carrier_down_count dev_port gro_flush_timeout link_mode operstate power statistics uevent
broadcast carrier_up_count dormant ifalias mtu phys_port_id proto_down subsystem

You set the IP address to 10.16.203.115 but your network seems to be:

That can’t be right. But I don’t know if that makes a difference to your problem, though.

Thank you for reviewing.
Sorry I changed the IP for publishing and made a type.
IPADDR=β€œ10.16.103.115”
Fixed. But not my problem…

Once the machine network fixed by hand, we can see the command should have been worked

grep -l 24:80:0d:9e:e1:63 /sys/class/net/*/{bonding_slave/perm_hwaddr,address} 2>/dev/null | awk -F β€˜/’ β€˜// {print $5}’ | head -1
eno4

But the static configuration is not set:
]# more /etc/sysconfig/network-scripts/ifcfg-eno4
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eno4
UUID=cb6d9586-310c-4c44-86b9-a83c32bda24c
DEVICE=eno4
ONBOOT=no
:frowning:

Please take a moment to properly format your snips.

What defines if a host will be configured with DHCP or Static is your Subnet Boot Mode setting. Check that.

Hello,
Subnet boot mode is well set to Static.

Are there any other ifcfg files in the directory?

/etc/sysconfig/network-scripts/ifcfg-*

Yes
]# ls -l
total 36
-rw-r–r--. 1 root root 277 Apr 14 05:56 ifcfg-eno1
-rw-r–r--. 1 root root 277 Apr 14 05:56 ifcfg-eno2
-rw-r–r--. 1 root root 277 Apr 14 05:56 ifcfg-eno3
-rw-r–r--. 1 root root 277 Apr 14 05:56 ifcfg-eno4
-rw-r–r--. 1 root root 297 Apr 14 05:56 ifcfg-enp0s20f0u14u3
-rw-r–r--. 1 root root 292 Apr 14 05:56 ifcfg-ens1f0
-rw-r–r--. 1 root root 281 Apr 14 05:56 ifcfg-ens1f1
-rw-r–r--. 1 root root 281 Apr 14 05:56 ifcfg-ens1f2
-rw-r–r--. 1 root root 281 Apr 14 05:56 ifcfg-ens1f3
[root@obench29s network-scripts]# grep BOOTPRO *
ifcfg-eno1:BOOTPROTO=dhcp
ifcfg-eno2:BOOTPROTO=dhcp
ifcfg-eno3:BOOTPROTO=dhcp
ifcfg-eno4:BOOTPROTO=dhcp
ifcfg-enp0s20f0u14u3:BOOTPROTO=dhcp
ifcfg-ens1f0:BOOTPROTO=dhcp
ifcfg-ens1f1:BOOTPROTO=dhcp
ifcfg-ens1f2:BOOTPROTO=dhcp
ifcfg-ens1f3:BOOTPROTO=dhcp

I’ve also tried to disable NetworkManager. No difference.

It seems the script does not complete because some commands before the network interfaces files are not played. Is there any log file for ks-script- files ?

Postinstall script had en error. So the end of the kickstart script was not played.
Problem was the install was not reported faulty. So I did not suspect such error.
Found the error in /root/install.post.log
Thank you for your reviewing.