CISCO NAT: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
 +
=Variante A=
 +
===NAT Inside und Outside Interfaces festlegen===
 +
*configure terminal
 +
*(config)#interface ethernet 0/0
 +
*(config-if)#ip nat outside
 +
*(config-if)#exit
 +
*(config)#interface ethernet 1/0
 +
*(config-if)#ip nat inside
 +
===NAT Pool festlegen hier wird mit der aussenip überladen===
 +
*configure terminal
 +
*(config)ip nat pool unkerich-pool 192.168.249.62 192.168.249.62 prefix-length 24
 +
===NAT Pool festlegen NAT ACL dem NAT Pool zuordnen===
 +
*configure terminal
 +
*(config)# ip nat inside source list 7 interface Ethernet0/0 overload
 +
===NAT ACL festlegen===
 +
*configure terminal
 +
*(config)access-list 7 permit 172.22.2.0 0.0.0.255
 +
*(config-if)#exit
  
 +
=Variante B=
 
===NAT Inside und Outside Interfaces festlegen===
 
===NAT Inside und Outside Interfaces festlegen===
unkerich#
+
*configure terminal  
unkerich#configure terminal  
+
*(config)#interface ethernet 0/0
unkerich(config)#interface ethernet 0/0
+
*(config-if)#ip nat outside
unkerich(config-if)#ip nat outside
+
*(config-if)#exit
unkerich(config-if)#exit
+
*(config)#interface ethernet 1/0
unkerich(config)#interface ethernet 1/0
+
*(config-if)#ip nat inside
unkerich(config-if)#ip nat inside
 
unkerich(config-if)#exit
 
unkerich#
 
 
 
 
===NAT Pool festlegen hier wird mit der aussenip überladen===
 
===NAT Pool festlegen hier wird mit der aussenip überladen===
unkerich#
+
*configure terminal  
unkerich#configure terminal  
+
*(config)ip nat pool unkerich-pool 192.168.249.62 192.168.249.62 prefix-length 24
unkerich(config)ip nat pool unkerich-pool 192.168.249.62 192.168.249.62 prefix-length 24
 
unkerich(config-if)#exit
 
unkerich#
 
 
 
 
===NAT ACL dem NAT Pool zuordnen===  
 
===NAT ACL dem NAT Pool zuordnen===  
unkerich#
+
*configure terminal  
unkerich#configure terminal  
+
*(config)ip nat inside source list 7 pool unkerich-pool overload
unkerich(config)ip nat inside source list 7 pool unkerich-pool overload
+
===NAT ACL festlegen===  
unkerich(config-if)#exit
+
*configure terminal  
unkerich#
+
*(config)access-list 7 permit 172.22.2.0 0.0.0.255
 
+
*(config-if)#exit
===NAT Pool festlegen NAT ACL dem NAT Pool zuordnen (Alternative)===
 
unkerich#
 
unkerich#configure terminal  
 
unkerich(config)# ip nat inside source list 7 interface Ethernet0/0 overload
 
unkerich(config-if)#exit
 
unkerich#
 
  
===NAT ACL festlegen===
 
unkerich#
 
unkerich#configure terminal
 
unkerich(config)access-list 7 permit 172.22.2.0 0.0.0.255
 
unkerich(config-if)#exit
 
unkerich#
 
  
===Aktive NAT anzeigen===  
+
=Aktive NAT anzeigen===  
 
  unkerich#show ip nat translations  
 
  unkerich#show ip nat translations  
 
  Pro Inside global        Inside local          Outside local        Outside global
 
  Pro Inside global        Inside local          Outside local        Outside global

Version vom 22. Januar 2016, 12:31 Uhr

Variante A

NAT Inside und Outside Interfaces festlegen

  • configure terminal
  • (config)#interface ethernet 0/0
  • (config-if)#ip nat outside
  • (config-if)#exit
  • (config)#interface ethernet 1/0
  • (config-if)#ip nat inside

NAT Pool festlegen hier wird mit der aussenip überladen

  • configure terminal
  • (config)ip nat pool unkerich-pool 192.168.249.62 192.168.249.62 prefix-length 24

NAT Pool festlegen NAT ACL dem NAT Pool zuordnen

*configure terminal 
*(config)# ip nat inside source list 7 interface Ethernet0/0 overload

NAT ACL festlegen

  • configure terminal
  • (config)access-list 7 permit 172.22.2.0 0.0.0.255
  • (config-if)#exit

Variante B

NAT Inside und Outside Interfaces festlegen

  • configure terminal
  • (config)#interface ethernet 0/0
  • (config-if)#ip nat outside
  • (config-if)#exit
  • (config)#interface ethernet 1/0
  • (config-if)#ip nat inside

NAT Pool festlegen hier wird mit der aussenip überladen

  • configure terminal
  • (config)ip nat pool unkerich-pool 192.168.249.62 192.168.249.62 prefix-length 24

NAT ACL dem NAT Pool zuordnen

  • configure terminal
  • (config)ip nat inside source list 7 pool unkerich-pool overload

NAT ACL festlegen

  • configure terminal
  • (config)access-list 7 permit 172.22.2.0 0.0.0.255
  • (config-if)#exit


Aktive NAT anzeigen==

unkerich#show ip nat translations 
Pro Inside global         Inside local          Outside local         Outside global
tcp 192.168.250.97:35798  172.22.2.2:35798      192.168.250.1:22      192.168.250.1:22
tcp 192.168.250.97:48960  172.22.2.2:48960      192.168.250.1:22      192.168.250.1:22
tcp 192.168.250.97:48961  172.22.2.2:48961      192.168.250.1:22      192.168.250.1:22
tcp 192.168.250.97:48962  172.22.2.2:48962      192.168.250.1:22      192.168.250.1:22
tcp 192.168.250.97:48963  172.22.2.2:48963      192.168.250.1:22      192.168.250.1:22
tcp 192.168.250.97:48964  172.22.2.2:48964      192.168.250.1:22      192.168.250.1:22

Aktive NAT löschen

unkerich#clear ip nat translations *

Inside NAT

unkerich#configure terminal 
unkerich(config)#ip nat inside source static tcp 172.22.2.2 22 192.168.250.97 22 extendable                
unkerich(config)#exit
unkerich#

Links