Friday , October 18 2024

memory usage alarm threshold

 Huawei AR routers have easy and effective memory usage monitoring tool. When memory usage exceeds configured threshold, the system logs the event and generates an alarm. When memory usage falls within the alarm threshold, the system generates a clear alarm.

By default memory usage threshold is set to 90% when the memory capacity on the interface board is lower than or equal to 128MB, and 95% when the memory capacity is higher that 128MB. Memory usage threshold can be easly changed using command:

[labnario]set memory-usage threshold 75

To check memory usage alarm threshold:

[labnario]display memory-usage threshold 
 Current memory threshold of the main board is 75%.

To restore the default memory usage alarm threshold, use command:

[labnario]undo set memory-usage threshold

Be carefull when changing memory usage alarm threshold because router can frequently generate alarms when the threshold is set too low. When it is set too high, it may be to late to take appriopriate action.

Read More »

from Huawei CLI – rollback configuration

Well known feature from JunOS, now implemented by Huawei in Cloud Engines switches like CE12800, CE7800, CE6800 and CE5800. This feature will be implemented in NE routers as well, starting from V8R6 software version.

 

We have opportunity to choose wheter changes can be saved automatically or must wait for administrator’s confirmation:

system-view

In this case, the configuration takes effect after you run the commit command (two-phase validation mode).

system-view immediately

The configuration takes effect immidiatelly after you input a command and press enter.

commit [ trial [ time ] ] [ label label ] [ description description ]

I suppose that description and label don’t require any explanation. What is trial? It enables the trial running of new functions and services without interrupting the services running on the network. Time parameter specifies the timeout period for the trial. After it expires, the configuration, in the trial period, rolls back automatically.

rollback configuration { to { commit-id commit-id | label label | file file-name } | last number-of-commits }
  • Commit-id is the value the system generates automatically.
  • Label and file name indicate the historical configuration state to which the system configuration is expected to roll back.
  • Last specifies the number of configuration rollback points. The system will be rolled back to the state before these configuration rollback points.

Related useful commands:

display configuration candidate

It displays all uncommitted configuration.

clear configuration candidate

The uncommitted configuration is deleted.

display configuration commit list [ verbose ] [ number-of-commits | label ]
display configuration commit changes [ at commit-id | since commit-id | last number-of-commits ]
display configuration rollback result

Read More »

NAT server on Huawei USG5500

The last article dealt with outbound NAT. Let’s focus today on NAT server. NAT server enables private network servers to provide services for external networks with public IP addresses. In this lab, our enterprise provides FTP services for external users.

We can use the topology from the last post:

In our case AR router works as FTP server:

#
FTP server enable
aaa
 local-user labnario password cipher qGj8!H#yx.ajUn1vMEIB1lG#
 local-user labnario privilege level 3
 local-user labnario ftp-directory flash:
 local-user labnario service-type ftp
#
interface GigabitEthernet0/0/1
 ip address 172.16.1.254 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 172.16.1.1

Configuration of Internet router:

#
interface GigabitEthernet0/0/2
 ip address 1.1.1.2 255.255.255.0
#
ip route-static 1.1.1.100 255.255.255.255 1.1.1.1
Firewall USG5500 configuration

Set IP addresses of interfaces and add them to proper security zones:

[SRG]dis current-configuration interface GigabitEthernet 
#
interface GigabitEthernet0/0/1
 ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet0/0/2
 ip address 1.1.1.1 255.255.255.0

[SRG]display current-configuration configuration zone 
#
firewall zone untrust
 set priority 5
 add interface GigabitEthernet0/0/2
#
firewall zone dmz
 set priority 50
 add interface GigabitEthernet0/0/1

Configure interzone packet filtering to ensure that users in Untrust zone can access the FTP server in DMZ zone:

[SRG]display current-configuration configuration policy-interzone 
#
policy interzone dmz untrust inbound
 policy 1
  action permit
  policy service service-set ftp
  policy destination 172.16.1.254 0

Configure internal server. Create a mapping relation between public and private IP addresses of FTP server:

[SRG]nat server 0 protocol tcp global 1.1.1.100 ftp inside 172.16.1.254 ftp

Configure the NAT ALG function for the DMZ-Untrust interzone to ensure that the server provides FTP services for extranet users normally:

[SRG]display current-configuration configuration interzone 
#
firewall interzone dmz untrust
 detect ftp

What is NAT ALG for? NAT translates only IP addresses in IP packet headers and port information in TCP/UDP packet headers. In our case, the firewall must identify the IP address and port number in the payload field of the FTP application, to continue NAT processing. Without NAT ALG, the NAT process fails.

Verification of NAT server
[SRG]display firewall session table verbose
 Current Total Sessions : 1
  ftp  VPN:public --> public
  Zone: untrust--> dmz  TTL: 00:10:00  Left: 00:09:52
  Interface: GigabitEthernet0/0/1  NextHop: 172.16.1.254  MAC: 54-89-98-91-56-e2
  <--packets:6 bytes:363   -->packets:8 bytes:364
  1.1.1.2:61428+->1.1.1.100:21[172.16.1.254:21]

[SRG]display nat server 
Server in private network information:
 id                : 0                  
 zone              : ---           
 interface         : ---           
 global-start-addr : 1.1.1.100           global-end-addr   : ---                
 inside-start-addr : 172.16.1.254        inside-end-addr   : ---                
 global-start-port : 21(ftp)             global-end-port   : ---                
 insideport        : 21(ftp)            
 globalvpn         : public              insidevpn         : public             
 protocol          : tcp                 vrrp              : ---                
 no-reverse        : no                 

  Total   1 NAT servers

[SRG]display firewall server-map 
11:30:50  2015/04/22
 server-map item(s) 
 ------------------------------------------------------------------------------
 Nat Server, any -> 1.1.1.100:21[172.16.1.254:21], Zone: ---
   Protocol: tcp(Appro: ftp), Left-Time: --:--:--, Addr-Pool: ---
   VPN: public -> public

 Nat Server Reverse, 172.16.1.254[1.1.1.100] -> any, Zone: ---
   Protocol: any(Appro: ---), Left-Time: --:--:--, Addr-Pool: ---
   VPN: public -> public


<Internet>ftp 1.1.1.100
Trying 1.1.1.100 ...
Press CTRL+K to abort
Connected to 1.1.1.100.
220 FTP service ready.
User(1.1.1.100:(none)):labnario
331 Password required for labnario.
Enter password:
230 User logged in.

[ftp]

Read More »

outbound NAT on Huawei USG5500

What does it mean outbound NAT?

Outbound NAT translates the source IP addresses of packets sent from a high-priority security zone to a low-priority one.

I allowed myself to post a flowchart of configuring intranet users to access extranet through NAT (from Huawei documentation):

It easily lets us to choose a suitable way of configuring outbound NAT. In this lab I will try to do a review of these methods.

Let’s look at the topology:

 

Just forget about FTP server and focus on the bottom of the topology. We will use the FTP server in one of the next articles.

The main requirement in this lab is to configure the firewall, to provide access to the Internet for intranet users, on network segment 10.0.0.0/24.

The configuration of NAT for all above methods is the same. The difference lies in the configuration of NAT address group.

Let’s start!

Set IP addresses of interfaces and add the interfaces to proper security zones:

[SRG]display current-configuration interface GigabitEthernet
#
interface GigabitEthernet0/0/2
 ip address 1.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/3.100
 vlan-type dot1q 100
 alias GigabitEthernet0/0/3.100
 ip address 10.0.0.1 255.255.255.0
#
[SRG]display current-configuration | begin firewall zone
#
firewall zone trust
 set priority 85
 add interface GigabitEthernet0/0/3.100
#
firewall zone untrust
 set priority 5
 add interface GigabitEthernet0/0/2

Configure L2 communication on the LAN switch:

#
vlan batch 100
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 100
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 100

Ensure that the users on network segment 10.0.0.0/24 can access the Untrust zone:

[SRG]policy interzone trust untrust outbound 
[SRG-policy-interzone-trust-untrust-outbound]policy 1
[SRG-policy-interzone-trust-untrust-outbound-1]policy source 10.0.0.0 mask 24
[SRG-policy-interzone-trust-untrust-outbound-1]action permit

And now the promised configuration of NAT. In this case one private IP address will correspond to one public IP address. To achive it, I will create NAT address group with No-PAT option. NAT No-PAT is also called one-to-one address translation. During the translation, the source IP address of a packet is translated from a private IP address into a public IP address, while the port number is not translated. It means that, when a private network host adopts one public IP address, this address cannot be used by another host because all the ports of public IP address are occupied.

Create NAT address group:

[SRG]nat address-group 1 1.1.1.20 1.1.1.25

Configure NAT policy for the TRUST-UNTRUST interzone, define the range of source IP addresses for NAT and bind the NAT policy to the previousely created NAT address pool:

[SRG]nat-policy interzone trust untrust outbound 
[SRG-nat-policy-interzone-trust-untrust-outbound]policy 1
[SRG-nat-policy-interzone-trust-untrust-outbound-1]action source-nat 
[SRG-nat-policy-interzone-trust-untrust-outbound-1]policy source 10.0.0.0 mask 24
[SRG-nat-policy-interzone-trust-untrust-outbound-1]address-group 1 no-pat

Let’s verify if it is working correctly. Just try to ping interface loopback of Internet router (5.5.5.5/32) from the both hosts:

User_1>ping 5.5.5.5

Ping 5.5.5.5: 32 data bytes, Press Ctrl_C to break
From 5.5.5.5: bytes=32 seq=1 ttl=254 time=47 ms
From 5.5.5.5: bytes=32 seq=2 ttl=254 time=46 ms
From 5.5.5.5: bytes=32 seq=3 ttl=254 time=63 ms
From 5.5.5.5: bytes=32 seq=4 ttl=254 time=63 ms
From 5.5.5.5: bytes=32 seq=5 ttl=254 time=47 ms

--- 5.5.5.5 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 46/53/63 ms

User_2>ping 5.5.5.5

Ping 5.5.5.5: 32 data bytes, Press Ctrl_C to break
From 5.5.5.5: bytes=32 seq=1 ttl=254 time=47 ms
From 5.5.5.5: bytes=32 seq=2 ttl=254 time=46 ms
From 5.5.5.5: bytes=32 seq=3 ttl=254 time=62 ms
From 5.5.5.5: bytes=32 seq=4 ttl=254 time=46 ms
From 5.5.5.5: bytes=32 seq=5 ttl=254 time=47 ms

--- 5.5.5.5 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 46/49/62 ms

Check if the session entry of firewall has been created succesfully:

[SRG]display firewall session table

 Current Total Sessions : 15
  icmp  VPN:public --> public 10.0.0.11:41543[1.1.1.21:41543]-->5.5.5.5:2048
  icmp  VPN:public --> public 10.0.0.10:41031[1.1.1.20:41031]-->5.5.5.5:2048

[SRG]display firewall session table verbose

 Current Total Sessions : 50
  icmp  VPN:public --> public
  Zone: trust--> untrust  TTL: 00:00:20  Left: 00:00:00
  Interface: GigabitEthernet0/0/2  NextHop: 1.1.1.2  MAC: 54-89-98-5c-36-fb
  <--packets:1 bytes:60   -->packets:1 bytes:60
  10.0.0.10:50247[1.1.1.20:50247]-->5.5.5.5:2048

  icmp  VPN:public --> public
  Zone: trust--> untrust  TTL: 00:00:20  Left: 00:00:00
  Interface: GigabitEthernet0/0/2  NextHop: 1.1.1.2  MAC: 54-89-98-5c-36-fb
  <--packets:1 bytes:60   -->packets:1 bytes:60
  10.0.0.11:50247[1.1.1.21:50247]-->5.5.5.5:2048

Check whether the server-map entry is successfully created:

<SRG>display firewall server-map

 server-map item(s) 
 ------------------------------------------------------------------------------

 No-Pat, 10.0.0.10[1.1.1.20] -> any, Zone: ---
   Protocol: any(Appro: ---), Left-Time: 00:11:59, Addr-Pool: 1
   VPN: public -> public

 No-Pat Reverse, any -> 1.1.1.20[10.0.0.10], Zone: untrust
   Protocol: any(Appro: ---), Left-Time: --:--:--, Addr-Pool: ---
   VPN: public -> public

 No-Pat, 10.0.0.11[1.1.1.21] -> any, Zone: ---
   Protocol: any(Appro: ---), Left-Time: 00:11:59, Addr-Pool: 1
   VPN: public -> public

 No-Pat Reverse, any -> 1.1.1.21[10.0.0.11], Zone: untrust
   Protocol: any(Appro: ---), Left-Time: --:--:--, Addr-Pool: ---
   VPN: public -> public

Now we can create another NAT address group with only one address available to check NAPT:

#
 nat address-group 2 1.1.1.30 1.1.1.30
#
nat-policy interzone trust untrust outbound
 policy 1
  action source-nat
  policy source 10.0.0.0 mask 24
  address-group 2

[SRG]display firewall session table
 Current Total Sessions : 53
  icmp  VPN:public --> public 10.0.0.10:54605[1.1.1.30:2067]-->5.5.5.5:2048
  icmp  VPN:public --> public 10.0.0.11:55117[1.1.1.30:2070]-->5.5.5.5:2048

And finally NAT easy IP:

#
nat-policy interzone trust untrust outbound
 policy 1
  action source-nat
  policy source 10.0.0.0 mask 24
  easy-ip GigabitEthernet0/0/2
#
[SRG]display firewall session table 

 Current Total Sessions : 50
  icmp  VPN:public --> public 10.0.0.10:34127[1.1.1.1:17133]-->5.5.5.5:2048
  icmp  VPN:public --> public 10.0.0.11:34383[1.1.1.1:17134]-->5.5.5.5:2048

If the interface IP address is adopted as the public IP address directly, no NAT address pool is required.

Read More »

huawei cheat sheet – information center

I am often asked how to find syslog commands on Huawei devices. As one is familiar with Cisco‘s devices, he is looking for “logging” command in Huawei’s VRP. And this is the main problem. Remember that equivalent of Cisco’s logging is info-center on Huawei.

The information center functions as an information hub. The information center manages most output information. Output information is classified and then effectively filtered. Together with debugging commands and the SNMP module, the information center provides powerful support for the network administrator to monitor the operation of devices and locate faults.

Generally speaking, the information center distributes three types of information with eight severity levels to ten information channels, and then outputs that information in different directions.

Today I decided to create a simple cheat sheet, describing Huawei’s information center:

Information_Center_cheat_sheet

 

Read More »