ClearFoundation Tracker - ClearOS
View Issue Details
0014241ClearOSapp-network - Network Settingspublic2017-04-06 02:442018-10-25 10:19
dloper 
user2 
normalfeaturealways
closedfixed 
7.3.1 
7.5.0 Updates7.5.0 Updates 
0014241: virbrN interfaces need to also show up as bridge interfaces within ClearOS
virtualization br interfaces are virbr and should show up in the interfaces list similar to br interfaces.
No tags attached.
Issue History
2017-04-06 02:44dloperNew Issue
2017-04-06 02:49dloperNote Added: 0005221
2017-04-06 03:20dloperNote Added: 0005231
2017-04-06 07:42user2Severityminor => feature
2017-04-06 07:42user2Statusnew => confirmed
2017-08-11 12:30dloperTarget Version7.3.1 Updates => 7.4.0 Updates
2018-04-11 10:36user2Note Added: 0007401
2018-04-11 10:36user2Target Version7.4.0 Updates => 7.5.0
2018-04-19 08:43user2Target Version7.5.0 => 7.5.0 Updates
2018-10-25 09:20user2Statusconfirmed => resolved
2018-10-25 09:20user2Fixed in Version => 7.5.0 Updates
2018-10-25 09:20user2Resolutionopen => fixed
2018-10-25 09:20user2Assigned To => user2
2018-10-25 10:19user2Statusresolved => closed

Notes
(0005221)
dloper   
2017-04-06 02:49   
Instead of going by the interface name, we should look at the type within the file. Bridge interfaces can be named whatever they want to be but are always enumerated with the parameter TYPE="Bridge" or TYPE=Bridge
(0005231)
dloper   
2017-04-06 03:20   
add:
            || preg_match('/^virbr/', $this->iface)
in:
/usr/clearos/apps/network/libraries/Iface.php

code snippet:
    public function is_configurable()
    {
        clearos_profile(__METHOD__, __LINE__);

        // PPPoE interfaces are configurable, but only if they already configured.

        if (preg_match('/^eth/', $this->iface)
            || preg_match('/^wlan/', $this->iface)
            || preg_match('/^ath/', $this->iface)
            || preg_match('/^wlp/', $this->iface)
            || preg_match('/^em/', $this->iface)
            || preg_match('/^en/', $this->iface)
            || preg_match('/^p\d+p/', $this->iface)
            || preg_match('/^br/', $this->iface)
            || preg_match('/^virbr/', $this->iface)
            || preg_match('/^bond/', $this->iface)
            || preg_match('/^netw/', $this->iface)
            || (preg_match('/^ppp/', $this->iface) && $this->is_configured())
        ) {
            return TRUE;
        } else {
            return FALSE;
        }
    }

======================================

add:
            if (preg_match('/^virbr/', $netinfo['device']))
                return self::TYPE_BRIDGED;
in:
/usr/clearos/apps/network/libraries/Iface.php

code snippet:
        if (isset($netinfo['device'])) {
            if (preg_match('/^br/', $netinfo['device']))
                return self::TYPE_BRIDGED;

            if (preg_match('/^virbr/', $netinfo['device']))
                return self::TYPE_BRIDGED;

            if (preg_match('/^bond/', $netinfo['device']))
                return self::TYPE_BONDED;
        }
(0007401)
user2   
2018-04-11 10:36   
The Iface->is_configurable() API call is used to enumerate unconfigured interfaces (i.e. no config file exists). Software packages can come along and create all sorts of network interfaces. For example, Docker creates docker0 and vethX network interfaces... and we don't want these to show up as network interfaces in the ClearOS UI!

The Iface->get_type() API call does what you expect -- it grabs information from the ifcfg-X configuration files to determine the type.