IOSIntfLine Object

class models_cisco.IOSIntfLine(*args, **kwargs)

Accept an IOS line number and initialize family relationship attributes

Warning

All IOSIntfLine methods are still considered beta-quality, until this notice is removed. The behavior of APIs on this object could change at any time.

abbvs

A python set of valid abbreviations (lowercased) for the interface

access_vlan

Return an integer with the access vlan number. Return 0, if the port has no explicit vlan configured.

add_child(childobj)

Add references to childobj, on this object

add_parent(parentobj)

Add a reference to parentobj, on this object

add_uncfgtext(unconftext)

unconftext is defined during special method calls. Do not assume it is automatically populated.

append_to_family(insertstr, indent=-1, auto_indent_width=1, auto_indent=False)

Append an IOSCfgLine object with insertstr as a child at the bottom of the current configuration family.

Args:
  • insertstr (str): A string which contains the text configuration to be apppended.
  • indent (int): The amount of indentation to use for the child line; by default, the number of left spaces provided with insertstr are respected. However, you can manually set the indent level when indent>0. This option will be ignored, if auto_indent is True.
  • auto_indent_width (int): Amount of whitespace to automatically indent
  • auto_indent (bool): Automatically indent the child to auto_indent_width
Returns:
  • str. The text matched by the regular expression group; if there is no match, None is returned.

This example illustrates how you can use append_to_family() to add a carrier-delay to each interface.

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial1/1',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> for obj in parse.find_objects(r'^interface'):
...     obj.append_to_family(' carrier-delay msec 500')
>>>
>>> for line in parse.ioscfg:
...     print line
...
!
interface Serial1/0
 ip address 1.1.1.1 255.255.255.252
 carrier-delay msec 500
!
interface Serial1/1
 ip address 1.1.1.5 255.255.255.252
 carrier-delay msec 500
!
>>>
delete(recurse=True)

Delete this object. By default, if a parent object is deleted, the child objects are also deleted; this happens because recurse defaults True.

delete_children_matching(linespec)

Delete any child IOSCfgLine objects which match linespec.

Args:
  • linespec (str): A string or python regular expression, which should be matched.
Returns:
  • list. A list of IOSCfgLine objects which were deleted.

This example illustrates how you can use delete_children_matching() to delete any description on an interface.

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' description Some lame description',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial1/1',
...     ' description Another lame description',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> for obj in parse.find_objects(r'^interface'):
...     obj.delete_children_matching(r'description')
>>>
>>> for line in parse.ioscfg:
...     print line
...
!
interface Serial1/0
 ip address 1.1.1.1 255.255.255.252
!
interface Serial1/1
 ip address 1.1.1.5 255.255.255.252
!
>>>
description

Return the current interface description string.

geneology

Iterate through to the oldest ancestor of this object, and return a list of all ancestors in the direct line as well as this obj. Cousins or aunts / uncles are not returned. Note: children of this object are not returned.

geneology_text

Iterate through to the oldest ancestor of this object, and return a list of all ancestors in the direct line as well as this obj. Cousins or aunts / uncles are not returned. Note: children of this object are not returned.

has_manual_carrierdelay

Return a python boolean for whether carrier delay is manually configured on the interface

has_no_ip_proxyarp

Return a boolean for whether no ip proxy-arp is configured on the interface.

Returns:
  • bool.

This example illustrates use of the method.

>>> from ciscoconfparse.ccp_util import IPv4Obj
>>> from ciscoconfparse import CiscoConfParse
>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     ' no ip proxy-arp',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.has_no_ip_proxyarp
True
>>>
hash_children

Return a unique hash of all children (if the number of children > 0)

in_ipv4_subnet(ipv4network=<IPv4Obj 0.0.0.0/32>)

Accept an argument for the IPv4Obj to be considered, and return a boolean for whether this interface is within the requested IPv4Obj.

Kwargs:
  • ipv4network (IPv4Obj): An object to compare against IP addresses configured on this IOSIntfLine object.
Returns:
  • bool if there is an ip address, or None if there is no ip address.

This example illustrates use of the method.

>>> from ciscoconfparse.ccp_util import IPv4Obj
>>> from ciscoconfparse import CiscoConfParse
>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sSerial')[0]
>>> obj
<IOSIntfLine # 1 'Serial1/0' info: '1.1.1.1/30'>
>>> obj.in_ipv4_subnet(IPv4Obj('1.1.1.0/24', strict=False))
True
>>> obj.in_ipv4_subnet(IPv4Obj('2.1.1.0/24', strict=False))
False
>>>
in_ipv4_subnets(subnets=None)

Accept a set or list of ccp_util.IPv4Obj objects, and return a boolean for whether this interface is within the requested subnets.

insert_after()
insert_before()
interface_number

Return a string representing the card, slot, port for this interface. If you call interface_number on GigabitEthernet2/25.100, you’ll get this python string: ‘2/25’. If you call interface_number on GigabitEthernet2/0/25.100 you’ll get this python string ‘2/0/25’. This method strips all subinterface information in the returned value.

Returns:
  • string.

Warning

interface_number should silently fail (returning an empty python string) if the interface doesn’t parse correctly

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.interface_number
'1/0'
>>> obj = parse.find_objects('^interface\sATM')[-1]
>>> obj.interface_number
'2/0'
>>>
ioscfg

Return a list with this the text of this object, and with all children in the direct line.

ipv4_addr

Return a string with the interface’s IPv4 address, or ‘’ if there is none

ipv4_addr_object

Return a ccp_util.IPv4Obj object representing the address on this interface; if there is no address, return IPv4Obj(‘127.0.0.1/32’)

ipv4_masklength

Return an integer with the interface’s IPv4 mask length, or 0 if there is no IP address on the interace

ipv4_netmask

Return a string with the interface’s IPv4 netmask, or ‘’ if there is none

ipv4_network_object

Return an ccp_util.IPv4Obj object representing the subnet on this interface; if there is no address, return ccp_util.IPv4Obj(‘127.0.0.1/32’)

is_abbreviated_as(val)

Test whether val is a good abbreviation for the interface

is_config_line

Return a boolean for whether this is a config statement; returns False if this object is a blank line, or a comment

is_ethernet_intf

Returns a boolean (True or False) to answer whether this IOSCfgLine is an ethernet interface. Any ethernet interface (10M through 10G) is considered an ethernet interface.

Returns:
  • bool.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.is_ethernet_intf
True
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.is_ethernet_intf
False
>>>
is_intf

Returns a boolean (True or False) to answer whether this IOSCfgLine is an interface; subinterfaces also return True.

Returns:
  • bool.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>> obj = parse.find_objects('^interface\sSerial')[0]
>>> obj.is_intf
True
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.is_intf
True
>>>
is_loopback_intf

Returns a boolean (True or False) to answer whether this IOSCfgLine is a loopback interface.

Returns:
  • bool.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Loopback0',
...     ' ip address 1.1.1.5 255.255.255.255',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.is_loopback_intf
False
>>> obj = parse.find_objects('^interface\sLoop')[0]
>>> obj.is_loopback_intf
True
>>>
is_subintf

Returns a boolean (True or False) to answer whether this IOSCfgLine is a subinterface.

Returns:
  • bool.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>> obj = parse.find_objects('^interface\sSerial')[0]
>>> obj.is_subintf
False
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.is_subintf
True
>>>
lineage

Iterate through to the oldest ancestor of this object, and return a list of all ancestors / children in the direct line. Cousins or aunts / uncles are not returned. Note: all children of this object are returned.

manual_arp_timeout

Return an integer with the current interface ARP timeout, if there isn’t one set, return 0. If there is no IP address, return -1

manual_carrierdelay

Return the manual carrier delay (in seconds) of the interface as a python float. If there is no explicit carrier delay, return 0.0

manual_clock_rate

Return the clock rate of the interface as a python integer. If there is no explicit clock rate, return 0

manual_holdqueue_in

Return the current hold-queue in depth, if default return 0

manual_holdqueue_out

Return the current hold-queue out depth, if default return 0

manual_mtu

Returns a integer value for the manual MTU configured on an IOSIntfLine object. Interfaces without a manual MTU configuration return 0.

Returns:
  • integer.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' mtu 4470',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.manual_mtu
0
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.manual_mtu
4470
>>>
name

Return the interface name as a string, such as ‘GigabitEthernet0/1’

Returns:
  • str. The interface name as a string, or ‘’ if the object is not an interface.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.name
'FastEthernet1/0'
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.name
'ATM2/0'
>>> obj = parse.find_objects('^interface\sATM')[1]
>>> obj.name
'ATM2/0.100'
>>>
ordinal_list

Return a tuple of numbers representing card, slot, port for this interface. If you call ordinal_list on GigabitEthernet2/25.100, you’ll get this python tuple of integers: (2, 25). If you call ordinal_list on GigabitEthernet2/0/25.100 you’ll get this python list of integers: (2, 0, 25). This method strips all subinterface information in the returned value.

Returns:
  • tuple. A tuple of port numbers as integers.

Warning

ordinal_list should silently fail (returning an empty python list) if the interface doesn’t parse correctly

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.ordinal_list
(1, 0)
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.ordinal_list
(2, 0)
>>>
port

Return the interface’s port number

Returns:
  • int. The interface number.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.port
0
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.port
0
>>>
port_type

Return Loopback, ATM, GigabitEthernet, Virtual-Template, etc...

Returns:
  • str. The port type.

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.port_type
'FastEthernet'
>>> obj = parse.find_objects('^interface\sATM')[0]
>>> obj.port_type
'ATM'
>>>
re_match(regex, group=1, default='')

Use regex to search the IOSCfgLine text and return the regular expression group, at the integer index.

Args:
  • regex (str): A string or python regular expression, which should be matched. This regular expression should contain parenthesis, which bound a match group.
Kwargs:
  • group (int): An integer which specifies the desired regex group to be returned. group defaults to 1.
  • default (str): The default value to be returned, if there is no match. By default an empty string is returned if there is no match.
Returns:
  • str. The text matched by the regular expression group; if there is no match, default is returned.

This example illustrates how you can use re_match() to store the mask of the interface which owns “1.1.1.5” in a variable called netmask.

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial1/1',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> for obj in parse.find_objects(r'ip\saddress'):
...     netmask = obj.re_match(r'1\.1\.1\.5\s(\S+)')
>>>
>>> print "The netmask is", netmask
The netmask is 255.255.255.252
>>>
re_match_iter_typed(regex, group=1, result_type=<type 'str'>, default='')

Use regex to search the children of IOSCfgLine text and return the contents of the regular expression group, at the integer group index, cast as result_type; if there is no match, default is returned.

Args:
  • regex (str): A string or python compiled regular expression, which should be matched. This regular expression should contain parenthesis, which bound a match group.
Kwargs:
  • group (int): An integer which specifies the desired regex group to be returned. group defaults to 1.
  • result_type (type): A type (typically one of: str, int, float, or IPv4Obj). All returned values are cast as result_type, which defaults to str.
  • default (any): The default value to be returned, if there is no match.
Returns:
  • result_type. The text matched by the regular expression group; if there is no match, default is returned. All values are cast as result_type.

This example illustrates how you can use re_match_iter_typed() to build an IPv4Obj() address object for each interface.

>>> from ciscoconfparse import CiscoConfParse
>>> from ciscoconfparse.ccp_util import IPv4Obj
>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial2/0',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>> INTF_RE = re.compile(r'interface\s\S+')
>>> ADDR_RE = re.compile(r'ip\saddress\s(\S+\s+\S+)')
>>> for obj in parse.find_objects(INTF_RE):
...     print obj.text, obj.re_match_iter_typed(ADDR_RE, result_type=IPv4Obj)
interface Serial1/0 <IPv4Obj 1.1.1.1/30>
interface Serial2/0 <IPv4Obj 1.1.1.5/30>
>>>
re_match_typed(regex, group=1, result_type=<type 'str'>, default='')

Use regex to search the IOSCfgLine text and return the contents of the regular expression group, at the integer group index, cast as result_type; if there is no match, default is returned.

Args:
  • regex (str): A string or python regular expression, which should be matched. This regular expression should contain parenthesis, which bound a match group.
Kwargs:
  • group (int): An integer which specifies the desired regex group to be returned. group defaults to 1.
  • result_type (type): A type (typically one of: str, int, float, or IPv4Obj). All returned values are cast as result_type, which defaults to str.
  • default (any): The default value to be returned, if there is no match.
Returns:
  • result_type. The text matched by the regular expression group; if there is no match, default is returned. All values are cast as result_type.

This example illustrates how you can use re_match_typed() to build an association between an interface name, and its numerical slot value. The name will be cast as str(), and the slot will be cast as int().

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial2/0',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> slots = dict()
>>> for obj in parse.find_objects(r'^interface'):
...     name = obj.re_match_typed(regex=r'^interface\s(\S+)',
...         default='UNKNOWN')
...     slot = obj.re_match_typed(regex=r'Serial(\d+)',
...         result_type=int,
...         default=-1)
...     print "Interface {0} is in slot {1}".format(name, slot)
...
Interface Serial1/0 is in slot 1
Interface Serial2/0 is in slot 2
>>>

Use regex to search this IOSCfgLine‘s text.

Args:
  • regex (str): A string or python regular expression, which should be matched.
Kwargs:
  • default (str): A value which is returned if re_search() doesn’t find a match while looking for regex.
Returns:
  • str. The IOSCfgLine text which matched. If there is no match, default is returned.
re_search_children(regex)

Use regex to search the text contained in the children of this IOSCfgLine.

Args:
  • regex (str): A string or python regular expression, which should be matched.
Returns:
  • list. A list of matching IOSCfgLine objects which matched. If there is no match, an empty list() is returned.
re_sub(regex, replacergx, ignore_rgx=None)

Replace all strings matching linespec with replacestr in the IOSCfgLine object; however, if the IOSCfgLine text matches ignore_rgx, then the text is not replaced.

Args:
  • linespec (str): A string or python regular expression, which should be matched.
  • replacestr (str): A string or python regular expression, which should replace the text matched by linespec.
Kwargs:
  • ignore_rgx (str): A string or python regular expression; the replacement is skipped if IOSCfgLine text matches ignore_rgx. ignore_rgx defaults to None, which means no lines matching linespec are skipped.
Returns:
  • str. The new text after replacement

This example illustrates how you can use re_sub() to replace Serial1 with Serial0 in a configuration...

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial1/1',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> for obj in parse.find_objects('Serial'):
...     print "OLD", obj.text
...     obj.re_sub(r'Serial1', r'Serial0')
...     print "  NEW", obj.text
OLD interface Serial1/0
  NEW interface Serial0/0
OLD interface Serial1/1
  NEW interface Serial0/1
>>>
replace(linespec, replacestr, ignore_rgx=None)

Replace all strings matching linespec with replacestr in the IOSCfgLine object; however, if the IOSCfgLine text matches ignore_rgx, then the text is not replaced. The replace() method is simply an alias to the re_sub() method.

Args:
  • linespec (str): A string or python regular expression, which should be matched
  • replacestr (str): A string or python regular expression, which should replace the text matched by linespec.
Kwargs:
  • ignore_rgx (str): A string or python regular expression; the replacement is skipped if IOSCfgLine text matches ignore_rgx. ignore_rgx defaults to None, which means no lines matching linespec are skipped.
Returns:
  • str. The new text after replacement

This example illustrates how you can use replace() to replace Serial1 with Serial0 in a configuration...

>>> config = [
...     '!',
...     'interface Serial1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface Serial1/1',
...     ' ip address 1.1.1.5 255.255.255.252',
...     '!',
...     ]
>>> parse = CiscoConfParse(config)
>>>
>>> for obj in parse.find_objects('Serial'):
...     print "OLD", obj.text
...     obj.replace(r'Serial1', r'Serial0')
...     print "  NEW", obj.text
OLD interface Serial1/0
  NEW interface Serial0/0
OLD interface Serial1/1
  NEW interface Serial0/1
>>>
subinterface_number

Return a string representing the card, slot, port for this interface or subinterface. If you call subinterface_number on GigabitEthernet2/25.100, you’ll get this python string: ‘2/25.100’. If you call interface_number on GigabitEthernet2/0/25 you’ll get this python string ‘2/0/25’. This method strips all subinterface information in the returned value.

Returns:
  • string.

Warning

subinterface_number should silently fail (returning an empty python string) if the interface doesn’t parse correctly

This example illustrates use of the method.

>>> config = [
...     '!',
...     'interface FastEthernet1/0',
...     ' ip address 1.1.1.1 255.255.255.252',
...     '!',
...     'interface ATM2/0',
...     ' no ip address',
...     '!',
...     'interface ATM2/0.100 point-to-point',
...     ' ip address 1.1.1.5 255.255.255.252',
...     ' pvc 0/100',
...     '  vbr-nrt 704 704',
...     '!',
...     ]
>>> parse = CiscoConfParse(config, factory=True)
>>> obj = parse.find_objects('^interface\sFast')[0]
>>> obj.subinterface_number
'1/0'
>>> obj = parse.find_objects('^interface\sATM')[-1]
>>> obj.subinterface_number
'2/0.100'
>>>