Tuesday, October 28, 2025

Simulasi VPN dengan Packet Tracert


-----------------------------------------------------------------------
      R1
-----------------------------------------------------------------------
Router>enable 
Router(config)#hostname R1
R1(config)#interface fa0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown 
R1(config-if)#exit

R1(config)#interface fa0/1
R1(config-if)#ip address 1.0.0.1 255.0.0.0
R1(config-if)#no shutdown 
R1(config)#exit

R1#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
-----------------------------------------------------------------------
Routing
-----------------------------------------------------------------------
R1(config)#ip route 0.0.0.0 0.0.0.0 1.0.0.2
R1(config)#exit
========================
R2
========================
Router>enable 
Router#configure t
Router(config)#hostname R2
R2(config)#int fa0/0
R2(config-if)#ip address 1.0.0.2 255.0.0.0
R2(config-if)#no shutdown 
R2(config-if)#exit

R2(config)#int fa0/1
R2(config-if)#ip address 2.0.0.1 255.0.0.0
R2(config-if)#no shutdown 
R2(config-if)#exit
R2(config)#exit

R2#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
R2#
-----------------------------------------------------------------------
    Routing
-----------------------------------------------------------------------
R2(config)#ip route 0.0.0.0 0.0.0.0 1.0.0.1
R2(config)#ip route 0.0.0.0 0.0.0.0 2.0.0.2
R2(config)#exit
R2#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 1.0.0.1 to network 0.0.0.0

C    1.0.0.0/8 is directly connected, FastEthernet0/0
C    2.0.0.0/8 is directly connected, FastEthernet1/0
S*   0.0.0.0/0 [1/0] via 1.0.0.1
               [1/0] via 2.0.0.2

R2#copy running-config startup-config 
R2#ping 192.168.1.2

-----------------------------------------------------------------------
R3
-----------------------------------------------------------------------
Router>enable 
Router#configure terminal 
Router(config)#hostname R3
R3(config)#int fa0/0
R3(config-if)#ip address 2.0.0.2 255.0.0.0
R3(config-if)#no shutdown 

R3(config-if)#exit
R3(config)#int fa0/1
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no shutdown 

R3(config-if)#exit
R3(config)#exit
R3#copy running-config startup-config 

-----------------------------------------------------------------------
Routing
-----------------------------------------------------------------------
R3(config)#ip route 0.0.0.0 0.0.0.0 2.0.0.1
R3(config)#exit
R3#
R3#copy running-config startup-config 

-----------------------------------------------------------------------
PC0
-----------------------------------------------------------------------
PC>tracert 192.168.2.2

Tracing route to 192.168.2.2 over a maximum of 30 hops: 

  1   0 ms      0 ms      0 ms      192.168.1.1
  2   *         0 ms      *         Request timed out.
  3   0 ms      0 ms      0 ms      2.0.0.2
  4   0 ms      0 ms      0 ms      192.168.2.2

Trace complete.

-----------------------------------------------------------------------
CREATE INTERFACE TUNNEL R1 dan R3
-----------------------------------------------------------------------
R1(config)#interface tunnel ?
  <0-2147483647>  Tunnel interface number
R1(config)#interface tunnel 10

R1(config-if)#ip address 172.16.1.1 255.255.0.0
R1(config-if)#tunnel source fa0/1
R1(config-if)#tunnel destination 2.0.0.2
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel10, changed state to up

R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#exit
R1#copy running-config startup-config 
----------------------------------------------------------------------
R3(config)#interface tunnel 20
R3(config-if)#
%LINK-5-CHANGED: Interface Tunnel20, changed state to up

R3(config-if)#ip address 172.16.1.2 255.255.0.0
R3(config-if)#tunnel source fa0/0
R3(config-if)#tunnel destination 1.0.0.1

R3(config-if)#no shutdown 
R3(config-if)#exit
R3(config)#exit
R3#copy running-config startup-config 

R3#ping 172.16.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

R1#ping 172.16.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms

R1#

-----------------------------------------------------------------------
vpn routing R1 & R3
-----------------------------------------------------------------------
R1(config)#ip rout?
route  routing  
R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.2
R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1

-----------------------------------------------------------------------
  Cek koneksi dari PC2
-----------------------------------------------------------------------
PC>tracert 192.168.1.2

Tracing route to 192.168.1.2 over a maximum of 30 hops: 

  1   1 ms      0 ms      0 ms      192.168.2.1
  2   0 ms      0 ms      0 ms      172.16.1.1
  3   0 ms      0 ms      0 ms      192.168.1.2

Trace complete.
-------
PC1
-------
PC>tracert 192.168.2.2

Tracing route to 192.168.2.2 over a maximum of 30 hops: 

  1   0 ms      0 ms      0 ms      192.168.1.1
  2   0 ms      0 ms      0 ms      172.16.1.2
  3   0 ms      0 ms      0 ms      192.168.2.2

Trace complete.

PC>

======================
R1#show interfaces tunnel 10
Tunnel10 is up, line protocol is up (connected)
  Hardware is Tunnel
  Internet address is 172.16.1.1/16
  MTU 17916 bytes, BW 100 Kbit/sec, DLY 50000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation TUNNEL, loopback not set
  Keepalive not set
  Tunnel source 1.0.0.1 (FastEthernet0/1), destination 2.0.0.2
  Tunnel protocol/transport GRE/IP
    Key disabled, sequencing disabled
    Checksumming of packets disabled
  Tunnel TTL 255
  Fast tunneling enabled
  Tunnel transport MTU 1476 bytes
  Tunnel transmit bandwidth 8000 (kbps)
  Tunnel receive bandwidth 8000 (kbps)
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 1
  Queueing strategy: fifo
  Output queue: 0/0 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
 --More--