VYATTA - Semplice guida - Caso Studio 6 - NAT

Vyatta Case 6 - NAT
Last Update: Dec 26 2007


Tool
Install
Ergonomy
Forum



Details Cosa è Vyatta?
Screenshots
Prerequisiti
Tutorial Vyatta
Confronto comandi Vyatta & Cisco
Vyatta/Cisco/Quagga confronto (sezione Quagga)
Caso Studio 1 - Static routes (VC 2.0)
Caso Studio 2 - OSPF simple (VC 2.0)
Caso Studio 3 - OSPF advanced (VC 2.0)
Caso Studio 4 - BGP (VC 3.0)
Caso Studio 5 - VRRP (VC 2.2)
Caso Studio 6 - NAT (VC 2.0)
Caso Studio 7 - DHCP (VC 2.2)
Caso Studio 8 - IPSec (VC 2.2)
Caso Studio 9 - Packages (VC 3.0)
Caso Studio 10 - Bridging (VC 3.0)
Caso Studio 11 - CDP (VC 3.0)

Italian translation by Giovanni Fredducci.



⚠️⚠️⚠️
Please check our website about
attractions in Western Switzerland !! (Please use english translation).

⚠️⚠️⚠️
Merci de consulter notre site sur les
activités à faire en Suisse romande !!


1. NAT - STATIC 2. PAT - STATIC 3. NAT - DYNAMIC 4. NAT - MASQUERADE


1.1 CASO STUDIATO 1.2 FIGURA 1.3 CONFIGURAZIONE 1.4 COMANDI


1. CASO STUDIATO

Vyatta versione: VC 2.0 Feb 20, 2007
Static NAT, dove un indirizzo ip è traslato in un altro indirizzo ip e può essere usato per cercare da internet un server interno alla propria LAN.
Un benefico dello static NAT comparato con altri tipi di nat è che le porte TCP e UDP non sono modificate durante la traslazione.

Nel nostro esempio, noi configureremo una sorgente ed una destinazione dello static NAT.


2. FIGURA

cisco vyatta case study static nat Funzionalità testate:

(clicka sul web links per avere più dettagli sui protocolli)

Interface settings
Telnet access
NAT - Static
Static Routing
 
 
 
 
 
 
 
 
 


3. CONFIGURAZIONE

CISCO ROUTER 2651 IOS: 12.2(15)T17 VYATTA ROUTER VC2 Feb 20, 2007
interface FastEthernet0/0
  description Server A
  ip address 10.0.0.1 255.255.255.0
  ip nat inside
edit interfaces ethernet eth1
  set description ServerB
  set address 10.0.0.1 prefix-length 24
 
interface FastEthernet0/1
  description Vyatta
  ip address 50.0.0.2 255.255.255.0
  ip nat outside
edit interfaces ethernet eth0
  set description Cisco
  set address 50.0.0.1 prefix-length 24
 
ip route 60.0.0.0 255.255.255.240
50.0.0.1
set protocols static route 70.0.0.0/28 next-hop
50.0.0.2
ip nat inside source static 10.0.0.2
70.0.0.2

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
set service nat rule 1
edit service nat rule 1
  set type destination
  set translation-type static
  set inbound-interface eth0
  set protocols all
  set source network 0.0.0.0/0
  set destination address 60.0.0.56
  set inside-address address 10.0.0.2

set service nat rule 2
edit service nat rule 2
  set type source
  set translation-type static
  set outbound-interface eth0
  set protocols all
  set source address 10.0.0.2
  set destination network 0.0.0.0/0
  set outside-address address 60.0.0.2
line vty 0 4
  no login
set service telnet
 
enable secret password
 
edit system login user vyatta
  set authentification plaintext-password password


4. COMANDI

vyatta@vyatta>show nat rules

vyatta output show nat rules

vyatta@vyatta>show nat statistics

vyatta output show nat statistics

vyatta:~#tcpdump -v -p icmp
(deve essere eseguito dall’utente root al prompt di linux)

vyatta output tcpdump

Router#show ip nat translations

Cisco output show ip nat translations

Router#show ip nat statistics

Cisco output show ip nat statistics

Router#debug ip nat
Router#terminal monitor

Cisco output debug ip nat

controllo connettività END TO END:

Dal WebServerA:
c:\>tracert 60.0.0.2

windows tracert

Dal WebServerB:
c:\>tracert 70.0.0.2

windows tracert

Inizio pagina


2.1 CASO STUDIATO 2.2 FIGURA 2.3 CONFIGURAZIONE 2.4 COMANDI


1. CASO STUDIATO

Static PAT (Port Address Translation) si ha quando un indirizzo IP e una porta layer 4 (TCP/UPD) sono traslati in un indirizzo IP e in una porta layer 4 (TCP/UDP).
è usato quando si vuole rendere pubblico un servizio su un server interno alla propria rete da internet.

Nel nostro esempio abbiamo configurato uno static destination PAT.


2. FIGURA

Vyatta Cisco case study static pat Funzionalità testate:

(clicka sul web links per avere più dettagli sui protocolli)

Interface settings
Telnet access
PAT - Static
Static Routing
 
 
 
 
 
 
 
 
 


3. CONFIGURAZIONE

CISCO ROUTER 2651 IOS: 12.2(15)T17 VYATTA ROUTER VC2 Feb 20, 2007
interface FastEthernet0/0
  description Server A
  ip address 10.0.0.1 255.255.255.0
  ip nat inside
edit interfaces ethernet eth1
  set description ServerB
  set address 10.0.0.1 prefix-length 24
 
interface FastEthernet0/1
  description Vyatta
  ip address 50.0.0.2 255.255.255.0
  ip nat outside
edit interfaces ethernet eth0
  set description Cisco
  set address 50.0.0.1 prefix-length 24
 
ip route 60.0.0.0 255.255.255.240
50.0.0.1
set protocols static route 70.0.0.0/28 next-hop
50.0.0.2
ip nat inside source static
tcp 10.0.0.2 21 70.0.0.2 21
 
 
 
 
 
 
 
 
set service nat rule 1
edit service nat rule 1
  set type destination
  set translation-type static
  set inbound-interface eth0
  set protocols tcp
  set source network 0.0.0.0/0
  set destination address 60.0.0.2
  set destination port-name ftp
  set inside-address address 10.0.0.2
line vty 0 4
  no login
set service telnet
 
enable secret password
 
edit system login user vyatta
  set authentification plaintext-password password


4. COMANDI

vyatta@vyatta>show nat rules

vyatta output show nat rules

vyatta@vyatta>show nat statistics

vyatta output show nat statistics

vyatta:~#tcpdump port 21
(deve essere eseguito dall’utente “root” in linux prompt)

vyatta output tcpdump

Router#show ip nat translations

cisco output show ip nat translations

Router#show ip nat statistics

cisco output show ip nat statistics

Router#debug ip nat
Router#terminal monitor

cisco output debug ip nat

Inizio pagina


3.1 CASO STUDIATO 3.2 FIGURA 3.3 CONFIGURAZIONE 3.4 COMANDI


1. CASO STUDIATO

Il Dynamic NAT si ha quando un indirizzo IP che è parte di un gruppo di indirizzi Ip viene traslato in un altro indirizzo IP che a sua volta è membro di un gruppo di indirizzi IP.
L’esempio classico è quando si hanno due network che hanno gli stessi IP..

Il nostro esempio abbiamo configurato dynamic source NAT.


2. FIGURA

Cisco vyatta case study dynamic nat Funzionalità testate:

(clicka sul web links per avere più dettagli sui protocolli)

Interface settings
Telnet access
NAT - Dynamic
Static Routing
 
 
 
 
 
 
 
 
 


3. CONFIGURAZIONE

CISCO ROUTER 2651 IOS: 12.2(15)T17 VYATTA ROUTER VC2 Feb 20, 2007
interface FastEthernet0/0
  description Server A
  ip address 10.0.0.1 255.255.255.0
  ip nat inside
edit interfaces ethernet eth1
  set description ServerB
  set address 10.0.0.1 prefix-length 24
 
interface FastEthernet0/1
  description Vyatta
  ip address 50.0.0.2 255.255.255.0
  ip nat outside
edit interfaces ethernet eth0
  set description Cisco
  set address 50.0.0.1 prefix-length 24
 
ip route 60.0.0.0 255.255.255.240
50.0.0.1
set protocols static route 70.0.0.0/28 next-hop
50.0.0.2
ip nat pool nat-pool 70.0.0.0 70.0.0.15
netmask 255.255.255.240
ip nat inside source list 1 pool nat-pool
access-list 1 permit 10.0.0.0 0.0.0.255
 
 
 
 
 
set service nat rule 1
edit service nat rule 1
  set type source
  set translation-type dynamic
  set outbound-interface eth0
  set protocols all
  set source network 10.0.0.0/24
  set destination network 0.0.0.0/0
  set outside-address address 60.0.0.0/28
line vty 0 4
  no login
set service telnet
 
enable secret password
 
edit system login user vyatta
  set authentification plaintext-password password


4. COMANDI

vyatta@vyatta>show nat rules

vyatta output show nat rules

vyatta@vyatta>show nat statistics

vyatta output show nat statistics

vyatta:~#tcpdump -v
(must be executed by the root user at the Linux prompt)

vyatta output tcpdump

Router#show ip nat translations

cisco output show ip nat translations

Router#show ip nat statistics

cisco output show ip nat statistics

Router#debug ip nat
Router#terminal monitor

cisco output debug ip nat

controllo connettività END TO END:

Da Desktop A:
c:\>tracert 50.0.0.1

windows tracert

Da Desktop B:
c:\>tracert 50.0.0.2

windows tracert

Inizio pagina


4.1 CASO STUDIATO 4.2 FIGURA 4.3 CONFIGURAZIONE 4.4 COMANDI


1. CASO STUDIATO

Il masquerade NAT si ha quando un indirizzo IP facente parte di un gruppo di IP è traslato in un unico indirizzo IP.

L’esempio tipico è quando un gruppo di utenti con IP privati viene dal router traslato in un unico IP pubblico per accedere ad Internet.


2. FIGURA

cisco vyatta case study nat masquerade overloading Funzionalità testate:

(clicka sul web links per avere più dettagli sui protocolli)

Interface settings
Telnet access
NAT - Masquerade
Static Routing
 
 
 
 
 
 
 
 
 


3. CONFIGURAZIONE

CISCO ROUTER 2651 IOS: 12.2(15)T17 VYATTA ROUTER VC2 Feb 20, 2007
interface FastEthernet0/0
  description Server A
  ip address 10.0.0.1 255.255.255.0
  ip nat inside
edit interfaces ethernet eth1
  set description ServerB
  set address 10.0.0.1 prefix-length 24
 
interface FastEthernet0/1
  description Vyatta
  ip address 50.0.0.2 255.255.255.0
  ip nat outside
edit interfaces ethernet eth0
  set description Cisco
  set address 50.0.0.1 prefix-length 24
 
ip route 60.0.0.0 255.255.255.240
50.0.0.1
set protocols static route 70.0.0.0/28 next-hop
50.0.0.2
ip nat inside source list 1 interface
FastEthernet0/1 overload
access-list 1 permit 10.0.0.0 0.0.0.255
 
 
 
 
 
set service nat rule 1
edit service nat rule 1
  set type source
  set translation-type masquerade
  set inbound-interface eth0
  set protocols all
  set source network 10.0.0.0/24
  set destination address 0.0.0.0/0
line vty 0 4
  no login
set service telnet
 
enable secret password
 
edit system login user vyatta
  set authentification plaintext-password password


4. COMANDI

vyatta@vyatta>show nat rules

vyatta output show nat rules

vyatta@vyatta>show nat statistics

vyatta output show nat statistics

vyatta:~#tcpdump -v
(deve essere eseguito dall’utente “root” in linux prompt)

vyatta output tcpdump

Router#show ip nat translations
(telnet da Desktop A a Vyatta)

cisco output show ip nat translations

Router#show ip nat statistics

cisco output show ip nat statistics

Router#debug ip nat
Router#terminal monitor

cisco output debug ip nat

controllo connettività END TO END:

Da Desktop A:
c:\>tracert 50.0.0.1

tracert windows

Da Desktop B:
c:\>tracert 50.0.0.2

tracert windows

Inizio pagina