bxm's IT Story

Dynamic Routing Protocol - RIP EIGRP 재분배 본문

Network/Cisco (KEDU)

Dynamic Routing Protocol - RIP EIGRP 재분배

bxmsta9ram 2021. 6. 21. 12:15

## 하라는 대로 하기

## 14.14.0.0

## EIGRP 27

## R4에서의 루프백은 150.1.4.4(X) --> 14.14.4.4(O)로 수정


내가 쓴 코드

공통]

ena

conf t

no ip domain lookup

line c 0

  logg sy

  exec-timeout 0

  exit

line vty 0 4

  pass cisco

  exit

 

int s1/0

no shut

 

encapsulation frame-relay

no frame-relay inverse-arp

 

clock rate 64000

end

#아무것도 안하고 내버려 놔두면, LMI 프로토콜이 돌아서 LMI가 DLCI에 있는 모든 회선을 엮어버림 (Full-mesh로!!)

#그래서 DLCI가 모두 Mapping 되버리므로 우리는 3개만 쓰면 되므로 회선이 전부 Open이 되어버림.!!


R1]

conf t

int lo0

  ip add 14.14.1.1 255.255.255.0

  exit

 

int s1/0  

  ip add 14.14.123.1 255.255.255.0

  fram map ip 14.14.123.2 102 br

  fram map ip 14.14.123.3 102 br

## PVC 103이 없으므로, 어쩔 수 없이 102로 가야한다. 그림 확인!!

## Mapping 할 때만 조심하면 된다.

  

  do wr


R2]

conf t

int lo0

  ip add 14.14.2.2 255.255.255.0

  exit

  

int s1/0.123 m

  ip add 14.14.123.2 255.255.255.0

  fram map ip 14.14.123.1 201 br

  fram map ip 14.14.123.3 203 br

 

  do wr


R3]

conf t

int lo0

  ip add 14.14.3.3 255.255.255.0

  exit

 

int s1/0.123 m

  ip add 14.14.123.3 255.255.255.0

  fram map ip 14.14.123.2 302 br

  fram map ip 14.14.123.1 302 br

## PVC 301이 없으므로, 어쩔 수 없이 302로 가야한다. 그림 확인!!

## Mapping 할 때만 조심하면 된다.

 

int s1/0.34 p

  ip add 14.14.34.3 255.255.255.0

  fram inter 304

 

  do wr


R4]

conf t

int lo0

  ip add 14.14.4.4 255.255.255.0

  exit

 

int s1/0.34 p

  ip add 14.14.34.4 255.255.255.0

  fram inter 403

  

  do wr


## 자기 옆 통신 잘 되는지 확인

 

R1]

ping 14.16.123.2

ping 14.16.123.3

통신 양호

 

R2]

ping 14.14.123.1

ping 14.14.123.3

통신 양호

R3]

ping 14.14.123.1

ping 14.14.123.2

통신 양호

R4]

ping 14.14.34.4

통신 양호


## 이제 EIGRP 돌릴 차례

 

R1]

conf t

router eigrp 27

eigrp router-id 14.14.1.1

network 14.14.1.1 0.0.0.0

network 14.14.123.1 0.0.0.0

 

no auto

passive-interface lo0

end


R2]

conf t

router eigrp 27

eigrp router-id 14.14.2.2

network 14.14.2.2 0.0.0.0

network 14.14.123.2 0.0.0.0

 

no auto

passive-interface lo0

end


R3]

conf t

router eigrp 27

eigrp router-id 14.14.3.3

network 14.14.3.3 0.0.0.0

network 14.14.123.3 0.0.0.0

 

no auto

passive-interface lo0

end


## 이제 R3와 R4간의 RIP 설정

 

R3]

conf t

router rip

  ver 2

  net 14.0.0.0

  no auto

  passive-interface default

  end


R4]

conf t

router rip

  ver 2

  net 14.0.0.0

  no auto

  passive-interface lo0

  end

 

## 여기까지 했는데 R1과 R2는 R4를 못잡고

## R4는 R1과 R2를 잡지 못함.

show ip route로 확인했음.

 

 

 

 

 




선생님 코드

 

공통]

ena

conf t

no ip domain lookup

line c 0

  logg sy

  exec-timeout 0

  exit

line vty 0 4

  pass cisco

  exit

 

int s1/0

no shut

 

encapsulation frame-relay

no frame-relay inverse-arp

 

clock rate 64000

end


R1]

conf t

int lo0

  ip add 14.14.1.1 255.255.255.0

  exit

 

int s1/0  

  ip add 14.14.123.1 255.255.255.0

  fram map ip 14.14.123.2 102 br

  fram map ip 14.14.123.3 102 br  

  do wr


R2]

conf t

int lo0

  ip add 14.14.2.2 255.255.255.0

  exit

  

int s1/0.123 m

  ip add 14.14.123.2 255.255.255.0

  fram map ip 14.14.123.1 201 br

  fram map ip 14.14.123.3 203 br

  do wr


R3]

conf t

int lo0

  ip add 14.14.3.3 255.255.255.0

  exit

 

int s1/0.123 m

  ip add 14.14.123.3 255.255.255.0

  fram map ip 14.14.123.2 302 br

  fram map ip 14.14.123.1 302 br

 

int s1/0.34 p

  ip add 14.14.34.3 255.255.255.0

  fram inter 304

  do wr


R4]

conf t

int lo0

  ip add 14.14.4.4 255.255.255.0

  exit

 

int s1/0.34 p

  ip add 14.14.34.4 255.255.255.0

  fram inter 403

  do wr


## 자기 옆 통신 잘 되는지 확인

 

R1]

ping 14.16.123.2

ping 14.16.123.3

R2]

ping 14.14.123.1

ping 14.14.123.3

R3]

ping 14.14.34.4

## ping 14.14.34.4 가 안된다!!

## 또 된다..!

 

ping 14.14.123.1

ping 14.14.123.2

R4]

ping 14.14.34.4


## 이제 EIGRP 돌릴 차례

 

R1]

conf t

router eigrp 27

eigrp router-id 14.14.1.1

network 14.14.1.1 0.0.0.0

network 14.14.123.1 0.0.0.0

 

no auto

passive-interface lo0

end


R2]

conf t

router eigrp 27

eigrp router-id 14.14.2.2

network 14.14.2.2 0.0.0.0

network 14.14.123.2 0.0.0.0

 

no auto

passive-interface lo0

end


R3]

conf t

router eigrp 27

eigrp router-id 14.14.3.3

network 14.14.3.3 0.0.0.0

network 14.14.123.3 0.0.0.0

 

no auto

passive-interface lo0

end


## 이제 R3와 R4간의 RIP 설정

 

R3]

conf t

router rip

  ver 2

  net 14.0.0.0

  no auto

  passive-interface lo0

  no passive-interface s1/0.34

  end


R4]

conf t

router rip

  ver 2

  net 14.0.0.0

  no auto

  passive-interface lo0

  no passive-interface s1/0.34

  end

 



## 여기까지 나와 저 파란색 2줄 빼면 나와 똑같음!!

## 근데 R1<->R3왜 안가지나?

## R2에서 Split-horizon이 일어나서 그럼.

 

R2]

conf t

int s1/0.123

  no ip split-horizon eigrp 27

  

R1]

show ip int s1/0

## split horizon is disabled

## R1은 R2와 반대로 받았던 것을 또 토해내면 안되므로 Enabled가 되어야 함.

 

 

conf t

int s1/0

  ip split-horizon eigrp 27

  end

 

show ip route

## 3.0까지 나오는지 확인!

R1에서 3.0을 발견


R3]

## 상호재분배 (RIP에 들어가서 R4를 왼쪽으로 넘기기!)

show ip int s1/0.123

 

## EIGRP는 RIP 네트워크의 METRIC을 이해하지 못하기 때문에

## EIGRP의 METRIC을 RIP에 넣어줘야함.

## 근데 EIGRP에 2297856같은 컴포짓 메트릭을 RIP은 알지 못하기때문에

## 그래서 HOP 개념으로 넘겨줘야함!!

show run

## route-map 기법을 써야함.

    ==> R1은 몇HOP이고, R2는 몇HOP 이런식인데,, 또 HOP이라는게 뭔지도 알려줘야함.

           <prefix-list> = 1.0, 2.0, 123.0 이런거에 대한 정의

           <route-map> =  재분배  순서!!

 

conf t

router eigrp 27

redistribute rip metric 1544 2000 255 1 1500

## bandwidth delay reliablity load mtu

 

router rip

redistribute eigrp 27 route-map EIGRP_NET

exit

 

## 이제 route-map을 짜줘야함.

route-map EIGRP_NET

  match ip add pre HOP1

  set metric 1

  exit

 

route-map EIGRP_NET 20

  match ip add pre HOP2

  set metric 2

  exit

 

route-map EIGRP_NET 30

  match ip add pre HOP3

  set metric 3

  exit


ip prefix-list HOP1 permit 14.14.3.0/24

ip prefix-list HOP1 permit 14.14.123.0/24

 

ip prefix-list HOP2 permit 14.14.2.0/24

 

ip prefix-list HOP3 permit 14.14.1.0/24


R1]

show ip route

34.0과 4.0의 경우에는 EIGRP의 외부 Network이므로, EX가 붙는다.

 

 

R4]

## 그렇다면 R4에서는 HOPS로 나타나야함!!

show ip route

HOPS로 제대로 나타났음!

R1]

ping 14.14.4.4

R1->R4까지 통신 양호!


## 3번

## R4에게 14.14.0.0/16 정보만을 광고하도록 하라.

## R3에서 우측으로 축약하라는 뜻임

R3]

conf t

int s1/0.34

  ip summary-address rip 14.14.0.0 255.255.0.0

  ## 선생님이 ip summary-address eigrp 27 14.14.0.0 255.255.0.0

  ## 하셨다가 rip인거 아시고 다시 고치셨음!!

  end

## 이렇게 광고하라는 뜻임.

 

 

show ip eigrp nei

 

 

clear ip eigrp nei

 

show ip eigrp nei

## 60초 기다리면 변경값이 나옴.


R4]

clear ip ro *

## 라우팅 테이블이 지워짐. 죽은 IP들을 다 없애기!! 축약된 것만 나오면 되므로

 

show ip route


R1]

show ip route

 

clear ip ro *

show ip route

축약된 것이 넘어올까봐 확인하라고 한 것인데, 넘어오진 않았음.


선생님 추가문제!! 풀어보기!!

R1]

conf t

int lo9

ip add 9.9.4.1 255.255.255.0

ip add 9.9.5.1 255.255.255.0 sec

ip add 9.9.6.1 255.255.255.0 sec

ip add 9.9.7.1 255.255.255.0 sec

## 이 것들을 EIGRP에 포함시켜 광고해보자.


exit

router eigrp 27

network 9.9.4.0 0.0.3.255

## 축약이 되는건 2의 n승의 배수이므로 4

## 그리고 4개 들어가므로, 경우의 수 4개는 (0,1,2,3__4개)

 

## 이해가 잘 안가서 선생님이 추가로 이론강의 해주심!!

0000 1001 . 0000 1001 . 0000 0100 . 0000 0000

0000 0000 . 0000 0000 . 0000 0011 . 1111 1111

-----------------------------------------------------

      ①             ②             ③              ④

 

Wildcard Mask는 0이면 일치, 1이면 무관

 

① 무조건 1001이 되어야함.

② 무조건 1001이 되어야함.

③ 끝의 3번째 자리에선 무조건 1이 와야하고, 와일드카드가 11이면 마지막 1,2자리가 아무거나 와도 상관 없으므로,

                                         100(4), 101(5), 110(6), 111(7)   딱 9.9.(4~7).1 이므로 

                                         와일드마스크는 0.0.3.255 이다. 

    00 -> 4

    01 -> 5

    10 -> 6

    11 -> 7

 


R1]

conf t

int s1/0.123 

  ip summary-address eigrp 27 9.9.4.0 255.255.252.0

 

## 근데 s1/0.123 안들어가진다 ;;

## 1이면 네트워크## 0이면 HOST## 경우의 수가 4개니까 3번째 자리는 252가 된다.

 

 

R3]

clear ip ro *

show ip route

 

## 9.0.0.0/22인 22비트짜리 한 개가 보임.

 

 

 

 


* Wildcard *

네트워크에 속한 HOST를 나타낼 때 쓰는 표현 기법[네트워크

 

* Subnet-Mask *

네트워크와 HOST를 구분하기 위해 쓰는 표현 기법

 

실제로 두 개가 완전히 대척점에 있는 개념이라고는 할 수 없으나,따지고 보면 그렇게 보아도 된다.

 

네트워크 선언할때,Access-list 쓸 때, Wildcard를 씀.특정 네트워크 선언이나, 범위 지정할 때 쓰는 것.


 

<네트워크> 0000 1001 .  0000 1001 .  0000 01[00 . 0000 0000]

<마스크>    1111 1111 . 1111 1111 .  1111 11[00 . 0000 0000] 

---------------------------------------------------------------------

               ## 1이 있는 저기까지가 네트워크의 범위이다!

               ## 그래서 3번째 묶음에서의 1111 11 = 252

               ## 00은 00, 01, 10, 11 4묶음 (근데 위의 네트워크에서 1 이 있기 때문에 100(4),101(5),110(6),111(7)임

 

 

 

생각을 해보면, 일반 Mask 이기 때문에 맨 마지막 묶음이 0000 0000이어서 HOST는 뭐가 되든 상관 없음!!

하지만 반대로 Wildcard Mask는 아래가 1111 1111이어야지만 위에가 무엇이 되든 상관없다는 뜻임!!

 

2021년 6월 21일 자의 나는 이해했음. 



Wildcard Mask와  그냥 Subnet-Mask에 대해서 차이점 명확히 알아보자. 구글링 통해서라도!!