CiscoIosInterfaceLine¶
-
class
CiscoIosInterfaceLine
(number, text, config, verbosity=3)¶ Bases:
ccutils.ccparser.BaseInterfaceLine.BaseInterfaceLine
-
access_vlan
¶ Return a number of access VLAN or None if the command
switchport access vlan x
is not present.Caution: This does not mean the interface is necessarily an access port.
Returns: Number of access VLAN or None Returns
None
if absentReturn type: int
-
bandwidth
¶ Return bandwidth of the interface set by command bandwidth X.
Returns: Bandwidth Returns
None
if absentReturn type: int
-
bfd
¶
-
cdp
¶ Checks whether CDP is enabled on the interface. This property takes global CDP configuration into account, meaning if there is no specific configuration on the interface level, it will return state based on the entire config (eg. no cdp run in the global config will make this property be False)
Returns: True
if CDP is enabled,False
otherwiseReturn type: bool
-
channel_group
¶ Return a dictionary describing Port-channel/Etherchannel related configuration
Returns: Channel-group parameters Example:
{"channel_group_number": "1", "channel_group_mode": "active"}
Otherwise returns
None
Return type: dict
-
delay
¶ Return delay of the interface set by command delay X.
Returns: Delay Returns
None
if absentReturn type: int
-
description
¶ Returns description of the interface.
Returns: Interface description Returns
None
if absentReturn type: str
-
device_tracking_policy
¶
-
duplex
¶ Return duplex of the interface set by command duplex X.
Returns: Duplex Returns
None
if absentReturn type: str
-
encapsulation
¶ Return encapsulation type and tag for subinterfaces
Returns: Encapsualtion parameters Example:
{"type": "dot1q", "tag": 10, "native": False}
Returns
None
if absentReturn type: dict
-
flags
¶ List of flags/tags describing basic properties of the interface. Used for filtering purposes. Currently supported flags are:
l2
- Interface is switched portl3
- Interface is routed portphysical
- Interface is a physical interface (Only *Ethernet interfaces)svi
- Interface is SVI (VLAN Interface)port-channel
- Interface is port-channelpc-member
- Interface is a member of Port-channeltunnel
- Interface is a TunnelReturns: List of flags Return type: list
-
get_unprocessed
¶ Return a list of config lines under the interface, which did not match any of the existing regex patterns. Mostly for development/testing purposes.
By default returns list of objects.
Parameters: return_type (str) – Set this to “text” to receive list of strings Returns: List of unprocessed config lines Return type: list
-
helper_address
¶ Return a list of IP addresses specified with ip helper-address command (DHCP relay).
Returns: List of helper addresses Returns
None
if absentReturn type: list
-
interface_description
¶
-
interface_name
¶
-
ip_addresses
¶ Return list of IP addresses present on the interface
Returns: List of dictionaries representing individual IP addresses Example:
[ { "ip_address": "10.0.0.1", "mask": "255.255.255.0", "secondary": False }, { "ip_address": "10.0.1.1", "mask": "255.255.255.0", "secondary": True } ]
If there is no IP address present on the interface, an empty list is returned.
Return type: list
-
ip_mtu
¶ Return IP MTU of the interface set by command ip mtu X.
Returns: IP MTU Returns
None
if absentReturn type: int
-
ip_unnumbered_interface
¶
-
isis
¶ Return IS-IS interface parameters
Returns: IS-IS parameters Example:
{}
Returns
None
if absentReturn type: dict
-
keepalive
¶
-
load_interval
¶ Return Load Interval of the interface set by command load-interval X.
Returns: Load Interval Returns
None
if absentReturn type: int
-
logging_events
¶
-
mtu
¶ Return MTU of the interface set by command mtu X.
Returns: MTU Returns
None
if absentReturn type: int
-
name
¶ Return name of the interface, such as GigabitEthernet0/1.
Returns: Name of the interface Return type: str
-
native_vlan
¶ Return Native VLAN of L2 Interface
Returns: Native VLAN Number (None if absent) Returns
None
if absentReturn type: int
-
negotiation
¶
-
ospf
¶ Return OSPF interface parameters
Returns: OSPF parameters Example:
{"process_id": 1, "area": 0, "network_type": "point-to-point", "priority": 200}
Returns
None
if absentReturn type: dict
-
ospf_priority
¶ Returns OSPF priority of the interface.
Returns: OSPF Priority or None Return type: int
-
port_mode
¶ Checks whether the interface is running in switched (l2) or routed (l3) mode.
Returns: l2 or l3 Return type: str
-
service_instances
¶
-
service_policy
¶ Return names of applied service policies
Returns: Dictionary containing names of both input and output policies. Example:
{"input": "TEST_INPUT_POLICY", "output": "TEST_OUTPUT_POLICY"}
If there are no policies specified, returns:
{"input": None, "output": None}
Return type: dict
-
shutdown
¶
-
speed
¶ Return speed of the interface set by command speed X
Returns: Speed Returns
None
if absentReturn type: int
-
standby
¶ HSRP related configuration. Groups, IP addresses, hello/hold timers, priority and authentication.
Returns: Dictionary with top level keys being HSRP groups.
-
storm_control
¶
-
switchport_mode
¶ Return L2 Mode of interface, either access or trunk
Returns: “access” or “trunk” Returns
None
if absentReturn type: str
-
switchport_nonegotiate
¶ Check whether the port is running DTP or not. Checks for presence of
switchport nonegotiate
commandReturns: True
if command is present,False
otherwiseReturn type: bool
-
tcp_mss
¶ Return TCP Max Segment Size of the interface set by command ip tcp adjust-mss X.
Returns: TCP MSS Returns
None
if absentReturn type: int
-
trunk_allowed_vlans
¶ Return a expanded list of VLANs allowed with
switchport trunk allowed vlan x,y,z
.Caution: This does not mean the interface is necessarily a trunk port.
Returns: Expanded list of allowed VLANs Returns
None
if absentReturns “none” if
switchport trunk allowed vlan none
Return type: list
-
trunk_encapsulation
¶ Return encapsulation on trunk interfaces
Returns: “dot1q” or “isl” Returns
None
if absentReturn type: str
-
tunnel_properties
¶ Return properties related to Tunnel interfaces
Returns: Dictionary with tunnel properties. Example:
{ "source": "Loopback0", "destination": "10.0.0.1", "vrf": None, "mode": "ipsec ipv4", "ipsec_profile": "TEST_IPSEC_PROFILE" }
Returns
None
if absentReturn type: dict
-
voice_vlan
¶ Return a number of voice VLAN
Returns: Number of voice VLAN or None Returns
None
if absentReturn type: int
-
vrf
¶ Return VRF of the interface
Returns: Name of the VRF Returns
None
if absentReturn type: str
-