Saturday , November 23 2024
Home / System Management / NAP – Neighbor Access Protocol

NAP – Neighbor Access Protocol

NAP is a Huawei proprietary protocol, which implements remote configuration in Layer 3 networks. It allows to log into an unconfigured device from a directly connected device. It is very simple and can be really helpful, when implementing new devices. NAP establishes a temporary neighbor relationship between configured and unconfigured devices. Both must be directly connected through a physical link. When NAP relationship is established, telnet can be done to the unconfigured device.

NAP relationship can be established in two different ways:

  • Automatically – using IP addresses allocated by the system
  • Statically – using IP addresses allocated by the administrator.

NAP cannot be used on interfaces, configured with commands affecting the IP address configuration or IP packet forwarding, such as commands related to VPNs or Ethernet trunks.

How to use NAP? Let’s assume that we have two switches as in the picture below:

Automatic NAP

Automatic NAP uses IP addresses allocated from the 10.167.253.0/24 address pool. Only one command is required to be able to telnet to unconfigured device:

<labnarioSW1>sys
Enter system view, return user view with Ctrl+Z.
[labnarioSW1]int g0/0/1
[labnarioSW1-GigabitEthernet0/0/1]nap port master
[labnarioSW1-GigabitEthernet0/0/1]quit

[labnarioSW1]dis nap status
 Slave port status         : Enable
 Nap IP-pool/Mask          : 10.167.253.0/24
[labnarioSW1-GigabitEthernet0/0/1]

[labnarioSW1-GigabitEthernet0/0/1]dis nap interface
------------------------------------------------------
 NAP master port list 
 Port count           : 1
------------------------------------------------------
 Port property                           : Master
 Current status                          : IP-ASSIGNED
 Local port                              : GigabitEthernet0/0/1
 Peer port                               : GigabitEthernet0/0/1
 Local IP                                : 10.167.253.1
 Peer IP                                 : 10.167.253.2
 Hello time                              : 3s
 Linked time                             : 00:00:22
------------------------------------------------------
 NAP slave port list  
 Port count           : 0
------------------------------------------------------

When addresses are already assigned, telnet can be done using the following command (note that this is the interface configuration view):

[labnarioSW1-GigabitEthernet0/0/1]nap login neighbor
Trying 10.167.253.2 ...
Press CTRL+K to abort
Connected to 10.167.253.2 ...

Info: The max number of VTY users is 10, and the number of current VTY users on line is 1.

Please Press ENTER.

<Huawei>sys
[Huawei]undo nap slave enable

Static NAP

Static NAP configuration requires additional command, where IP addresses assignment can be defined:

[labnarioSW1]int g0/0/1
[labnarioSW1-GigabitEthernet0/0/1]nap port master
[labnarioSW1-GigabitEthernet0/0/1]nap ip-address local 192.168.1.1 peer 192.168.1.2 24 
Are you sure to continue?[Y/N]y
[labnarioSW1-GigabitEthernet0/0/1]

[labnarioSW1]dis nap status
 Slave port status         : Enable
 Nap IP-pool/Mask          : 10.167.253.0/24

[labnarioSW1-GigabitEthernet0/0/1]dis nap interface
------------------------------------------------------
 NAP master port list 
 Port count           : 1
------------------------------------------------------
 Port property                           : Master
 Current status                          : IP-ASSIGNED
 Local port                              : GigabitEthernet0/0/1
 Peer port                               : GigabitEthernet0/0/1
 Local IP                                : 192.168.1.1
 Peer IP                                 : 192.168.1.2
 Hello time                              : 3s
 Linked time                             : 00:02:21
------------------------------------------------------
 NAP slave port list  
 Port count           : 0
------------------------------------------------------

[labnarioSW1-GigabitEthernet0/0/1]nap login neighbor
Trying 192.168.1.2 ...
Press CTRL+K to abort
Connected to 192.168.1.2 ...

Info: The max number of VTY users is 10, and the number of current VTY users on line is 1.

Please Press ENTER.

<Huawei>sys
[Huawei]undo nap slave enable

For troubleshooting use a debugging command:

<labnarioSW1>debugging nap

Leave a Reply

Your email address will not be published. Required fields are marked *