Huawei HCIA (HCNA) certification training exam assignment-NAT application and IPSEC VPN

Huawei HCIA (HCNA) certification training exam assignment-NAT application and IPSEC VPN

-QYTang Ande (Zhou Yajun) HCIE #2198


HCIA question bank consultation

HCIA data consultation


1.NAT

Static NAT

nat static global 202.100.1.251 inside 10.1.1.250 netmask 255.255.255.255 //The entire IP protocol stack has been converted

1.1

Assignment 1

NAT server (convert a specific protocol and port), used to map a certain application of the server to the public network

202.100.1.254-->202.100.1.X:2323 converted to 10.1.1.250:23

nat server protocol tcp global 202.100.1.251 2323 inside 10.1.1.250 23

Test:

<Server-R2>telnet 202.100.1.251 2323 //The publicly announced port for accessing the public address from the external network

  Press CTRL_] to quit telnet mode

  Trying 202.100.1.251 ...

  Connected to 202.100.1.251 ...


Login authentication



Password:

<R3>

Verification:

[R1-Gateway]display nat session protocol tcp 

  NAT Session Table Information:


     Protocol          : TCP(6)

     SrcAddr  Port Vpn : 202.100.1.1     6599                                 

     DestAddr Port Vpn : 202.100.1.251   4873                                 

     NAT-Info

       New SrcAddr     : ----

       New SrcPort     : ----

       New DestAddr    : 10.1.1.250     

       New DestPort    : 5888 


     Protocol          : TCP(6)

     SrcAddr  Port Vpn : 202.100.1.1     52929                                

     DestAddr Port Vpn : 202.100.1.251   4873                                 

     NAT-Info

       New SrcAddr     : ----

       New SrcPort     : ----

       New DestAddr    : 10.1.1.250     

       New DestPort    : 5888 


  Total : 2

<R3>dis tcp status 

TCPCB    Tid/Soid Local Add:port        Foreign Add:port      VPNID  State

b4b7df58 6  /1    0.0.0.0:23            0.0.0.0:0             23553  Listening

b4b7e324 6  /4    10.1.1.250:23         202.100.1.1:49614     0      Established


R3 first needs to have a routing table to go to 202.100.1.254. If there is no route, the packet is dropped.

1.2 easy IP (PAT, Port and Address Translation)

Assignment 2

Define an ACL. Its function is to define which hosts can be converted. Only the converted hosts can access the Internet. Those that are not defined cannot be accessed. Then apply easy IP on the outgoing interface.

Function: Reuse of public network addresses and ports

acl number 2000  

 description NAT

 rule 10 permit source 10.1.1.250 0 

[R1-Gateway-Dialer1]nat outbound 2000//Apply easy IP under the interface

[R1-Gateway]dis nat outbound 

 NAT Outbound Information:

 --------------------------------------------------------------------------

 Interface                     Acl     Address-group/IP/Interface      Type

 --------------------------------------------------------------------------

 Dialer1                      2000                  202.100.1.254    easyip  

 --------------------------------------------------------------------------

  Total : 1

[R1-Gateway]dis acl 2000

Basic ACL 2000, 1 rule

NAT

Acl's step is 5

 rule 10 permit source 10.1.1.250 0 

The source and destination IP of a message will not change, and the source and destination MAC (if it crosses the network) will be re-encapsulated.

10.1.1.250->202.100.1.1

After conversion

202.100.1.254->202.100.1.1


2.ACL

Many applications: a. Application to traffic b. Application to routing tables

When Huawei's ACL matches traffic, the last line implicitly allows all traffic to pass (the last line of Cisco implicitly denies all traffic, deny any).

interface GigabitEthernet0/0/2

 ip address 10.1.1.254 255.255.255.0 

 traffic-filter inbound acl 2001


3.IPSEC VPN

Lan2Lan IPSEC VPN

Basic modes: tunnel mode and transmission mode

3.1 Routing is the most important!

Encryption and decryption points:

a. Reach the peer encryption and decryption point (direct connection)

b. Reach the local communication point (direct connection)

c. Reach the communication point of the opposite end (static default route)

3.2 IPSEC SPD, proposal and IPSEC strategy

[R1-Gateway-acl-adv-3000]rule 10 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 

!

ipsec proposal QYT

 esp authentication-algorithm sha1

!

ipsec policy QYT-VPN 10 manual

 security acl 3000

 proposal QYT

 tunnel local 202.100.1.1

 tunnel remote 202.100.1.254

 sa spi inbound esp 54321

 sa string-key inbound esp simple huawei

 sa spi outbound esp 12345

 sa string-key outbound esp simple huawei



[Server-R2]dis ipsec sa


===============================

Interface: GigabitEthernet0/0/0

 Path MTU: 1500

===============================


  -----------------------------

  IPSec policy name: "QYT-VPN"

  Sequence number  : 10

  Acl Group        : 3000

  Acl rule         : 0

  Mode             : Manual

  -----------------------------

    Encapsulation mode: Tunnel

    Tunnel local      : 202.100.1.1

    Tunnel remote     : 202.100.1.254

    Qos pre-classify  : Disable


    [Outbound ESP SAs] 

      SPI: 12345 (0x3039)

      Proposal: ESP-ENCRYPT-DES-64 ESP-AUTH-SHA1

      No duration limit for this SA


    [Inbound ESP SAs] 

      SPI: 54321 (0xd431)                 

      Proposal: ESP-ENCRYPT-DES-64 ESP-AUTH-SHA1

      No duration limit for this SA

[R1-Gateway]display ipsec statistics esp

 Inpacket count            : 0

 Inpacket auth count       : 0

 Inpacket decap count      : 0

 Outpacket count           : 12

 Outpacket auth count      : 0

 Outpacket encap count     : 0

 Inpacket drop count       : 0

 Outpacket drop count      : 0

 BadAuthLen count          : 0

 AuthFail count            : 0

 InSAAclCheckFail count    : 0

 PktDuplicateDrop count    : 0

 PktSeqNoTooSmallDrop count: 0

 PktInSAMissDrop count     : 0

How to use NAT and IPSEC at the same time?

3.3 Application

int dial 1

ipsec policy QYT-VPN //Interface application


Huawei HCIA (HCNA) certification training exam assignment-NAT application and IPSEC VPN

For HCIA exam details, please consult the official website customer service

QYTang customer service hotline: 400-618-8070

QYTang official website: www.qytang.com

QYTang Network Lab We think more for you