- guest_ifcfg=${lxc_root}/etc/sysconfig/network-scripts/ifcfg-$VIF_GUEST
- ( [ -n "$NAT_MODE" ] && write_guest_ifcfg_natip || write_guest_ifcfg_publicip ) > $guest_ifcfg
+ local guest_ifcfg=${lxc_root}/etc/sysconfig/network-scripts/ifcfg-$VIF_GUEST
+ mkdir -p $(dirname ${guest_ifcfg})
+ # starting with f29, we go for NetworkManager as older network-scripts
+ # is about to be deprecated
+ local nm_controlled=false
+ [[ $fcdistro == f29 ]] && nm_controlled=true
+ [[ $fcdistro == f3[0-9] ]] && nm_controlled=true
+
+ if [ -n "$NAT_MODE" ]; then
+ write_guest_ifcfg_natip $nm_controlled
+ else
+ write_guest_ifcfg_publicip $nm_controlled
+ fi > $guest_ifcfg