R5에 네트워크가 생긴다면
R5
interface loopback 0
ip add 172.16.1.1 255.255.255.0
interface loopback 1
ip add 172.16.2.1 255.255.255.0
router
이렇게 해야한다.
터널을 생성한다면
static root를 생성할 필요가 없다. -> 노란색 줄
static으로 설정해주어야 터널을 통해서 지사로 간다. -> 파란색 줄
터널을 통해서 neighbor가 맺어지고 터널을 통해서 지사와 맺음 -> GRE를 쓰는 이유.
R6
int e1/0
ip add 59.5.100.6 255.255.255.0
no sh
R7에 172.16.3.7/32 Network을 추가합니다.
R2
interface tunnel 16
ip add 10.1.16.1 255.255.255.0
tunnel source 211.239.123.1
tunnel destination 59.5.100.6
ip ospf 1 area 2
R2
R6
어제 설정한 STATIC Route를 삭제하고, OSPF를 구성합니다.
STATIC Route 삭제
TEST를 위하여, R4,R5에 각각 Loopback0를 생성하고 OSPF에 포함합니다.
loopback 추가
Routing OSPF 구성
crypto isakmp key cisco address 61.250.123.4
-> 61.250.123.2와 IPSec 협상을 시작하세요. (단 Password : cisco를 확인)
-> Peer 인증
config)#crypto isakmp policy 10
config)#encryption ? (des)
config)#authentication ? (pre-share)
config)#hash ? (md5)
#show crypto isakmp sa
config)#crypto ipsec transform-set MYSET esp-3des
access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
crypto map MYMAP 10 ipsec-isakmp
set peer 61.250.123.2
set transform-set MYSET
match address 100
interface e0/2 (인터넷)
crypto map MYMAP
R2 shutdown
R4 shutdown
R6 shutdown
메모장에 있는 STEP1~STEP6까지의 설정을 적용합니다.
지사간 Routing이 없기 때문에, Static Route를 적용합니다.
R2(config)#ip route 192.168.2.0 255.255.255.0 211.239.123.3
지사간 통신의 경우, NAT에서 제외합니다.
R2(config)#no ip nat inside source list 1 interface e0/2 overload
R2(config)#ip nat inside source list 101 itnerface e0/2 overload
R2(config)#access-list 101 deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R2(config)#access-list 101 permit ip any any
Encryption algorithm = 3DES
integrity algorithm = MD5
Authentication alogirthm = Pre-shared Key
IPSec Protocol = ESP
Encryption algorithm = 3DES
integrity algorithm = sha
R1
crypto isakmp key cisco address 61.250.123.2
crypto isakmp policy 10
encryption des
authentication pre-shar
hash md5
crypto ipsec transform-set MYSET esp-3des esp-sha-hmac
access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
crypto map MYMAP 10 ipsec-isakmp
set peer 61.250.123.2
set transform-set MYSET
match address 100
interface e0/2
crypto map MYMAP
ip route 192.168.2.0 255.255.255.0 211.239.123.3
R2
crypto isakmp key cisco address 211.239.123.1
crypto isakmp policy 10
encryption des
authentication pre-shar
hash md5
crypto ipsec transform-set MYSET esp-3des esp-sha-hmac
access-list 100 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
crypto map MYMAP 10 ipsec-isakmp
set peer 211.239.123.1
set transform-set MYSET
match address 100
interface e0/3
crypto map MYMAP
ip route 192.168.1.0 255.255.255.0 61.250.123.3
Seoul#show crypto isakmp sa
dst src state conn-id status
61.250.123.2 211.239.123.1 QM_IDLE 1001 ACTIVE
current_peer 61.250.123.2 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 9, #pkts encrypt: 9, #pkts digest: 9 >>>> couter 증가 확인
#pkts decaps: 9, #pkts decrypt: 9, #pkts verify: 9
R3(ISP에서 Default Route를 전파해줌)
R2(R1에서 R5의 Loopback으로 가는 Traffic을 정의)
R4
R2
access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
access-list 100 permit ip 192.168.1.0 0.0.0.255 172.16.2.0 0.0.0.255
access-list 101 deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
access-list 101 deny ip 192.168.1.0 0.0.0.255 172.16.2.0. 0.0.0.255
access-list 101 permit ip any any
R4
access-list 100 permit ip 192.168.2.0 0.0.0.255 192.168.2.0 0.0.0.255
access-list 100 permit ip 172.16.2.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 101 deny ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 101 deny ip 172.16.2.0 0.0.0.255 192.168.1.0. 0.0.0.255
access-list 101 permit ip any any