Vyatta – Masquerade, SNAT, DNAT и port forwarding

Masquerade NAT

set service nat rule 1 source address 192.168.88.0/24
set service nat rule 1 outbound-interface eth1
set service nat rule 1 type masquerade

Source NAT

set service nat rule 1 outbound-interface eth0
set service nat rule 1 outside-address address 93.155.130.11
set service nat rule 1 source address 172.16.10.253/24
set service nat rule 1 type source

Destination NAT

set service nat rule 2 destination address 93.155.130.11
set service nat rule 2 inbound-interface eth0
set service nat rule 2 inside-address address 172.16.10.253
set service nat rule 2 type destination

DNAT – port forwarding

set service nat rule 3 destination address 93.155.130.11
set service nat rule 3 destination port 80
set service nat rule 3 inbound-interface eth0
set service nat rule 3 inside-address address 172.16.10.252
set service nat rule 3 inside-address port 80
set service nat rule 3 protocol tcp
set service nat rule 3 type destination

Rules, statistic and translations NAT

vyatta@vyatta# run show nat rules 
 
Type Codes:  SRC - source, DST - destination, MASQ - masquerade
 
rule  type     IN         OUT     source              destination         translation
----  ----  ---------  ---------  ------              -----------         -----------
1     MASQ      -      eth0       172.16.10.0/24                                              
 
[edit]
 
vyatta@vyatta# run show nat statistics 
 
Type Codes:  SRC - source, DST - destination, MASQ - masquerade
 
rule  count     type     IN         OUT
----  -------   ----  ---------  ---------
1     42        MASQ      -      eth0
 
[edit]
 
vyatta@vyatta# run show nat translations
Pre-NAT              Post-NAT             Type  Prot  Timeout
172.16.10.253        93.155.130.11        snat  tcp   431821
172.16.10.253        93.155.130.11        snat  tcp   431821
172.16.10.253        93.155.130.11        snat  tcp   431825
172.16.10.253        93.155.130.11        snat  tcp   55
172.16.10.253        93.155.130.11        snat  tcp   431823
172.16.10.253        93.155.130.11        snat  tcp   431827
172.16.10.253        93.155.130.11        snat  tcp   431822
172.16.10.253        93.155.130.11        snat  tcp   431828
172.16.10.253        93.155.130.11        snat  tcp   431822
172.16.10.253        93.155.130.11        snat  tcp   431829
172.16.10.253        93.155.130.11        snat  tcp   431828
172.16.10.253        93.155.130.11        snat  tcp   431827
172.16.10.253        93.155.130.11        snat  tcp   431823
[edit]

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.