물리서버

0. GRE-Over-IPsec Pre-config

_눙이_ 2021. 11. 23. 12:56
반응형

                                                         ### GRE-Over-IPsec (Static route)






                       ## 공중망 구성

EX1) GIT-A , GIT-B , ISP-1 , ISP-2 , ISP-3 , ISP-4 구간에 OSPF Routing Protocol을 사용하여 공중망을 구성하시오
 .OSPF Process = 1 , Area = 0
 .Router-ID = GIT = X.X.X.X , ISP =  XX.XX.XX.XX (X = Router 번호)
 .OSPF 라우팅 업데이트가 필요한 Interface로만 OSPF Packet이 송신되어야 한다.
 .ISP-1 , ISP-2 , ISP-3의 Loopback 0 네트워크는 OSPF에 포함되어야 한다.
 .OSPF환경내의 모든 네트워크는 Interface에 할당된 SubnetMask로 확인되어야 한다.
 .GIT-A , GIT-B의 사설 네트워크는 OSPF에 포함되지 않아야한다.

    # ISP-1 (R3)
router ospf 1
 router-id 11.11.11.11
 passive-interface default
 no passive-interface serial 1/0.10
 no passive-interface serial 1/0.12
 network 100.100.11.0  0.0.0.255 area 0
 network 121.160.10.0  0.0.0.255 area 0
 network 121.160.12.0  0.0.0.255 area 0
!
interface loopback 0
 ip ospf network point-to-point
!

    # ISP-2 (R4)
router ospf 1
 router-id 22.22.22.22
 passive-interface default
 no passive-interface serial 1/0.12
 no passive-interface serial 1/0.23
 network 100.100.12.0  0.0.0.255 area 0
 network 121.160.12.0  0.0.0.255 area 0
 network 121.160.23.0  0.0.0.255 area 0
!
interface loopback 0
 ip ospf network point-to-point
!

    # ISP-3 (R5)
router ospf 1
 router-id 33.33.33.33
 passive-interface default
 no passive-interface serial 1/0.23
 no passive-interface serial 1/0.34
 network 100.100.13.0  0.0.0.255 area 0
 network 121.160.23.0  0.0.0.255 area 0
 network 121.160.34.0  0.0.0.255 area 0
!
interface loopback 0
 ip ospf network point-to-point
!





    # ISP-4 (R6)
router ospf 1
 router-id 44.44.44.44
 passive-interface default
 no passive-interface serial 1/0.20
 no passive-interface serial 1/0.34
 network 100.100.14.0  0.0.0.255 area 0
 network 121.160.20.0  0.0.0.255 area 0
 network 121.160.34.0  0.0.0.255 area 0
!
interface loopback 0
 ip ospf network point-to-point
!

        정보 확인

ISP-1# show ip ospf neighbor   [인접성 2개 확인]
ISP-2# show ip ospf neighbor   [인접성 2개 확인]
ISP-3# show ip ospf neighbor   [인접성 2개 확인]
ISP-4# show ip ospf neighbor   [인접성 2개 확인]



=========================================================================================================================

                       ## GIT 내부망에서 외부 네트워크로 통신하기위한 Default-route 생성

-내부 GIT Router에서 외부 네트워크로 통신하기위한 Static Default-route 생성

    # GIT-A (R1)
ip route 0.0.0.0  0.0.0.0  121.160.10.11
!

    # GIT-B (R2)
ip route 0.0.0.0  0.0.0.0  121.160.20.4
!

     정보 확인

GIT-A# show ip route
      100.0.0.0/24 is subnetted, 1 subnets
C        100.100.1.0 is directly connected, Loopback0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
      121.0.0.0/24 is subnetted, 1 subnets
C        121.160.10.0 is directly connected, Serial1/0.10
S*   0.0.0.0/0 [1/0] via 121.160.10.11



GIT-B# show ip route
      100.0.0.0/24 is subnetted, 1 subnets
C        100.100.2.0 is directly connected, Loopback0
C    192.168.20.0/24 is directly connected, FastEthernet0/1
      121.0.0.0/24 is subnetted, 1 subnets
C        121.160.20.0 is directly connected, Serial1/0.20
S*   0.0.0.0/0 [1/0] via 121.160.20.4








=========================================================================================================================

                      ## 사설망을 연결하기위한 Tunnel 생성

EX) GIT-A와 GIT-B 구간을 GRE Tunnel을 사용하여 연결하시오
 .GIT-A와 GIT-B 구간 Tunnel에 할당할 IP 주소는 172.16.10.0/24를 사용해야한다.
 .Tunnel로 통신시 사용할 공인 Source IP address , Destination IP address는  
  ISP-1 , ISP-4에 직접 연결된 물리적인 Interface의 IP 주소를 사용해야 한다.

   # GIT-A (R1)
interface tunnel 12
 ip address 172.16.10.1  255.255.255.0
 tunnel source 121.160.10.1
 tunnel destination 121.160.20.2
!

   # GIT-B (R2)
interface tunnel 12
 ip address 172.16.10.2  255.255.255.0
 tunnel source 121.160.20.2
 tunnel destination 121.160.10.1
!

-GRE Tunnel interface를 생성한후 "show ip interface brief" command를 사용하여 정보확인하게되면
  Tunnel interface의 Layer 2이 down상태로 확인된다.

-Tunnel 구성시 "tunnel destination"으로 설정된 IP 주소가 해당 Router의 Routing table에서 확인되면
  Tunnel interface의 Layer 2이 up상태로 전환된다.

     정보 확인

GIT-A# show ip route   [GIT-A의 Routing table에는 172.16.10.0/24 네트워크가 Connecte로 확인된다.]
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, Tunnel12
     ~~~~~~~ 중간 생략 ~~~~~~~
GIT-A# ping 172.16.10.2


GIT-B# show ip route   [GIT-B의 Routing table에는 172.16.10.0/24 네트워크가 Connecte로 확인된다.]
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, Tunnel12
     ~~~~~~~ 중간 생략 ~~~~~~~
GIT-B# ping 172.16.10.1


      # Dynagen
=> capture R1 s1/0 GRE.cap FR


GIT-A# ping 172.16.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 816/945/1108 ms



                  # GIT-A  ----->  GIT-B
========================================================
-SA : 121.160.10.1 |   GRE | -SA : 172.16.10.1 |  ICMP |
-DA : 121.160.20.2 |  | -DA : 172.16.10.2 | Request |
========================================================


                  # GIT-A  <-----  GIT-B
========================================================
-SA : 121.160.20.2 |   GRE | -SA : 172.16.10.2 |  ICMP |
-DA : 121.160.10.1 |  | -DA : 172.16.10.1 |  Reply |
========================================================
















=========================================================================================================================

                      ## GIT-A (본사)와 GIT-B (지사)간 연결을 위해서 Static route 생성

ISP-1# show ip route   [ISP Router의 Routing Table에는 사설 IP 주소 172.16.10.0/24 네트워크가 확인되지 않는다.]
ISP-2# show ip route   [ISP Router의 Routing Table에는 사설 IP 주소 172.16.10.0/24 네트워크가 확인되지 않는다.]
ISP-3# show ip route   [ISP Router의 Routing Table에는 사설 IP 주소 172.16.10.0/24 네트워크가 확인되지 않는다.]
ISP-4# show ip route   [ISP Router의 Routing Table에는 사설 IP 주소 172.16.10.0/24 네트워크가 확인되지 않는다.]


    # GIT-A
ip route 192.168.20.0  255.255.255.0  172.16.10.2
          -------- OR --------
ip route 192.168.20.0  255.255.255.0  tunnel 12
!

    # GIT-B
ip route 192.168.10.0  255.255.255.0  172.16.10.1
          -------- OR --------
ip route 192.168.10.0  255.255.255.0  tunnel 12
!

           정보 확인

GIT-A# show ip route
      172.16.0.0/24 is subnetted, 1 subnets
C        172.16.10.0 is directly connected, Tunnel12
C    192.168.10.0/24 is directly connected, FastEthernet0/0
S    192.168.20.0/24 [1/0] via 172.16.10.2
      ~~~~~~~ 중간 생략 ~~~~~~~

PC1# ping 192.168.20.2



GIT-B# show ip route
      172.16.0.0/24 is subnetted, 1 subnets
C        172.16.10.0 is directly connected, Tunnel12
S    192.168.10.0/24 [1/0] via 172.16.10.1
C    192.168.20.0/24 is directly connected, FastEthernet0/1
      ~~~~~~~ 중간 생략 ~~~~~~~

PC2# ping 192.168.10.1









=========================================================================================================================

EX) GIT-A의 192.168.10.0/24와  GIT-B의 192.168.20.0/24 네트워크간 통신시 정보보호가 실시되어져야 한다.

     [Phase 1]
-인증방식  : 사전 인증방식 (사전 인증방식 , 인증서 방식 , RSA 인증)
-암호화 알고리즘 : 3DES (DES , 3DES , AES)
-인증 알고리즘  : MD5 (MD5 , SHA)
-Key교환 알고리즘 : Diffie-Hellman 2 (1,2,5)
-Key교환 주기  : 1시간

   [Phase 2]
-IPsec Protocol : ESP
-암호화 알고리즘 : AES
-인증 알고리즘 : SHA-HMAC

   # GIT-A (R1)
access-list 101 permit ip 192.168.10.0  0.0.0.255  192.168.20.0  0.0.0.255
!
crypto isakmp enable 
!
crypto isakmp policy 10
 authentication pre-share
 encryption 3des
 hash md5
 group 2
 lifetime 3600
!
crypto isakmp key 0 cisco address 121.160.20.2
!
crypto ipsec transform-set IPSEC esp-aes esp-sha-hmac
!
crypto map IPSEC_VPN 10 ipsec-isakmp
 set peer 121.160.20.2
 set transform-set IPSEC
 match address 101
!
interface tunnel 12
 crypto map IPSEC_VPN
!

   # GIT-B (R2)
access-list 101 permit ip 192.168.20.0  0.0.0.255  192.168.10.0  0.0.0.255
!
crypto isakmp enable 
!
crypto isakmp policy 10
 authentication pre-share
 encryption 3des
 hash md5
 group 2
 lifetime 3600
!
crypto isakmp key 0 cisco address 121.160.10.1
!
crypto ipsec transform-set IPSEC esp-aes esp-sha-hmac
!
crypto map IPSEC_VPN 10 ipsec-isakmp
 set peer 121.160.10.1
 set transform-set IPSEC
 match address 101
!
interface tunnel 12
 crypto map IPSEC_VPN
!

     정보 확인

=> capture R1 s1/0 IPSEC.cap FR

PC1# ping 192.168.20.2  source 192.168.10.1


GIT-A# show crypto isakmp peer      : Phase-1 연결 확인
Peer: 121.160.20.2 Port: 500 Local: 121.160.10.1
 Phase1 id: 121.160.20.2


GIT-A# show crypto engine connection active       : 암/복호화 확인
Crypto Engine   Connections
      ID Interface Type  Algorithm           Encrypt  Decrypt IP-Address
       1 Tu12         IPsec AES+SHA 0           9 121.160.10.1
       2 Tu12         IPsec AES+SHA          9           0 121.160.10.1
   1001 Tu12        IKE   MD5+3DES          0           0 121.160.10.1































































반응형