使用Netconf管理Cisco网络设备
Posted networking
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用Netconf管理Cisco网络设备相关的知识,希望对你有一定的参考价值。
测试环境:Cisco CSR1000V虚拟化环境
Step 1:开启Cisco设备netconf-Yang,如下图:
CSR1000V(config)#netconf-yang
CSR1000V(config)#netconf-yang ssh port 830
Step 2:配置AAA
CSR1000V(config)#aaa new-model
CSR1000V(config)#aaa authorization exec default local
Step 3:查看netconf-Yang配置
CSR1000V#show platform software yang-management process
confd : Running
nesd : Running
syncfd : Running
ncsshd : Running
dmiauthd : Running
vtyserverutild : Running
opdatamgrd : Running
ngnix : Running
附配置文件:
version 16.4
service timestamps debug datetime msec
service timestamps log datetime msec
no platform punt-keepalive disable-kernel-core
platform console auto
!
hostname CSR1000V
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$EyMO$IFGbXXBCiWsUq/N9Nrzyg1
!
aaa new-model
!
!
aaa authorization exec default local
!
!
!
!
!
aaa session-id common
!
!
!
!
!
!
!
!
!
ip domain name cisco.com
!
!
!
!
!
!
!
!
!
!
subscriber templating
!
!
!
multilink bundle-name authenticated
!
!
!
!
!
crypto pki trustpoint TP-self-signed-2486061073
enrollment selfsigned
subject-name cn=ios-Self-Signed-Certificate-2486061073
revocation-check none
rsakeypair TP-self-signed-2486061073
!
!
crypto pki certificate chain TP-self-signed-2486061073
certificate self-signed 01
30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030
31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
69666963 6174652D 32343836 30363130 3733301E 170D3139 30363137 30313433
35375A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D32 34383630
36313037 33308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201
0A028201 0100A11C B1E382EB 9D9CF6CD 857D1F86 1BA3C2A7 A421769C BE1B8861
2C8A61EB 6062547D 2C5B16C7 937714BC EE9496F3 59729571 2792B5D5 5440E09B
C42EC60A D744E30D AD4F16B0 7E756F2B 5CDEB554 9D9D5E82 C854219F D97FBADC
07AD7BD4 E915EDA6 0BB756CE 974043B1 44E24777 C0991BFD 9F7FB2CF 6B5EE0BF
EFA0FD35 6A7969DE DB441727 0614E0A0 0A82181F F70109D3 2BCDC2E6 7BB657ED
EEB9E5E9 C5D727B7 4A0F0245 0C6D7F32 A3B340E5 79C69962 55CEFDFA 9702BDF1
CF51419D 2E3FF490 4235A8F1 ABB8B0ED BEE35789 0CAADE77 176082EF 8C687CAC
AC11AE51 515E0818 DB4E77AA 014D3BA0 456305CF ADAEB10E 907CF3C2 C2AC9589
BC9143BC 904B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF
301F0603 551D2304 18301680 14AA70B5 41780650 94D75910 18614801 139F3E51
3D301D06 03551D0E 04160414 AA70B541 78065094 D7591018 61480113 9F3E513D
300D0609 2A864886 F70D0101 05050003 82010100 3FAA16B0 D110FF20 DEC3D85E
98F87B2A 748350BB 71A854AD F32E3DA9 CEFE181B 9AB9BE80 574168A7 3F011ED4
E51E7E01 4DBD1F7E 5C10A0FB 3F6E2A58 3A62F989 E022E53D 227D60AD 17D30BAC
41523589 AB87F1E6 81606280 416D0306 96777BB5 7012943D FD30F18C FE2D65E5
0C9F8FCE E64252D5 02AAD7D4 09853E89 8F0EFDB1 E0FE371C D02BE009 472EDBC1
9CB025CF F02DF230 088B890F BBCFD378 10AA6ED4 EB135C43 03D16848 450100C2
068F87D2 7D1449D8 9C4B6D9E AAE791D2 3B6A5B0A B871A93F 9BD729DF 301A2277
7153BABC BE42A970 92A81AB7 269F6EF6 9873F8C1 EB747F75 9881F1DC 2CFB35DF
8BC05006 5C87EC7F 67616742 231FFD68 65BB6503
quit
!
!
!
!
!
!
!
license udi pid CSR1000V sn 9U8UJUQ3U0O
license boot level ax
diagnostic bootup level minimal
!
spanning-tree extend system-id
netconf-yang cisco-odm actions ACL
netconf-yang cisco-odm actions BGP
netconf-yang cisco-odm actions OSPF
netconf-yang cisco-odm actions Archive
netconf-yang cisco-odm actions IPRoute
netconf-yang cisco-odm actions EFPStats
netconf-yang cisco-odm actions IPSLAStats
netconf-yang cisco-odm actions Interfaces
netconf-yang cisco-odm actions Environment
netconf-yang cisco-odm actions FlowMonitor
netconf-yang cisco-odm actions MemoryStats
netconf-yang cisco-odm actions BFDNeighbors
netconf-yang cisco-odm actions BridgeDomain
netconf-yang cisco-odm actions CPUProcesses
netconf-yang cisco-odm actions LLDPNeighbors
netconf-yang cisco-odm actions VirtualService
netconf-yang cisco-odm actions MemoryProcesses
netconf-yang cisco-odm actions EthernetCFMStats
netconf-yang cisco-odm actions MPLSLDPNeighbors
netconf-yang cisco-odm actions PlatformSoftware
netconf-yang cisco-odm actions MPLSStaticBinding
netconf-yang cisco-odm actions MPLSForwardingTable
netconf-yang
!
!
username admin privilege 15 secret 5 $1$1U/S$7ZnTHY6orTeSU4HPGR7G81
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet1
ip address 192.168.188.150 255.255.0.0
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet2
no ip address
shutdown
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet3
no ip address
shutdown
negotiation auto
no mop enabled
no mop sysid
!
!
virtual-service csr_mgmt
ip shared host-interface GigabitEthernet1
activate
!
ip forward-protocol nd
ip http server
ip http authentication local
ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 GigabitEthernet1 192.168.188.254
ip ssh rsa keypair-name ssh-key
ip ssh version 2
!
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
stopbits 1
line vty 0 4
transport input ssh
!
!
!
!
!
!
end
以上是关于使用Netconf管理Cisco网络设备的主要内容,如果未能解决你的问题,请参考以下文章