Example for Configuring Switches to Communicate with the NMS in NETCONF over SSH Mode
Networking Requirements
In Figure 13-5, an enterprise network administrator uses the NETCONFc as the NMS to configure and manage switches on the network, improving network configuration and maintenance efficiency.
Configuration Roadmap
Configure NETCONF connections between the NMS and switches so that you can configure and manage the switches using NETCONF. The following uses SwitchA as an example. The configuration of SwitchB is similar to that of SwitchA, and is not mentioned here.
- Configure interfaces and VLANs. Configure routes between switches and NMS. The configuration procedure is not provided here.
- Configure a NETCONF user.
- Configure NETCONF on switches.
- Configure the NETCONFc. For details about how to use the NETCONFc, see the NETCONFc documentation.
Procedure
- Configure interfaces and VLANs.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface Vlanif10 [SwitchA-Vlanif10] ip address 192.168.10.1 24 [SwitchA-Vlanif10] quit
- Configure a NETCONF user.
[SwitchA] user-interface vty 0 4 [SwitchA-ui-vty0-4] authentication-mode aaa [SwitchA-ui-vty0-4] protocol inbound ssh [SwitchA-ui-vty0-4] quit [SwitchA] aaa [SwitchA-aaa] local-user huawei password irreversible-cipher Huawei@2017 //Create local user huawei. [SwitchA-aaa] local-user huawei privilege level 15 [SwitchA-aaa] local-user huawei service-type api //Configure the local user huawei as a NETCONF user. [SwitchA-aaa] quit
- Configure NETCONF on SwitchA.
[SwitchA] netconf [SwitchA-netconf] source ip 192.168.10.1 port 830 [SwitchA-netconf] return
- Configure the NETCONFc. Start the NETCONFc and click Connect. Select Over SSH and configure
NETCONF parameters, including Host, Port, User, and Password. The parameter settings must be the same as those on the switch.
Click Connect. The switch then can communicate
with the NETCONFc normally.
Configuration Files
- Configuration file of SwitchA
# sysname SwitchA # vlan batch 10 # aaa local-user huawei password irreversible-cipher $1a$YU]JA+O227$a*A[N-Et^"zMlb>H{rR+)+^uJY<o5Dc_.kRG\)}2$ local-user huawei privilege level 15 local-user huawei service-type api # interface Vlanif10 ip address 192.168.10.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # user-interface vty 0 4 authentication-mode aaa # netconf source ip 192.168.10.1 port 830 # return
- Configuration file of SwitchB
# sysname SwitchB # vlan batch 20 # aaa local-user huawei password irreversible-cipher $1a$YU]JA+O227$a*A[N-Et^"zMlb>H{rR+)+^uJY<o5Dc_.kRG\)}2$ local-user huawei privilege level 15 local-user huawei service-type api # interface Vlanif20 ip address 192.168.20.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # user-interface vty 0 4 authentication-mode aaa # netconf source ip 192.168.20.1 port 830 # return