Add support to allow configeth to setup vlan interface
diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index c9e7306..4bf8541 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -27,6 +27,9 @@ function configipv4(){ echo "NETWORK_${num_v4num}=${str_v4net}" >> $str_conf_file echo "LABEL_${num_v4num}=${num_v4num}" >> $str_conf_file fi + if [[ ${str_if_name} == eth[0-9]*.[0-9]* ]]; then + echo "VLAN=yes" >> $str_conf_file + fi #debian ubuntu elif [ "$str_os_type" = "debian" ];then str_conf_file="/etc/network/interfaces.d/${str_if_name}" @@ -40,6 +43,10 @@ function configipv4(){ echo " address ${str_v4ip}" >> $str_conf_file echo " netmask ${str_v4mask}" >> $str_conf_file echo " network ${str_v4net}" >> $str_conf_file + if [[ ${str_if_name} == eth[0-9]*.[0-9]* ]]; then + parent_device=`echo ${str_if_name} | sed -e 's/\(eth[0-9]*\)\.[0-9]*/\1/g'` + echo " vlan-raw-device ${parent_device}" >> $str_conf_file + fi else # Write the info to the ifcfg file for redhat str_conf_file="" @@ -56,6 +63,9 @@ function configipv4(){ echo "IPADDR=${str_v4ip}" >> $str_conf_file echo "NETMASK=${str_v4mask}" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file + if [[ ${str_if_name} == eth[0-9]*.[0-9]* ]]; then + echo "VLAN=yes" >> $str_conf_file + fi fi }
Diff:
any update in this please?
thanks
xCAT development team reviewed this bug last week, we agreed that this is a valid problem, and I will fix it in 2.8.4. Thanks.
thanks for the update
Fixed in 2.8.4 and 2.9.
2.8.4:commit a171f853fdd257c33bda8cf2b96bb975fad86137
2.9: commit 9766383d682616b3b38984f1f2c8ecc4e42ecbdf
Arif,
I made some minor updates to your patch, changed the interface name regular expression from eth[0-9].[0-9] to [a-zA-Z0-9].[0-9], to cover the configuration in which the nic name is not ethx, for example, on new fedora and RHEL 7, the ethernet interface name is emx instead of ethx. If you have any concern with this, please let me know.