예제 #1
0
 def add(self, value):
     """Add vlan or range of vlans (range: 100..200)"""
     try:
         value = int(value)
         if value not in self._trunk_vlans:
             self._trunk_vlans.append(types.VlanId(value).vlan_id)
     except ValueError:
         if value not in self._trunk_vlans:
             self._trunk_vlans.append(types.VlanRange(value).vlan_range)
예제 #2
0
 def vlan_id(self, value: int):
     if not isinstance(value, int):
         raise TypeError(f'vlan_id must be integer, got {type(value)}')
     self._vlan_id = types.VlanId(value)
예제 #3
0
 def access_vlan(self, value: int):
     """Set access VLAN assigned to the interfaces"""
     self._access_vlan = types.VlanId(value)
예제 #4
0
 def vlan_id(self, value: int):
     self._vlan_id = types.VlanId(value)
예제 #5
0
    def native_vlan(self, value: int):
        """Set native VLAN

        is valid for trunk mode interfaces
        """
        self._native_vlan = types.VlanId(value)