Change VLAN interface naming scheme

The VLAN alias interface name may exceed the maximum interface
name length as defined by the kernel, depending on some hardware.
This commit changes the vlan naming convention from device name plus
VLAN ID to VLAN plus VLAN ID.

Closes-Bug: 1817593
Depends-On: https://review.opendev.org/#/c/686728/

Change-Id: I8a74e1d47e0ab3ef261f9512a8887d7f0de66064
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
Teresa Ho 2019-10-04 16:09:23 -04:00
parent 069daf1e22
commit d6ea5446e9

View File

@ -94,7 +94,7 @@ else
# Persist the boot device to the platform configuration. This will get # Persist the boot device to the platform configuration. This will get
# overwritten later if the management_interface is on a bonded interface. # overwritten later if the management_interface is on a bonded interface.
echo management_interface=$mgmt_dev.$mgmt_vlan >> /etc/platform/platform.conf echo management_interface=vlan$mgmt_vlan >> /etc/platform/platform.conf
# Build networking scripts # Build networking scripts
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-lo cat << EOF > /etc/sysconfig/network-scripts/ifcfg-lo
@ -116,14 +116,15 @@ IPV6_AUTOCONF=no
LINKDELAY=20 LINKDELAY=20
EOF EOF
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$mgmt_dev.$mgmt_vlan cat << EOF > /etc/sysconfig/network-scripts/ifcfg-vlan$mgmt_vlan
DEVICE=$mgmt_dev.$mgmt_vlan DEVICE=vlan$mgmt_vlan
BOOTPROTO=dhcp BOOTPROTO=dhcp
DHCLIENTARGS=$dhclientargs DHCLIENTARGS=$dhclientargs
IPV6INIT=$ipv6init IPV6INIT=$ipv6init
DHCPV6C=$dhcpv6c DHCPV6C=$dhcpv6c
ONBOOT=yes ONBOOT=yes
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
PHYSDEV=$mgmt_dev
VLAN=yes VLAN=yes
LINKDELAY=20 LINKDELAY=20
EOF EOF
@ -136,7 +137,7 @@ EOF
# Bring up the mgmt vlan so that a dhcp lease is acquired and an address is # Bring up the mgmt vlan so that a dhcp lease is acquired and an address is
# setup prior to the post-install reboot. This is so that the timing of the IP # setup prior to the post-install reboot. This is so that the timing of the IP
# address allocation is similar to how normal/non-pxe installation works. # address allocation is similar to how normal/non-pxe installation works.
mgmt_iface=$mgmt_dev.$mgmt_vlan mgmt_iface=vlan$mgmt_vlan
dhclient_family=$([[ $mgmt_address_family == "inet" ]] && echo -4 || echo -6) dhclient_family=$([[ $mgmt_address_family == "inet" ]] && echo -4 || echo -6)
ip link add link $mgmt_dev name $mgmt_iface type vlan id $mgmt_vlan ip link add link $mgmt_dev name $mgmt_iface type vlan id $mgmt_vlan
ip link set up dev $mgmt_iface ip link set up dev $mgmt_iface