1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

start-networking: ifup mgmt class interfaces if present

Ticket: CM-9919
Reviewed By: dsa, daniel
Testing Done: Checked that mgmt class interfaces are brought up at boot
if present

Note that this only indicates that:
- 'mgmt' is a reserved class
- if any interfaces are tagged as 'mgmt', they will be brought up at
  boot

With this we can put out documentation saying that mgmt devices
can be put into its own class for easier management of mgmtvrf.

{noformat}
$cat /etc/network/interfaces
auto lo
iface lo inet loopback

allow-mgmt eth0
iface eth0 inet dhcp
     vrf mgmt

allow-mgmt mgmt
iface mgmt
     address 127.0.0.1/8
     vrf-table auto

$ifquery -l --allow=mgmt
eth0
mgmt

$ifquery  -l -a
lo

$ifreload --allow=mgmt
$ifup --allow=mgmt

{noformat}

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-04-21 12:58:53 -07:00
parent 4c56a7c1a7
commit 6642399fee

View File

@@ -99,6 +99,14 @@ ifup_hotplug () {
fi
}
ifup_mgmt () {
ifaces=$(ifquery --list --allow=mgmt 2>/dev/null)
if [ -n "$ifaces" ]; then
echo "bringing up mgmt class interfaces"
ifup --allow=mgmt
fi
}
ifupdown_init() {
# remove state file at boot
[ ! -e ${IFSTATE_LOCKFILE} ] && rm -f ${IFSTATE_FILE}
@@ -120,9 +128,9 @@ start)
exclusions=$(process_exclusions)
perfoptions=$(perf_options)
echo ${NAME}':' "Configuring network interfaces"
ifup_mgmt
ifup -a $EXTRA_ARGS $exclusions $perfoptions
;;
stop)
if [ "$SKIP_DOWN_AT_SYSRESET" = "yes" ]; then
SYSRESET=0