Friday , February 28 2025

screen length of terminal

24 – the default number of lines on one screen

<NE40E> display current-configuration
#
 sysname NE40E
#
 super password level 1 simple huawei1
 super password level 3 simple huawei
 super password level 15 simple labnario
#
 FTP server enable
 FTP acl 2000
#
 info-center source BFD channel 1 log level informational
 info-center loghost source GigabitEthernet0/0/0
 info-center loghost 172.16.20.90 facility local4
#
 vlan batch 31 to 32 98 100
#
 hotkey CTRL_U "display ip interface brief"
#
 undo cluster enable
#
snmp-agent trap type base-trap
#
 load-balance ip-enhance all
  ---- More ----

How to change it?

[NE40E]user-interface vty 0 4
[NE40E-ui-vty0-4]screen-length 0

The value is an integer ranging from 0 to 512. 0 indicates the split screen is disabled (it is useful when you want to use scripts).

If you want to change screen length only for the current terminal, use temporary option in the above command. It is valid only for the active user interface till the user leaves.

[NE40E]user-interface vty 0 4
[NE40E-ui-vty0-4]screen-length 60 temporary
Info: The configuration takes effect on the current user terminal interface only.

Read More »

OSPF packets

As you probably know there are five types of OSFP packets:

All these packets, except Hellos, are sent only between adjacent routers.

LSA types

There are 5 common LSA types:

  • Router-LSA and Network-LSA calculate intra-area routes describing detailed link state information.
  • Network-Summary-LSA calculates inter-area routes describing brief routing information instead of link state information
  • ASBR-Summary-LSA describes how to reach ASBR
  • AS-External-LSA describes how to reach destinations outside AS.

LSA header:

What we have to remember is that LS Type, Link State ID and Advertising Router together uniquely identify LSA, what will be shown later in this post.

Below you can see LSA header in Router-LSA (as an example):

Key fields of OSPF Router-LSA:

Key fields of OSPF Network-LSA:

Notice that different OSPF packets contain different parts of LSA information:

  • DD – LSA header information
  • LSR – LS type, LS ID and advertising router
  • LSU – Complete LSA information
  • LSAck – LSA header information.

Having information described in this post you will be able to calculate OSPF intra-area routes. Each router calculates the SPT using itself as the root. In the first stage only links between routers and transit networks are considered. Then, in the second stage, stub networks are added to the tree as leaves.

Read More »

from Huawei CLI – display this

display this

Very useful and very often used command on Huawei’s devices. You can use it in any view. Any time you configure something, you can use it to check what you have configured. If you set parameters, that are the same with the default ones, these parameters will not be displayed. Anyway “display current-configuration” does not also show the default parameters.

Example 1 (interface view):

[NE-GigabitEthernet1/0/1]display this
#
interface GigabitEthernet1/0/1
 description test
 undo shutdown
 ip address 10.1.1.1 255.255.255.252
 isis enable 1
 isis circuit-type p2p
 isis circuit-level level-2
 isis cost 100
 isis bfd enable
 mpls
 mpls te
 mpls rsvp-te
 mpls rsvp-te hello
#
return

Example 2 (isis view):

[NE-isis-1]display this
#
isis 1
 graceful-restart
 is-level level-2
 cost-style wide
 flash-flood level-2
 network-entity 49.0310.0100.0125.5025.00
 is-name labnario
 traffic-eng level-2
 log-peer-change
 set-overload on-startup
#
return

Example 3 (vpn-instance view):

[NE-vpn-instance-labnario]display this
#
ip vpn-instance labnario
 description test
 route-distinguisher 10.1.255.24:100
 vpn-target 10.1.255.24:100 export-extcommunity
 vpn-target 10.1.255.24:100 import-extcommunity
#
return

Example 4 (aaa view):

[NE-aaa]display this
#
aaa
 local-user labnario password cipher &EU15O"Q3/;Q=^Q`MAF4
 local-user labnario service-type ftp terminal telnet ssh
 local-user labnario level 15
 local-user labnario ftp-directory cfcard:/
 authentication-scheme default
  authentication-mode  local  radius
 authentication-scheme default0
 authentication-scheme default1
 #
 authorization-scheme default
 #
 accounting-scheme default
 accounting-scheme default0
 accounting-scheme default1
 #
 domain default
 domain default0
 domain default1
 #
#
return

Example 5 (ACL view):

[NE-acl-adv-3003]display this
#
acl number 3003
 rule 10 permit ip destination 172.10.1.41 0
#
return

Read More »

OSPF network types

In the era of ethernet transport technology we cannot forget about older, but still widely used ATM and FR technologies. Taking OSPF into consideration, it classifies networks based on link layers protocols. That’s why we have such terms like:

  • broadcast
  • non-broadcast multiple access NBMA
  • point-to-mulitpoint P2MP
  • point-to-point P2P.

Broadcast

Ethernet technology is a typical example of broadcast network where a transmitted packet is multiplied by ethernet switch and copies of this packet are transmitted to all end points. In this scenario OSPF Hello, LSU (link state update) and LSAck (link state acknowledgement) packets are transmitted in multicast mode. DD (database description) packets and LSR (link state request) packets are transmitted in unicast mode. OSPF routers in broadcast network elect designated router (DR) and backup designated router (BDR). Only DR and BDR form adjacencies with all non-designated OSFP routers. 224.0.0.5 and 224.0.0.6 are multicast IP addresses reserved for all OSFP routers and OSFP designated routers respectively.

NBMA

ATM and Frame Relay are typical examples of NBMA networks. NBMA simulates broadcast network. It must be full meshed and every router in the segment must be configured with IP address of each of its neighbours. In NBMA networks all OSPF packets are transmitted in unicast mode. DR and BDR routers are elected as well.

Point-to-multipoint

The common practice is to change non-full meshed NBMA network to a P2MP network. Non-full meshed FR network is P2MP network example.

A P2MP network, unlike full meshed NBMA networks, is a collection of point-to-point networks. As this is P2P, DR and BDR are not needed. OSPF network type must be manually configured because the network is not fully meshed. Inverse ARP should be configured on an interface. Hello packets are transmitted in mulitcast mode through the mulicast IP address 224.0.0.5. Other OSPF packets are transmitted in unicast mode.

Point-to-point

In this type of networks, OSPF protocol packets, such as Hello, DD, LSR, LSU and LSAck packets, are transmitted in multicast mode using 224.0.0.5 multicast address. As this is a link between exactly two points, each packet sent from one router have only one recipient on the local link.

Command to change network type on Huawei router for a specific interface:

[labnario-GigabitEthernet1/0/0]ospf network-type { broadcast | nbma | p2mp | p2p }

Command to set IP addresses for adjacent routers on an NBMA network:

[labnario] ospf 100
[labnario-ospf-100] peer 1.1.1.1

Read More »

file system of Huawei NE40E

How to manage storage devices, directories and files on Huawei’s equipment?

I will try to introduce the file system based on NE40E routers.

NE40E, as most of carrier class Huawei’s devices, has two MPU boards. Each board is equipped with two CFcards. The first CFcard, inside the board, is used for storing software and configuration’s files. The second one, at the front panel of the board, stores log files. Some of Huawei’s devices use flash memory to store all necessary files.

The file system manages files and directories in the storage device by creating, deleting, modifying, renaming files or directories and displaying contents of the files.

Let’s do an example:

  1. Create labnario and huawei directories in CFcard.
  2. Copy log.log file from CFcard2 to labnario directory.
  3. Display this file.
  4. Rename this file with old_log.log.
  5. Compress it.
  6. Move old_log.log.zip file to huawei directory of the same CFcard.
  7. Delete this file from huawei directory.
  8. Restore the deleted file.
  9. Delete this file permanently.
  10. Delete huawei directory.

Display files stored in CFcard:

<NE40E>dir
Directory of cfcard:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-              0  Aug 08 2011 14:47:00   snmpnotilog.txt
    1  -rw-    247,575,224  Aug 08 2011 14:55:58   ne40e80ev6r1c00spc900.cc
    2  -rw-     37,289,817  Aug 08 2011 14:57:20   patch-v6r1spc020.pat
    3  -rw-         14,725  Sep 16 2011 11:02:28   license.txt
    4  -rw-         86,875  Sep 16 2011 11:03:10   paf.txt
    5  -rw-              0  Oct 18 2011 14:57:34   vrpcfg.cfg

Create two directories:

<NE40E>mkdir cfcard:/labnario
Info: Create directory cfcard:/labnario......Done.
<NE40E>mkdir cfcard:/huawei
Info: Create directory cfcard:/huawei......Done.

<NE40E>dir
Directory of cfcard:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  drw-              -  Apr 30 2012 14:48:18   labnario
    1  drw-              -  Apr 30 2012 14:51:08   huawei
    2  -rw-              0  Aug 08 2011 14:47:00   snmpnotilog.txt
    3  -rw-    247,575,224  Aug 08 2011 14:55:58   ne40e80ev6r1c00spc900.cc
    4  -rw-     37,289,817  Aug 08 2011 14:57:20   patch-v6r1spc020.pat
    5  -rw-         14,725  Sep 16 2011 11:02:28   license.txt
    6  -rw-         86,875  Sep 16 2011 11:03:10   paf.txt
    7  -rw-              0  Oct 18 2011 14:57:34   vrpcfg.cfg

Copy log.log file from CFcard2 to labnario directory of CFcard:

<NE40E>copy cfcard2:/log/log.log cfcard:/labnario
Copy cfcard2:/log/log.log to cfcard:/labnario/log.log?[Y/N]:y
\
Info: Copied file cfcard2:/log/log.log to cfcard:/labnario/log.log...Done.
<NE40E>cd labnario
<NE40E>pwd
cfcard:/labnario

<NE40E>dir
Directory of cfcard:/labnario/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-        588,992  Apr 30 2012 14:46:50   log.log

1,022,848 KB total (414,016 KB free)

Rename this file:

<NE40E>rename cfcard:/labnario/log.log cfcard:/labnario/old_log.log
Rename cfcard:/labnario/log.log to cfcard:/labnario/old_log.log ?[Y/N]:y
Info: Rename file cfcard:/labnario/log.log to cfcard:/labnario/old_log.log ......Done.

<NE40E>dir
Directory of cfcard:/labnario/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-        588,992  Apr 30 2012 14:46:50   old_log.log

1,022,848 KB total (414,016 KB free)

Display old_log.log file:

<NE40E>more old_log.log 

################################################################
#Automatic record log end,current health information as follows:
Slot                    CPU Usage     Memory Usage (Used/Total)
---------------------------------------------------------------
9       MPU(System Master) 11%           19%  361MB/1877MB
1       LPU                12%           40%  130MB/319MB
2       LPU                11%           45%  145MB/319MB
3       LPU                11%           45%  145MB/319MB
10      MPU                 7%           17%  320MB/1877MB
#DateTime Stamp: 2012-01-25 10:15:27.100
################################################################

Jan 25 2012 10:25:05 NE40E SRM_BASE/1/ENTITYINSERT: OID 1.3.6.1.4.1.2011.5.25.129.2.1.2 Physical entity is inserted. (EntityPhysicalIndex=16842767, BaseTrapSeverity=4, BaseTrapProbableCause=65541, BaseTrapEventType=5, EntPhysicalContainedIn=16842757, EntPhysicalName="GigabitEthernet1/0/9")
Jan 25 2012 10:25:06 NE40E %%01PHY/4/PHY_SFP_XFP_OK(l)[2082]:Slot=1;GigabitEthernet1/0/9 SFP/XFP is present.
Jan 25 2012 10:27:14 NE40E %%01SRM/2/NODEFAULT(l)[2083]:Slot=1;PIC0 of LPU1 is failed, perhaps Low Rx Pow ALM of SFP9 ALARM is abnormal. (Reason="EAGF0 ESFP RX power low alarm, Current Rxpower is -40.00dBm. ")
Jan 25 2012 10:29:55 NE40E %%01SRM/2/NODERESUME(l)[2084]:Slot=2;OTHER of LPU2: branch 2 of 48vPOWER resumed.
Jan 25 2012 10:29:56 NE40E %%01SRM/2/NODEFAULT(l)[2085]:Slot=2;OTHER of LPU2 is failed, perhaps branch 2 of 48vPOWER is abnormal. (Reason="second branch abnormal")
Jan 25 2012 10:29:57 NE40E %%01SRM/2/NODERESUME(l)[2086]:Slot=2;OTHER of LPU2: branch 2 of 48vPOWER resumed.

Compress this file:

<NE40E>zip cfcard:/labnario/old_log.log cfcard:/labnario/old_log.log.zip
Compress cfcard:/labnario/old_log.log  to cfcard:/labnario/old_log.log.zip?[Y/N]:y
%Compressed file cfcard:/labnario/old_log.log cfcard:/labnario/old_log.log.zip.

<NE40E>dir
Directory of cfcard:/labnario/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-        588,992  Apr 30 2012 14:46:50   old_log.log
    1  -rw-         47,918  Apr 30 2012 14:48:20   old_log.log.zip

1,022,848 KB total (413,968 KB free)

Move the zipped file to huawei directory:

<NE40E>move cfcard:/labnario/old_log.log.zip cfcard:/huawei
Move cfcard:/labnario/old_log.log.zip to cfcard:/huawei/old_log.log.zip ?[Y/N]:y
%Moved file cfcard:/labnario/old_log.log.zip to cfcard:/huawei/old_log.log.zip.

<NE40E>dir
Directory of cfcard:/labnario/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-        588,992  Apr 30 2012 14:46:50   old_log.log

1,022,848 KB total (413,952 KB free)

<NE40E>cd cfcard:/huawei
<NE40E>dir
Directory of cfcard:/huawei/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-         47,918  Apr 30 2012 14:48:20   old_log.log.zip

1,022,848 KB total (413,952 KB free)

Delete this file from huawei directory (actually move to recycle bin):

<NE40E>delete old_log.log.zip 
Delete cfcard:/huawei/old_log.log.zip?[Y/N]:y
Info: Deleting file cfcard:/huawei/old_log.log.zip...succeeded.

<NE40E>dir /all
Directory of *

    0  -rw-         47,918  Apr 30 2012 14:48:18  [old_log.log.zip]

1,022,848 KB total (413,936 KB free)

<NE40E>dir
Info: File can't be found in the directory.
1,022,848 KB total (413,936 KB free)

Restore the deleted file from recycle bin:

<NE40E>undelete old_log.log.zip 
Undelete cfcard:/huawei/old_log.log.zip?[Y/N]:y
%Undeleted file cfcard:/huawei/old_log.log.zip.

<NE40E>dir
Directory of cfcard:/huawei/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 
    0  -rw-         47,918  Apr 30 2012 14:48:20   old_log.log.zip

1,022,848 KB total (413,936 KB free)

Delete this file permanently:

<NE40E>delete /unreserved old_log.log.zip 
Warning: The contents of file cfcard:/huawei/old_log.log.zip cannot be recycled. Continue? [Y/N]:y
Info: Deleting file cfcard:/huawei/old_log.log.zip...succeeded.

How to make recycle-bin empty go to “reset recycle-bin”.

Delete huawei directory:

<NE40E>cd cfcard:
<NE40E>rmdir cfcard:/huawei
Remove directory cfcard:/huawei?[Y/N]:y
%Removing directory cfcard:/huawei...Done!

Read More »