Thursday, 13 February 2014

Configure Vyatta Router with NAT

Network Address Translation, an Internet standard that enables the LAN to use one set of IP addresses for internal traffic and a second set of addresses for external traffic. The NAT is located where the LAN meets the Internet and is responsible to make all necessary IP address translations. There are basically two types of NAT. The dynamic and the static.

**NAT can protect the network by hiding internal IP addresses.

You can configure Vyatta with different types of NAT depending on your network's needs. 
  
  • Source NAT (One-to-One) : forward packets from one inside to one outside
  • Source NAT (Many-to-One) : forward packets from many inside to one outside
  • Source NAT (Many-to-Many) : forward packets from many inside to many outside
  • Source NAT (One-to-Many) : forward packet from one inside to many outside
  • Destination NAT (One-to-One) : froward packets from one outside to one inside ( this type of  NAT is important if you want the source to receive “reply packet”)
  • Destination NAT (One-to-Many) : forward packets from one outside to many inside

 1) Configuring NAT one-to-one.  

 Configurations

configure
set service nat rule 1 type source
set service nat rule 1 source address 192.168.0.2/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 outside-address address 141.45.85.10
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1


2) Configuring NAT many-to-one.


Configurations

configure
set service nat rule 1 type source
set service nat rule 1 source address 192.168.0.0/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 outside-address address 141.45.85.10
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1


3) Configuring NAT many-to-many.




Configurations

configure
set service nat rule 1 type source
set service nat rule 1 source address 192.168.0.0/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 outside-address address 141.45.85.10 - 141.45.85.20
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1

  4) Configuring NAT one-to-many.  
                                                                                         
Configurations

configure
set service nat rule 1 type source
set service nat rule 1 source address 192.168.0.2/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 outside-address address 141.45.85.10 - 141.45.85.20
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1


  5) Configuring destination NAT one-to-one. 




Configurations

configure
set service nat rule 1 type destination
set service nat rule 1 inbound-interface eth0
set service nat rule 1 destination address 141.45.85.10
set service nat rule 1 protocols tcp
set service nat rule 1 destination port http
set service nat rule 1 inside-address 192.168.0.2
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1



6) Configuring destination NAT one-to-one. 




Configurations

configure
set service nat rule 1 type destination
set service nat rule 1 inbound-interface eth0
set service nat rule 1 destination address 141.45.85.10
set service nat rule 1 protocols tcp
set service nat rule 1 destination port http
set service nat rule 1 inside-address 192.168.0.2
commit
save


**If you want to check the NAT rules use the command :

show service nat rule 1

No comments:

Post a Comment