본문 바로가기
♣ 사과나무 심는 마음으로..

나도 배우는 네트워크 설계 및 구축(IP라우팅)

by FloralPig 2016. 5. 28.

  신청한 교육과정은 "iOS 앱개발"이었지만 수강인원이 부족하여 폐강... 대신 폐강 위기에 있는 네트워크 설계 및 구축(IP 라우팅) 교육을 받게됐다.  

  강사가 현업에 오랜기간 참여했고 교육학(석사) 전공자라 이해도가 높은 교육으로 매우 만족스러웠다.


ㅇ 기간 : 2016.05.26~05.27

ㅇ 장소 : 서울시 인재개발원 데이터센터

ㅇ 강사 : 오동진 (http://cafe.naver.com/ooddjj)

ㅇ 교육목표 : 현업에 사용 중인 네트워크 장비에 대한 관리 능력 향상

ㅇ 교재 : IP Routing 개정4판(저자 피터전)



 

실습을 위한 준비 관리자 계정으로 변경

제어판-관리도구-컴퓨터 관리-로컬사용자-사용자-administrator-계정사용안함 비활성화-재시작-admin으로 로그인

 

학습목표 internetwork의 동작을 배운다- 그중 routing을 배운다.

internet(work) 동작 구성 = switching + routing

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

                                 LAN      WAN


internet(work)은 무수한 LAN으로 구성되고 LANLAN 사이 연결이 WAN

 

******** LAN의 정의 **********

1. MAC 주소(48bit)에 기반하여 내부 통신 구현 영역 or 내부 통신이 가능한 영역  * MAC주소 : 출발지와 도작지의 기본 

   .... router 전원 꺼도 LAN이 가능한 이유

2. 동일한 network IP(해당 LAN의 식별자) 공유하는 공간

   IP주소 000.000.00.00                * IP v4(32bit) / IP v6(128bit)

            -------- ---

           network IP  host IP

 

   = 같은 기본 의 주소 갖는 것

   episode : 고정 IP일 경우 한 host가 임의로 gateway router IP를 수정 시 큰 문제 발생

              - IP충돌 같은 LAN host 모두 인터넷 연결 안됨

              -> so, DHCP(dynamic host configuration protocol)

3. 단일 ARP(IP 주소 기반 MAC 주소 확인 protocol) 영역

 

*  용어 정립

         잘못된 표현                   바른 표현

         dummy hub       ->          hub

         switch hub        ->          switch(MAC 주소에 기반)

         (상표명일뿐)

 

****** routing = LANLAN 연결 / router간 연결 *****

IP 주소(network IP)에 기반하여 외부통신 구현

     * h/w rounter           s/w gateway

  ; story telling rounterMAC 주소 찾아 switch하고 출발지 router에서 도착지 LAN으로 routing

 

   mesh topology = internet : 일부 고장 시 우회로 확보 -> I.e. 우회기법이 routing

 

   **** routing = 목적지에 도달하기 위한 무수한 경로 중 최상의 경로를 찾는 기법(기술)

                   이때 algorithm(routing algorithm = 문제해결 절차) 필요

메트릭(빠르다의 기준)의 차이에 따라 protocol 개발

         RIP / OSPF / ISIS / EIGRP

         BGP

 

RIP의 메트릭 : hop count(경유 router) 수가 가장 적은 경우를 찾아 routing

                  ->but, 링크속도 반영 못함

                  ->보완, cost(bandwidth)로 계산 --> OSPF

                                                                   ->but, 실제 운영시 빠른 경로에 traffic 몰림

                                                                   ->보완, cost(bandwidth + delay) 계산

 

                                                       --> EIGRP(ping 출발지 -> 도착지, 도착지 -> 출발지 

                                                                      경로를 달리하여 빠른 처리 가능)

 

******* 실습을 위한 기본 설정 *******

1.  확장자 보이게 설정 : 제어판-폴더옵션-보기-확장자 보이게 설정

2 . 필요한 설치 프로그램들....

    

    * c3660-kj9o3s-mz.124-15.T8.bin    

         c3660 cisco 모델명

         k 보안기능 있음을 표시

         124 버전 ................. IOS(iOS 아님)운영체계에서 최적화되어 있음.

    * Dynamips IOS 불러오는 기능

    * WinPcap LAN카드를 Promiscous 모드로 변환

                    Dynamyps 보다 먼저 설치

3.  WinPcap 설치

4.  Dynamips 설치 (안에 dynagen 포함)

    ** admin 모드에서 설치 : user에서 설치 시 권한 제한 있을 수 있음

5.  c3660-jk9o3s-mz.124.T8.bin 복사

    C:\Program Files (x86)\Dynamips\images

6.  EditPlus 설치 설정 변경

     

7. Tera Term 설치 설정 변경

    

8.  확장자 .net 파일 만들기(텍스화일로) : C:\Program Files (x86)\Dynamips\sample_labs

     

 

9.  EditPlus 실행

     

10. 설정 변경 : 도구-기본설정 / 저장시 백업 해제

     

********* rounter.net 내용 *************

autostart = True

 

[localhost]

 

[[3660]]

 

image = C:\Program Files\Dynamips\images\c3660-jk9o3s-mz.124-15.T8.bin

-> image = C:\Program Files (x86)\Dynamips\images\c3660-jk9o3s-mz.124-15.T8.bin

 

#IOS 12.4(15)T8

 

ram = 128

nvram = 128

disk0 = 128

mmap = True

ghostios = True

confreg = 0x2102

#idlepc = 0x60600f6c

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

********** Tera Term router R1에서 실행  *******************

[[ROUTER R1]]

 

model = 3660

#s1/0 = R2 s1/1

console = 2001

 

#Configuration

 

enable

configure terminal

hostname R1

no ip domain-lookup

security passwords min-length 4

enable password 1234

enable secret 4321

username admin password 1234

login block-for 30 attempts 5 within 10

login delay 3

login on-failure log

login on-success log

security authentication failure rate 5 log

service password-encryption

ip domain-name cisco.com

crypto key zeroize rsa

crypto key generate rsa general-keys modulus 1024

 

ip ssh time-out 120

ip ssh authentication-retries 3

line vty 0 15

login local

transport input ssh telnet

exit

line console 0

exec-timeout 0 0

end



********* 설치 확인 *************

1.  Dynamips Server 실행

     

2.  net 파일(rounter.net) 실행

     

3. 원격접속프로그램 실행 (,Tera Term) : 새로 만들기 telnet 설정 후 포트(임의값) 번호 입력

   :  R1 - 한 개 rounter 사용 /  2001 -포트

   tera term 실행 – 새 ROUTER 생성

    

 

   * dynagen :  list 친 후 엔터

    

   * dynagen : telnet R1 -> 에러 window 7telnet 지원 안함

    

    제어판-프로그램 제거 또는 변경-"windows 기능 사용/사용 안함"에서 확인 가능 : telnet 서버 없음

    


******** dynagen :  idlepc get R1 ---- 최적화 찾기 ******

1. "*"이 없는 경우 위 화살표 눌러 반복(이전 실행명령 불러오기) 실행

2. "*"이 여러개일 경우 가장 큰 수 선택

   찾은 수치 입력-엔터

   ******* cpu28-> 2까지 낮아짐

   idelpc save R1

   

   net 화일 수정 : idlepc = 0x60648bb8 위로 이동 : R1뿐 아니라 모든 Router에 적용한다.

        

               RAM 128 : 높이면 속도 up

               # : 주석

               포트 2001, 2002 ~ : 임의값 216 이하


********  3rounter 연결************

1. R1 의 주석표시 “#” 삭제

   R1 S 1/0R2S 1/1에 연결

             S   1   /  1

        (main board / port).... S: serial interface, WAN 쪽 인터페이스

   * router interface : 허브의 port와 같은 장비

   * ethernet interface : LAN 쪽 인터페이스

   *** Ctrl+“C” : 명령 실행 중간에 빠져나오기

    

    


************  Tera Term에서 새연결(R2) 만들기  **************

---> 결과


**************  Tera Term R1(포트 2001) 기본 config 구성을 위한 명령 복사  ********

아래 명령어들을 복사 후 : Tera Term 수정 붙여넣기

R2(포트 2002)도 명령의  R1R2로 변경 후 복사

#Configuration

 

enable

configure terminal

hostname R1

no ip domain-lookup

security passwords min-length 4

enable password 1234

enable secret 4321                                       "1234"보다 우선 암호로 저장

username admin password 1234

login block-for 30 attempts 5 within 10  10초 동안 5번 무차별 로그인 시 30block

login delay 3                                        실패 로그인 시 3초 후 로그인 가능

 

login on-failure log                                               로그화일에 저장 명령

login on-success log

security authentication failure rate 5                     log 5번 실패시 로그파일 남김

 

service password-encryption

ip domain-name cisco.com

crypto key zeroize rsa

crypto key generate rsa general-keys modulus 1024                  원격 접속 관련

 

ip ssh time-out 120

ip ssh authentication-retries 3

line vty 0 15

login local                                                               원격 접속 관련

transport input ssh telnet                          원격 접속 - ssh로도 접속 받겠다.

exit

line console 0

exec-timeout 0 0

end


  *** 손쉬운 명령어 입력 : "tab" 키(명령어 완성기능) 사용

  


   일반모드 -> 관리자모드 : enable 암호(“4321”)     * 유닉스는 “u -“

   관리자모드 루트 -> 일반모드 루트 : exit

   *end : 바로 루트로 이동 / exit : 전 단계로 단계별 이동


************** Router의 구조 *********** 

- NVRAM : 사용자 작업 내용

- Flash : OS 저장]


- Router의 작업진행 story

  전원 ROM(초기화, post 과정) -(h/w적 부팅)- Flash(IOS) - RAM(IOS 압축풀면서 RAM에 올림) -(s/w적 부팅)-       

  NVRAM(작업내용이 없는 경우 dialog configuration)


- show startup-config : NVRAM 저장내용 보여줌


- console : 처음 구입 후 console에 물려 local에서 사용

- auxiliary : 외장형 장비(전화 모뎀 등)와 연결

- interface : 회선 연결, 6(ethernet 2, serial 4)


********** 확인해야 할 중요한 세가지 : show *********

1. show running-config : RAM 현재 작업한 내용

    * 페이지 단위로 넘기려면 “spacebar”


2. show interface ... 첫줄이 내용이 중요

    ... serial is up (물리적 조건) line protocol is up (논리적 조건모두 충족해야 연결가능


    *show interface serial 1/0 ..... filtering해서 볼 수 있다.


    해당 interfaceIP 부여 후 1. line protocol is down -> up

                                  2. administratively down -> up

3. show ip route

    routing table(routing의 기본, 핵심) 보여줌

 

     privilege 모드(enable) -> confing 모드 -> interface 모드 -> ip부여 ->no shutdown : rounter 활성화

    * console명령과 입력명령이 섞인 경우 : tab

    

    R2 해당 포트에 ip 부여 

    

    ping 확인

    



************** IP 구성 ***************

예) 210.168.10.0/24 ... /24 : prefix 표기법, 24bit “210.168.10”networt ip로 사용

    * 210.168.10.0/16이라면 “210.168”networt ip로 사용

    210.168.10.0 : network ip 주소, host ip로 사용 안함

    210.168.10.1 255.255.255.0

                .2

                 .....

                .254

    210.168.10.255 255.255.255.0 : broadcast ip주소 , 전체를 대표, host ip로 사용 안함

    ->so, 254host 가능

 


   

  


********* 용어 설명 *****************

- LAN protocol : ethernet(표준), tockening, FDDI

- WAN protocol : ATDLC, PPP, X.25, ATM.... 표준 없음

 

- 실제로는 “no shutdown” 전에 WAN protocol 맞추는 과정 필요

- VMware : 가상운영체계 연결

- loopback interface : 교재 31페이지 ----> no shutdown 불필요

 

- IGP : RIP, OSPF, IS-IS, EIGRP..... AS(정책수립 업체)로 구분... AS number(고유번호)있음.

- 관리거리(AP administrative distance) : 고유식별자(업체별 표준 없음)

   예) Cisco : RIP120, OSPF 110, IS-IS 150, EIGRP 90

   *** 같은 조건의 메트릭의 경우 낮은 관리거리 선택

   *** EGP : BGP..... 다른 AS간 연결

 

 

- 재분재 : 상이한 메트릭 호환

- routing table ... logic : 목적지, 경유지로 구성... 인근에 꼭 경유지 있음

   예R1(출발) - R2(경유) - R3(목적)

        PC(목적) - R1(경유) - R2(출발)

        R1(출발) - Serial interface(경유) - R2(목적)

 

- longest match role

  목적지 - 경유지 10.10.10.0/24 .... 제일 우선

                     10.10.10.0/16

                     10.10.10.0/8


- 확장 ping  

  

  R1- PC2 연결의 경우 : 수동 조정으로 출발지가 R1Serial interface가 아닌 ethernet interface에서 출발

   -> so, R1의 내부적 점검 가능(장애 진단 시 유용)

        명령어 source 사용

 

- route 구성 방법 : 동적, 정적

 

   stub networt(단말단) : 동적으로 구성 시 Backbone router와의 정보 전달에 과부화

   -> so, 정적 구성

     예) in route???? 172.16.1.0 255.255.255.0 172.16.2.1

                                                     경유(next hop ip 주소)

   stub에서 backbone으로 연결 시 정적 설정 불가능

   ->so, 기본경로 설정(default root) : 0.0.0.0 0.0.0.0 .....

   

  *** encapsulation .... hdlc(Cisco 기본)/ppp/... 등 설정하는 과정 있어야 하나

                          실습은 모두 Cisco 기본을 사용하므로 생략

 

  R1 : 정적인 방법으로 23, 3 대역 넣어주면 통신 가능 / 경유지는 R1 s1/0 또는 R2 s1/1 상관없다.

  *** 기존 ip 설정 제거 : no ip rounte ○○○.○○○.○○.○○ 255.255.255.0 serial ○○

  *** 주의 ***

   1.  명령이 안 먹을 경우 privilege 모드인지 확인...

   2.  net 화일 오타 확인

   3.  왼쪽 마우스로 범위 설정하고 오른쪽 마우스 클릭하면 붙여넣기 : 반복되는 명령어 수정 시

   4.  default로 재설정 : dynagen“reload/all”



       - R1, R3 : 각각 모두 10개(loopback)의 연결 정보 보유....

       - R2 : , 20개 정보 보유

       - R1R2를 통해 R3 정보를 알게 된다...



 

RIP

version1 –> version2 : subnet 개념 추가    * 현재 version 2 사용

router 15개까지만 연결 가능 : 소규모 조직에 사용 / L3 스위치에서 V-LAN간에 사용

-----> so, 대부분 사용 안함

단점 : subnet mask 인식 안함

-----> so, networt 172.16.10.0172.16.0.0 같은 네트워크로 인식


ip 설정 제거 동적 구성 방법


->결과


ping



전체 명령 작업 ---> 해당 router에 붙여넣기(수정-붙여넣기)

autostart = True

[localhost]

[[3660]]

image = C:\Program Files\Dynamips\images\c3660-jk9o3s-mz.124-15.T8.bin

#IOS 12.4(15)T8

 

ram = 128

nvram = 128

disk0 = 128

mmap = True

ghostios = True

confreg = 0x2102

#idlepc = 0x60600f6c

 

[[ROUTER R1]]

model = 3660

#f0/0 = LAN 10

s1/0 = R2 s1/1

console = 2001

 

[[ROUTER R2]]

model = 3660

#f0/1 = LAN 10

#f0/0 = LAN 20

s1/0 = R3 s1/1

console = 2002

 

[[ROUTER R3]]

model = 3660

#f0/1 = LAN 20

s1/0 = R1 s1/1

console = 2003

 

#Configuration R1

enable

configure terminal

hostname R1

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.16.1.1 255.255.255.0

exit

interface loopback 2

ip address 172.16.2.1 255.255.255.0

exit

interface loopback 3

ip address 172.16.3.1 255.255.255.0

exit

interface loopback 4

ip address 172.16.4.1 255.255.255.0

exit

interface loopback 5

ip address 172.16.5.1 255.255.255.0

exit

interface loopback 6

ip address 172.16.6.1 255.255.255.0

exit

interface loopback 7

ip address 172.16.7.1 255.255.255.0

exit

interface loopback 8

ip address 172.16.8.1 255.255.255.0

exit

interface loopback 9

ip address 172.16.9.1 255.255.255.0

exit

interface s1/0

ip address 192.168.12.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

router rip

version 2

no auto-summary

network 172.16.1.0

network 172.16.2.0

network 172.16.3.0

network 172.16.4.0

network 172.16.5.0

network 172.16.6.0

network 172.16.7.0

network 172.16.8.0

network 172.16.9.0

network 192.168.12.0

end

 

#Configuration R2

enable

configure terminal

hostname R2

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface s1/1

ip address 192.168.12.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

interface s1/0

ip address 192.168.23.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

router rip

version 2

no auto-summary

network 192.168.12.0

network 192.168.23.0

end

 

#Configuration R3

enable

configure terminal

hostname R3

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.17.1.1 255.255.255.0

exit

interface loopback 2

ip address 172.17.2.1 255.255.255.0

exit

interface loopback 3

ip address 172.17.3.1 255.255.255.0

exit

interface loopback 4

ip address 172.17.4.1 255.255.255.0

exit

interface loopback 5

ip address 172.17.5.1 255.255.255.0

exit

interface loopback 6

ip address 172.17.6.1 255.255.255.0

exit

interface loopback 7

ip address 172.17.7.1 255.255.255.0

exit

interface loopback 8

ip address 172.17.8.1 255.255.255.0

exit

interface loopback 9

ip address 172.17.9.1 255.255.255.0

exit

interface s1/1

ip address 192.168.23.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

router rip

version 2

no auto-summary

network 172.17.1.0

network 172.17.2.0

network 172.17.3.0

network 172.17.4.0

network 172.17.5.0

network 172.17.6.0

network 172.17.7.0

network 172.17.8.0

network 172.17.9.0

network 192.168.23.0

end

enable

configure terminal

hostname R3

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.17.1.1 255.255.255.0

exit

interface loopback 2

ip address 172.17.2.1 255.255.255.0

exit

interface loopback 3

ip address 172.17.3.1 255.255.255.0

exit

interface loopback 4

ip address 172.17.4.1 255.255.255.0

exit

interface loopback 5

ip address 172.17.5.1 255.255.255.0

exit

interface loopback 6

ip address 172.17.6.1 255.255.255.0

exit

interface loopback 7

ip address 172.17.7.1 255.255.255.0

exit

interface loopback 8

ip address 172.17.8.1 255.255.255.0

exit

interface loopback 9

ip address 172.17.9.1 255.255.255.0

exit

interface s1/1

ip address 192.168.23.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit


RIP 네트워크 설정

R1

no auto-summary

network 172.16.1.0

network 172.16.2.0

network 172.16.3.0

network 172.16.4.0

network 172.16.5.0

network 172.16.6.0

network 172.16.7.0

network 172.16.8.0

network 172.16.9.0

network 192.168.12.0

end

 

 

R2

 

no auto-summary

network 192.168.12.0

network 192.168.23.0

end

 

R3

 

no auto-summary

network 172.17.1.0

network 172.17.2.0

network 172.17.3.0

network 172.17.4.0

network 172.17.5.0

network 172.17.6.0

network 172.17.7.0

network 172.17.8.0

network 172.17.9.0

network 192.168.23.0

end


no auto-summary -> auto-summary : 한줄로 요약해 준다.



* clear : ip 주소 갱신.... 빠른 결과위해, 자동갱신 30초 설정되어 있음  * 현장에서 작업 시 위험, 과부화


**********  RIP 설정 기본 방법  *************

router rip

version 2

no auto-summary

network .... 해당 router가 알고 있는 정보




OSPF

- MTU : 패킷의 최대 허용크기 예) ethernet : 1500바이트

- BW(bandwidth) 1544Kbit (가중치 의미)..... * 실제 속도가 아닌 설정된 BWcost 계산

                                                  * DCE 장비 : 실제 속도 측정 *CSU(or DSU)

  * EGIRP : DLY 20000 usec도 감안(delay)

- reliablility(신뢰성)

- txload : 전송 rxload : 수신(들어오는 패킷)


                                                                show interface serial 1/0


enable

configure terminal

hostname R1

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 0

ip address 172.16.1.1 255.255.255.0

ip ospf network point-to-point

exit

interface s1/0

ip address 192.168.12.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

interface s1/1

ip address 192.168.31.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

router rip

R1(config-router)#version 2

R1(config-router)#no auto-summary

R1(config-router)#network 192.168.12.0

R1(config-router)#network 192.168.31.2

R1(config-router)#network 172.16.1.0

R1(config-router)#end



120 : RIP / 1 : hop count

양방향 hop count 동일

->so, traceroute(경로 추적) -> load balancing(부하분산) 확인됨.



R1에서 ping

양방향으로 load balancing하다가

임의로 R2 shutdown하면

R1은 통신 장애 후

다시 계산해서 한방향으로 이동

 

routing tablebackup 기능 수행... 장애 발생시 최상의 차선책 수행

 -> 대부분 현업에선 OSPF 사용


- 벨먼-포드 알고리즘 -> RIP / BGB

- 딕스트라 알고리즘 -> OSPF : TCP/IP에 최적화

   ** IS-IS : OSI 프로토콜에 최적화, 가볍고 관리 좋으나 OSPF가 먼저 범용화 됨

 

*********** OSPF 3가지 테이블 ***********

  - neighber table : neighber의 정보 저장

        ↓ 완성

  - database table : 최상의 경로 계산

        완성

  - routing table : 최상의 경로 저장        *** RIProuting table만 있음.

 

Area : routing table 크기 줄이는 영역(경계)

* autosummary : 단말단에서 routing table 줄이는 효과

 

 

Wireshark 설치 : packet 분석


***********  실습  **********************



 RIP 설정

- hop count 양방향 동일 -> load balancing으로 통신


OSPF 설정 

OSPF 설정 후 show running-configure ---> RIP와 OSPF가 동시에 구동


-> but, RIP로 정보를 주고받지만 잡히지 않음.... 

    AD120RIP110OSPF에 가려져 routing table에 나타나지 않음

    * 65, 128 cost(OSPF)


- ethernet 방식으로 고정되어 있음.

  * encapsulation ppp : 상대 routerCisco가 아닌 경우 ppp 설정

- no peer neighbor-route 꼭 필요 ->ppp로 인해 host id까지 불러오는 것 방지


*********  Tip!!!! 모든 인터페이스를 한번에 볼 수 있음.

show ip interface brief


*** OSPFneighber (table) 의미 있음.

위 라우터의 ip는?

  1. 물리적 인터페이스 ip가 두 개 이상이면 가장 높은 ip --> 192.168.23.0

  2. 논리적 인터페이스(loopback) 정해져 있는 경우 논리적 인터페이스가 우선

     ** 물리적 인터페이스로 정하는 경우 오류 발생 가능


  **** loopback interfase에 ip ospf network point-to-point 명령어 반드시 입력

                                      

  3. 사용자가 직접 지정 : router-id가 최우선



링크상태정보-> cost 계산



링크 상태 데이터베이스 테이블 : 최상의 경로 계산 후 routing table에 저장

 

( OSPF 방식: neighber를 통해 링크 상태 정보를 수집하여 이를 링크 상태 데이터베이스 테이블에 저장한 뒤 딕스트라 알고리즘에 기반해 목적지에 대한 최단 거리를 계산하여 이를 라우팅 테이블에 반영)

 

** EIGRP : 최상, 차선의 경로도 동시에 계산(토폴로지 테이블=OSPF의 데이터페이스 테이블)

              최상의 경로를 rounting table에 저장->so, 복구 능력 좋음

              ->단점, Cisco 독점기술

 

LSA(라우팅 정보) : OSPF 정보 패킷-> routing 크기 제어

 

OSPF 라우터의 종류(논리적 종류)

  1. IR(Internal Router) : 동일한 영역에 속한 라우터

  2. ABR(Area Border Router) : 경로 요약의 주체, IR backbone area와 직접 연결

  3. ASBR(Autonomous System Boundary Router) : 경로 요약과 재분배의 주체

                                                          예)RIP-OSPF간 연결

  router OSPF + process ID(1~65535:임의값)로 명명

  *** rounter EIGRP + autonomous system(AS) number(1~65535)

 

network 10.0.0.0 0.255.255.255 : wild card mask... ip의 첫 자리만 확인

            *** EIGRPsubnet mask 입력(255.255.255.0)

 

Area

- backbone area : 모든 정보 소유

- Area0 : rounting table 크기 고려하지 않음. filtering 하지 않음.

- Area 1.... : default 정보만 갖는다.



65, 128 : cost 

    cost    =        참조 대역폭                 / 회선 대역폭

        (Cisco 라운터에 기본 설정 100Mbps)    (기본설정 1544 kbps)

serial .................cost = 64


loopback 대역폭 : 800000kbit............. cost = 1





************ Cost 임의 변경 가능 ->i.e. 경로 직접 조정 가능  **************


참조대역폭 변경방법


회선대역폭 변경 방법


해당 serialcost 변경


R1, R2, R3의 모든 interface cost10으로 변경


-> 결과, 모든 cost20으로 변경된다.




*********  헬로패킷*************


DR/BDR(반장/부반장) 선출

  1. router 값

  2. router id 값 비교

    * "0" 인경우 완전 배제

DR 선출 안할 경우 전체 router 간 헬로패킷을 보내야 함(중복).  통신 구간이 헬로패킷으로 traffic


Wireshark - OSPF.cap 첫줄 info:Hello Packet 두 번 클릭

헬로 주기 : 10... 10초마다 서로 주기적으로 헬로패킷 주고 받음-> neighber table 유지

  *** loopback interface는 가상이므로 ip ospf network 설정 필요


 

router priority : 1 ---> DR(반장)/BDR(부반장



debugging


*Mar 1 05:16:24.490: OSPF: Interface Serial1/1 going Down

*Mar 1 05:16:24.490: OSPF: 1.1.1.1 address 192.168.31.2 on Serial1/1 is dead, state DOWN

*Mar 1 05:16:24.494: OSPF: 3.3.3.3 address 192.168.31.1 on Serial1/1 is dead, state DOWN

*Mar 1 05:16:24.498: %OSPF-5-ADJCHG: Process 10, Nbr 3.3.3.3 on Serial1/1 from FULL to DOWN, Neighbor Down: Interface down or detached

*Mar 1 05:16:24.502: OSPF: Interface Serial1/0 going Down

*Mar 1 05:16:24.506: OSPF: 1.1.1.1 address 192.168.12.1 on Serial1/0 is dead, state DOWN

*Mar 1 05:16:24.510: OSPF: 2.2.2.2 address 192.168.12.2 on Serial1/0 is dead, state DOWN

*Mar 1 05:16:24.514: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Serial1/0 from FULL to DOWN, Neighbor Down: Interface down or detached

*Mar 1 05:16:24.514: OSPF: Interface Loopback0 going Down

*Mar 1 05:16:24.514: OSPF: 1.1.1.1 address 172.16.1.1 on Loopback0 is dead, state DOWN

*Mar 1 05:16:24.530: OSPF: Interface Serial1/1 going Up

*Mar 1 05:16:24.530: OSPF: Interface Serial1/0 going Up

*Mar 1 05:16:24.534: OSPF: Interface Loopback0 going Up

*Mar 1 05:16:24.558: OSPF: 2 Way Communication to 2.2.2.2 on Serial1/0, state 2WAY

*Mar 1 05:16:24.562: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x2221 opt 0x52 flag 0x7 len 32

*Mar 1 05:16:24.570: OSPF: 2 Way Communication to 3.3.3.3 on Serial1/1, state 2WAY

*Mar 1 05:16:24.570: OSPF: Send DBD to 3.3.3.3 on Serial1/1 seq 0x24B5 opt 0x52 flag 0x7 len 32

*Mar 1 05:16:24.594: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x25CC opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART

*Mar 1 05:16:24.598: OSPF: NBR Negotiation Done. We are the SLAVE

*Mar 1 05:16:24.602: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x25CC opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.606: OSPF: Rcv DBD from 3.3.3.3 on Serial1/1 seq 0xB31 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART

*Mar 1 05:16:24.610: OSPF: NBR Negotiation Done. We are the SLAVE

*Mar 1 05:16:24.610: OSPF: Send DBD to 3.3.3.3 on Serial1/1 seq 0xB31 opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.610: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x25CD opt 0x52 flag 0x3 len 72 mtu 1500 state EXCHANGE

*Mar 1 05:16:24.610: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x25CD opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.614: OSPF: Rcv DBD from 3.3.3.3 on Serial1/1 seq 0xB32 opt 0x52 flag 0x3 len 72 mtu 1500 state EXCHANGE

*Mar 1 05:16:24.614: OSPF: Send DBD to 3.3.3.3 on Serial1/1 seq 0xB32 opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.614: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x25CE opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE

*Mar 1 05:16:24.614: OSPF: Exchange Done with 2.2.2.2 on Serial1/0

*Mar 1 05:16:24.614: OSPF: Send LS REQ to 2.2.2.2 length 24 LSA count 2

*Mar 1 05:16:24.614: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x25CE opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.618: OSPF: Rcv DBD from 3.3.3.3 on Serial1/1 seq 0xB33 opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE

*Mar 1 05:16:24.618: OSPF: Exchange Done with 3.3.3.3 on Serial1/1

*Mar 1 05:16:24.618: OSPF: Send LS REQ to 3.3.3.3 length 24 LSA count 2

*Mar 1 05:16:24.618: OSPF: Send DBD to 3.3.3.3 on Serial1/1 seq 0xB33 opt 0x52 flag 0x0 len 32

*Mar 1 05:16:24.618: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 196 LSA count 2

*Mar 1 05:16:24.622: OSPF: Synchronized with 3.3.3.3 on Serial1/1, state FULL

*Mar 1 05:16:24.626: %OSPF-5-ADJCHG: Process 10, Nbr 3.3.3.3 on Serial1/1 from LOADING to FULL, Loading Done ....... 로딩이 끝나고 최상의 경로 계산하기 직전

*Mar 1 05:16:24.630: OSPF: Synchronized with 2.2.2.2 on Serial1/0, state FULL

*Mar 1 05:16:24.634: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Serial1/0 from LOADING to FULL, Loading Done

*Mar 1 05:16:24.650: OSPF: Rcv LS UPD from 3.3.3.3 on Serial1/1 length 196 LSA count 2

*Mar 1 05:16:25.006: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x80000001, process 10

*Mar 1 05:16:29.366: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 112 LSA count 1

*Mar 1 05:16:29.526: OSPF: Rcv LS UPD from 3.3.3.3 on Serial1/1 length 112 LSA count 1

*Mar 1 05:16:29.678: OSPF: Rcv LS UPD from 3.3.3.3 on Serial1/1 length 112 LSA count 1

*Mar 1 05:16:30.010: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 112 LSA count 1

*Mar 1 05:16:34.378: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x8000000F, process 10

R1#




******** OSPF 네트워크 유형  ************

1. 논브로드캐스트 네트워크

    - 기본 인터페이스는 프레임 릴레이 방식 등

    - 네이버를 수동으로 지정하고 DR 선출 필요

2. 브로드캐스트 네트워크

    - 기본 인터페이스는 이더넷 방식 등

    - 네이버를 자동으로 지정하고 DR 선출 필요

3. 포인트 투 멀티포인트 네트워크

    - 네이버를 자동으로 지정하고 DR 선출 불필요

4. 포인트 투 포인트 네트워크

    - 기본 인터페이스는 HDLC 방식 또는 PPP 방식 등

    - 네이버를 자동으로 지정하고 DR 선출 불필요



no ip ospf point-to-point 먼저 실행

broadcast로 변경(관리의 목적으로 수동 변경)


-> 결과, DRBDR 지정됨

DR을 변경하려면 우선순위 변경하거나 나머지의 route id“0”으로 변경



******* 5개 router 연결 ********


autostart = True

[localhost]

[[3660]]

image = C:\Program Files\Dynamips\images\c3660-jk9o3s-mz.124-15.T8.bin

#IOS 12.4(15)T8

 

ram = 128

nvram = 128

disk0 = 128

mmap = True

ghostios = True

confreg = 0x2102

#idlepc = 0x60600f6c

 

[[ROUTER R1]]

model = 3660

s1/0 = R2 s1/1

console = 2001

 

[[ROUTER R2]]

model = 3660

s1/0 = R3 s1/1

console = 2002

 

[[ROUTER R3]]

model = 3660

s1/0 = R4 s1/1

console = 2003

 

[[ROUTER R4]]

model = 3660

s1/0 = R5 s1/1

console = 2004

 

[[ROUTER R5]]

model = 3660

s1/0 = R1 s1/1

console = 2005

 

 

#Configuration R1

 

enable

configure terminal

hostname R1

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.16.1.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 2

ip address 172.16.2.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 3

ip address 172.16.3.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 4

ip address 172.16.4.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 5

ip address 172.16.5.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 6

ip address 172.16.6.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 7

ip address 172.16.7.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 8

ip address 172.16.8.1 255.255.255.0

ip ospf network point-to-point

exit

 

interface s1/0

ip address 192.168.12.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

 

no shutdown

exit

 

router ospf 10

router-id 1.1.1.1

network 172.16.1.0 0.0.0.255 area 10

network 172.16.2.0 0.0.0.255 area 10

network 172.16.3.0 0.0.0.255 area 10

network 172.16.4.0 0.0.0.255 area 10

network 172.16.5.0 0.0.0.255 area 10

network 172.16.6.0 0.0.0.255 area 10

network 172.16.7.0 0.0.0.255 area 10

network 172.16.8.0 0.0.0.255 area 10

network 192.168.12.0 0.0.0.255 area 10

end

 

 

#Configuration R2

 

enable

configure terminal

hostname R2

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface s1/1

ip address 192.168.12.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

interface s1/0

ip address 192.168.23.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

 

router ospf 20

router-id 2.2.2.2

network 172.16.2.0 0.0.0.255 area 10

network 192.168.12.0 0.0.0.255 area 10

network 192.168.23.0 0.0.0.255 area 0 .... so ABR rounter가 됨

end

 

#Configuration R3

 

enable

configure terminal

hostname R3

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface s1/1

ip address 192.168.23.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

interface s1/0

ip address 192.168.34.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

 

router ospf 30

router-id 3.3.3.3

network 172.16.3.0 0.0.0.255 area 20

network 192.168.23.0 0.0.0.255 area 0

network 192.168.34.0 0.0.0.255 area 20

end

 

#Configuration R4

 

enable

configure terminal

hostname R4

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.16.11.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 2

ip address 172.16.12.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 3

ip address 172.16.13.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 4

ip address 172.16.14.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 5

ip address 172.16.15.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 6

ip address 172.16.16.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 7

ip address 172.16.17.1 255.255.255.0

ip ospf network point-to-point

exit

interface loopback 8

ip address 172.16.18.1 255.255.255.0

ip ospf network point-to-point

exit

interface s1/1

ip address 192.168.34.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

interface s1/0

ip address 192.168.45.1 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

 

router ospf 40

router-id 4.4.4.4

network 172.16.11.0 0.0.0.255 area 20

network 172.16.12.0 0.0.0.255 area 20

network 172.16.13.0 0.0.0.255 area 20

network 172.16.14.0 0.0.0.255 area 20

network 172.16.15.0 0.0.0.255 area 20

network 172.16.16.0 0.0.0.255 area 20

network 172.16.17.0 0.0.0.255 area 20

network 172.16.18.0 0.0.0.255 area 20

network 192.168.34.0 0.0.0.255 area 20

redistribute rip metric 10 subnets

exit

 

router rip

version 2

no auto-summary

network 192.168.45.0

redistribute ospf 40 metric 10

end


#Configuration R5

 

enable

configure terminal

hostname R5

no ip domain-lookup

enable password 1234

username admin password 1234

line vty 0 15

login local

transport input telnet

exit

line console 0

exec-timeout 0 0

exit

interface loopback 1

ip address 172.16.111.1 255.255.255.0

exit

interface loopback 2

ip address 172.16.121.1 255.255.255.0

exit

interface loopback 3

ip address 172.16.131.1 255.255.255.0

exit

interface loopback 4

ip address 172.16.141.1 255.255.255.0

exit

interface loopback 5

ip address 172.16.151.1 255.255.255.0

exit

interface loopback 6

ip address 172.16.161.1 255.255.255.0

exit

interface loopback 7

ip address 172.16.171.1 255.255.255.0

exit

interface loopback 8

ip address 172.16.181.1 255.255.255.0

exit

interface s1/1

ip address 192.168.45.2 255.255.255.0

encapsulation ppp

no peer neighbor-route

no shutdown

exit

 

router rip

version 2

no auto-summary

network 172.16.0.0

network 192.168.45.0

end 





Area 10stub로 변경.... routing table 단순화


* 단말영역 방식


R1에서 “area 10 stub” 명령

R2에서 “area 10 stub” 명령


R2로 가는 경로가 동적 구성으로 변경

ping

 

*****  IA 영역도 모두 동적으로 구성

 

R2에서

no area 10 stub

area 10 stub no-summary


R1 테이블 IA 영역 1줄로 변경됨.


* 교재 292 ~ 314페이지.... nssa 완전 단말영역방식 실습



************** 주요 명령어 ***************

hostname R1

enable

Configure Terminal

interface serial 1/0

interface loopback 0

ip address 000.000.00.00

no ip address

show ip route

show ip route rip

show running-configure

shutdown

no shutdown

ping ○○○.○○○.○○.○○ source ○○○.○○○.○○.○○ (경유 지정)

728x90