Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cisco_ios_show_ip_interface does not deal with ip address negotiated on Tunnel interface #644

Closed
cdwchriburg opened this issue Apr 7, 2020 · 2 comments · Fixed by #670
Closed

Comments

@cdwchriburg
Copy link

ISSUE TYPE
  • Bug Report
TEMPLATE USING
Value Required INTF (\S+)
Value LINK_STATUS (.+?)
Value PROTOCOL_STATUS (.+?)
Value List IPADDR (\S+?)
Value List MASK (\d*)
Value VRF (\S+)
Value MTU (\d+)
Value List IP_HELPER (\d+\.\d+\.\d+\.\d+)
Value OUTGOING_ACL (.*?)
Value INBOUND_ACL (.*?)


Start
  ^\S -> Continue.Record
  ^${INTF}\s+is\s+${LINK_STATUS},\s+line\s+protocol\s+is\s+${PROTOCOL_STATUS}\s*$$
  ^\s+Internet\s+address\s+is\s+${IPADDR}/?${MASK}\s*$$
  ^\s+Secondary\s+address\s+${IPADDR}/?${MASK}\s*$$
  ^.+VPN\s+Routing/Forwarding\s+"${VRF}"
  ^\s+MTU\s+is\s+${MTU}\s+bytes
  ^\s+Helper\s+address(es|)\s(is|are)\s+${IP_HELPER}\s*$$ -> HELPERS
  ^\s+Outgoing\s+(?:Common\s+)?access\s+list\s+is\s+not\s+set
  ^\s+Outgoing\s+(?:Common\s+)?access\s+list\s+is\s+${OUTGOING_ACL}\s*$$
  ^\s+Inbound\s+(?:Common\s+)?access\s+list\s+is\s+not\s+set
  ^\s+Inbound\s+(?:Common\s+)?access\s+list\s+is\s+${INBOUND_ACL}\s*$$
  ^\s+Internet\s+protocol
  ^\s+Interface\s+is\s+unnumbered
  ^\s+Peer\s+address
  ^\s+Dialer
  ^\s+Broadcast
  ^\s+Multicast
  ^\s+2[2-5]\d\.
  ^\s+Address\s+determined
  ^\s+Peer
  ^\s+Directed
  ^\s+MTU
  ^\s+Helper
  ^\s+Directed
  ^\s+Outgoing
  ^\s+Inbound
  ^\s+.*Proxy
  ^\s+Security
  ^\s+Split
  ^\s+ICMP
  ^\s+IP\s+(?:fast|Flow|CEF|Null|multicast|route|output|access)
  ^\s+Downstream
  ^\s+Associated
  ^\s+Topology
  ^\s+Router
  ^\s+TCP
  ^\s+RTP
  ^\s+Probe
  ^\s+Policy
  ^\s+Network\s+address\s+
  ^\s+BGP
  ^\s+Sampled\s+Netflow
  ^\s+IP\s+(Routed|Bridged)\s+Flow
  ^\s+(Input|Output|Post)\s+.*features
  ^\s+(IPv4\s+)?WCCP
  ^\s*$$
  # Capture time-stamp if vty line has command time-stamping turned on
  ^Load\s+for\s+
  ^Time\s+source\s+is
  ^. -> Error

HELPERS
  ^\s+${IP_HELPER}\s*$$
  ^\s+Directed -> Start
  ^.* -> Error
SAMPLE COMMAND OUTPUT
Tunnel500 is up, line protocol is down
  Internet address will be negotiated using IKEv2 Modeconfig
  Broadcast address is 255.255.255.255
  MTU is 1456 bytes
SUMMARY

When parsing show ip interfaces on a device with a tunnel configured with ip address negotiated the config fails to parse using the ntc-template for this command.

STEPS TO REPRODUCE

Configure tunnel:

interface Tunnel100
 ip address negotiated
end

Get show ip interface output using ntc-templates with TextFSM parsing

deviceDict = {
	"host": "192.168.1.1",
	"username": "admin",
	"password": "cisco",
	"device_type": "cisco_ios",
}
connection = netmiko.ConnectHandler(**deviceDict)
interfaceOutput = connection.send_command("show ip interface", use_textfsm=True)
seedConnection.disconnect()
EXPECTED RESULTS

I would expect either the IP address for this would be returned with a special value (e.g. something like "negotiated") or would not be returned. Possibly returning null value for IP would make the most sense in this case?

ACTUAL RESULTS

TextFSM raises an exception since its unable to parse the output correctly

textfsm.parser.TextFSMError: State Error raised. Rule Line: 63. Input Line:   Internet address will be negotiated using IKEv2 Modeconfig
@FragmentedPacket
Copy link
Contributor

@cdwchriburg Please test submitted PR and let me know if that fixes your issue.

@cdwchriburg
Copy link
Author

Yes, the PR appears to fix the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants