Difference between revisions of "Cisco: NAT Dua Router Static Routing"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "center|400px|thumb R1: Ethernet1/1 - ke Internet Ethernet1/2 - R2: Ethernet 1/1 Ethernet1/3 - LAN R2: Ethernet1/1 - R1: Ethernet1/2 Ethernet1/2 - LAN...")
 
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
  enable
 
  enable
 
  configure terminal
 
  configure terminal
 +
  !
 +
  ! NAT GNS3 gw 192.168.122.1
 
   interface ethernet1/1
 
   interface ethernet1/1
     ip address dhcp
+
     ip address 192.168.122.100 255.255.255.0
     ip dhcp client request
+
     ip address 192.168.122.101 255.255.255.0 secondary
 +
    ip address 192.168.122.102 255.255.255.0 secondary
 +
    ip nat outside
 
     no shutdown
 
     no shutdown
     exit
+
     ip route 0.0.0.0 0.0.0.0 192.168.122.1
 +
    ip nat pool no-overload 192.168.122.100 192.168.122.102 prefix 24
 +
    ip nat inside source list 7 pool no-overload
 
   interface ethernet1/2
 
   interface ethernet1/2
 
     ip address 172.16.1.1 255.255.255.252
 
     ip address 172.16.1.1 255.255.255.252
 +
    ip nat inside
 
     no shutdown
 
     no shutdown
 
     exit
 
     exit
 
   interface ethernet1/3
 
   interface ethernet1/3
 
     ip address 192.168.1.1 255.255.255.0
 
     ip address 192.168.1.1 255.255.255.0
 +
    ip nat inside
 +
    no shutdown
 
     exit
 
     exit
 
   ip route 192.168.2.0 255.255.255.0 172.16.1.2
 
   ip route 192.168.2.0 255.255.255.0 172.16.1.2
 +
  !
 +
  ! access NAT permit ke LAN 192.168.1.0/24 & 192.168.2.0/24
 +
  ! 192.168.2.0/24 berada di R2
 +
  access-list 7 permit 192.168.1.0 0.0.0.255
 +
  access-list 7 permit 192.168.2.0 0.0.0.255
 
   exit
 
   exit
 
  copy running-config startup-config
 
  copy running-config startup-config
Line 42: Line 56:
 
   interface ethernet1/2
 
   interface ethernet1/2
 
     ip address 192.168.2.1 255.255.255.0
 
     ip address 192.168.2.1 255.255.255.0
 +
    no shutdown
 
     exit
 
     exit
 
   ip route 192.168.1.0 255.255.255.0 172.16.1.1
 
   ip route 192.168.1.0 255.255.255.0 172.16.1.1
Line 59: Line 74:
 
  ping 192.168.1.1
 
  ping 192.168.1.1
  
 
==Tambahan Kalau Membutuhkan NAT==
 
 
Menggunakan NAT untuk Memungkinkan Pengguna Internal Mengakses Internet
 
 
Jalankan langkah ini untuk memungkinkan pengguna internal anda mengakses Internet dan menyimpan alamat di kumpulan alamat global di dalam menggunakan kelebihan alamat global.
 
 
SUMMARY STEPS
 
 
enable
 
configure terminal
 
ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length }
 
access-list access-list-number permit source [source-wildcard ]
 
ip nat inside source list access-list-number pool name overload
 
interface type number
 
ip address ip-address mask
 
ip nat inside
 
exit
 
interface type number
 
ip address ip-address mask
 
ip nat outside
 
end
 
 
R1:
 
 
enable
 
configure terminal
 
ip nat pool net-168.1 192.168.1.1 192.168.1.254 netmask 255.255.255.0
 
access-list 1 permit 192.168.1.0 0.0.0.255
 
ip nat inside source list 1 pool net-168.1 overload
 
interface ethernet1/3
 
! ip address 192.168.1.1 255.255.255.0
 
ip nat inside
 
exit
 
interface ethernet1/1
 
! ip address 10.10.0.1 255.255.255.0
 
! ip address dhcp
 
ip nat outside
 
end
 
 
 
 
===Referensi===
 
 
* https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_nat/configuration/15-mt/nat-15-mt-book/iadnat-addr-consv.html
 
  
 
==Setting Client==
 
==Setting Client==

Latest revision as of 16:41, 23 December 2018

SR1.png


R1:

Ethernet1/1 - ke Internet
Ethernet1/2 - R2: Ethernet 1/1
Ethernet1/3 - LAN

R2:

Ethernet1/1 - R1: Ethernet1/2
Ethernet1/2 - LAN


R1:

enable
configure terminal
  !
  ! NAT GNS3 gw 192.168.122.1
  interface ethernet1/1
    ip address 192.168.122.100 255.255.255.0
    ip address 192.168.122.101 255.255.255.0 secondary
    ip address 192.168.122.102 255.255.255.0 secondary
    ip nat outside
    no shutdown
    ip route 0.0.0.0 0.0.0.0 192.168.122.1
    ip nat pool no-overload 192.168.122.100 192.168.122.102 prefix 24
    ip nat inside source list 7 pool no-overload 
  interface ethernet1/2
    ip address 172.16.1.1 255.255.255.252
    ip nat inside
    no shutdown
    exit
  interface ethernet1/3
    ip address 192.168.1.1 255.255.255.0
    ip nat inside
    no shutdown
    exit
  ip route 192.168.2.0 255.255.255.0 172.16.1.2
  !
  ! access NAT permit ke LAN 192.168.1.0/24 & 192.168.2.0/24
  ! 192.168.2.0/24 berada di R2
  access-list 7 permit 192.168.1.0 0.0.0.255
  access-list 7 permit 192.168.2.0 0.0.0.255
  exit
copy running-config startup-config

R2:

enable
config terminal
   interface ethernet1/1
    ip address 172.16.1.2 255.255.255.252
    no shutdown
    exit
  interface ethernet1/2
    ip address 192.168.2.1 255.255.255.0
    no shutdown
    exit
  ip route 192.168.1.0 255.255.255.0 172.16.1.1
  ip route 0.0.0.0 0.0.0.0 172.16.1.1
  exit
copy running-config startup-config


Test

R1:

ping 192.168.2.1

R2:

ping 192.168.1.1


Setting Client

LAN 1 Client:

ip 192.168.1.2
gw 192.168.1.1


LAN 2 Client:

ip 192.168.2.2
gw 192.168.2.1


Pranala Menarik