]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
start-networking: ifup mgmt class interfaces if present
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Thu, 21 Apr 2016 19:58:53 +0000 (12:58 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Thu, 21 Apr 2016 20:11:22 +0000 (13:11 -0700)
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>
sbin/start-networking

index 6f1fad44bc84b931aafcc3df4c9e9efb4a04cde1..5b14f486dfa78c721a6f60b4102e70dfc64d62f9 100755 (executable)
@@ -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