새소식

인기 검색어

Network

Cisco 라우터3대 IP주소 할당, ping test, Static Route 설정, RIP, v2설정

  • -

 

*Router 4ea,  hosts - Ethernet network 4ea , Router-Router network 2ea

  1. cable connect 
  2. PC, Router interface IP address  

*설정파일 : 

부팅 할 때 저장된 설정파일  -> RAM 메모리에 올림.   startup-config

메모리에 올라와있는 설정파일  running-config  (RAM) 전원이 off없음 , 저장 필수

 

 

*라우터에 IP주소 할당하기

Router> en

Router# conf t

Router(config)# hostname [device_name]

GW(config)# interface fa [0/0] (연결정보확인)

GW(config-if)# ip address 120.1.2.x 255.255.255.y
       (해당인터페이스 IP주소,서브넷마스크 설정)

GW(config-if)# no shutdown (인터페이스 활성화)

GW(config-if)# end

GW# show run (입력한 명령어 확인-check)

GW# wr (저장)

GW# ping 120.1.2.z (pc, router interface까지 핑)

GW# show ip int brief (인터페이스 간략히 확인)

GW# show ip route (라우팅 테이블 확인)

 

 

@SungSu_R ip설정

en  (권한 상승)

conf t  (구성모드에 들어가기)

hostname SungSu_R (장비이름설정)

int fa0/0  ( 인터페이스 fa0/0에 들어가기)

 ip address 120.1.2.126 255.255.255.128   (IP,SM설정)

 no shutdown  (인터페이스 활성화 하기)

exit  (인터페이스 빠져나가기)

int fa0/1   (fa0/1 인터페이스 안에 들어가기

 ip address 120.1.2.241 255.255.255.248 (IP,SM설정)

 no shutdown  (인터페이스 활성화 하기)

end  (구성모드 빠져나가기)

copy run start (저장하기)

show ip int brief  (인터페이스 간략히 확인하)

show run (입력한 명령어 확인)



@ KonDae_R

en

conf t

hostname KonDae_R

int fa0/0

  ip address 120.1.2.190 255.255.255.192

  no shutdown

exit

int fa1/0

  ip address 120.1.2.246 255.255.255.248

 no shutdown

int fa1/1

  ip address 120.1.2.249 255.255.255.248

 no shutdown

end

copy run start (저장하기)

show ip int brief  (인터페이스 간략히 확인하)

show run (입력한 명령어 확인)

 

@Guui_R

en

conf t

hostname Guui_R

int fa1/0

  ip address 120.1.2.254 255.255.255.248

  no shutdown

exit

int fa0/0

  ip address 120.1.2.222 255.255.255.224

 no shutdown

 exit

int fa0/1

  ip address 120.1.2.238 255.255.255.240

 no shutdown 

end  

copy run start (저장하기)

show ip int brief  (인터페이스 간략히 확인하)

show run (입력한 명령어 확인)



사용하는 인터페이스 상태가 up up 이어야함.

같은 네트워크 내에서 ping 이 되어야 함

 

PC와 게이트웨이,  라우터와 라우터사이 네트워크

 

Network A pc가 Network B pc에게 ping 안됨

 

@SungSu_R 에서 ping test

SungSu_R#ping 120.1.2.2

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.2, timeout is 2 seconds:

  !!!!!

  Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms

SungSu_R#ping 120.1.2.3

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.3, timeout is 2 seconds:

  !!!!!

  Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/6 ms

SungSu_R#ping 120.1.2.246

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.246, timeout is 2 seconds:

  !!!!!

  Success rate is 100 percent (5/5), round-trip min/avg/max = 0/4/21 ms

SungSu_R#

 

@Kondae_R에서 ping test

KonDae_R#ping 120.1.2.241

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.241, timeout is 2 seconds:

  !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/2 ms

  KonDae_R#ping 120.1.2.130

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.130, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

KonDae_R#ping 120.1.2.131

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.131, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms

KonDae_R#ping 120.1.2.254

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.254, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

KonDae_R#

 

@Guui_R에서 ping test

Guui_R#ping 120.1.2.249

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.249, timeout is 2 seconds:

  !!!!!

  Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

Guui_R#ping 120.1.2.194

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.194, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

Guui_R#ping 120.1.2.195

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.195, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms

Guui_R#ping 120.1.2.226

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.226, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms

Guui_R#ping 120.1.2.227

  Type escape sequence to abort.

  Sending 5, 100-byte ICMP Echos to 120.1.2.227, timeout is 2 seconds:

  !!!!

  Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

Guui_R#

 

 


 

120.1.2.0/25

120.1.2.128/26

120.1.2.192/27

120.1.2.224/28

120.1.2.240/29

120.1.2.248/29

 

connected netweork 

SungSu_R

  C 120.1.2.0/25

  C 120.1.2.240/29

KonDae_R

  C 120.1.2.128/26

  C 120.1.2.240/29

  C 120.1.2.248/29

Guui_R

  C 120.1.2.192/27

  C 120.1.2.224/28

  C 120.1.2.248/29

 

설정해야할 네트워크

SungSu_R

  C 120.1.2.128/26

  C 120.1.2.192/27

  C 120.1.2.224/28

  C 120.1.2.248/29

KonDae_R

  C 120.1.2.0/25

  C 120.1.2.192/27

  C 120.1.2.224/28

Guui_R

  C 120.1.2.2.0/25

  C 120.1.2.128/26

  C 120.1.2.240/29

 

*Routing설정

  • static route : 직접 모든 라우터에 라우터가 모르는 네트워크 설정 
  • dynamic route : 라우터가 프로세스에 의해 서로 주고받아 네트워크 정보를 동기화함.

 

* SungSu_R static route 설정

show ip route connected

      C 

      C 

en

conf t

ip route  ---network address---  _subentmask _  --gateway_ip--

 

ip route 120.1.2.128 255.255.255.192  120.1.2.246

ip route 120.1.2.192 255.255.255.224  120.1.2.246

ip route 120.1.2.224 255.255.255.240  120.1.2.246

ip route 120.1.2.248 255.255.255.248  120.1.2.246

end

copy run start (save)

show run (입력한 명령어를 확인)

show ip route  (라우팅 테이블에 6개 네트워크, gw 확인)

 

conf t

no ip route 120.1.2.128 255.255.255.192  120.1.2.246 엔터

라고 하면 해당 라인 삭제됨.

잘못입력한 static route는 삭제해야함.

 

@Guui_R : static route

en

show ip route connected

      C 

      C 

      C 

conf t

ip route 120.1.2.0 255.255.255.128 120.1.2.249

ip route 120.1.2.128 255.255.255.192 120.1.2.249

ip route 120.1.2.240 255.255.255.248 120.1.2.249

end

copy run start

show run

show ip route

 

@KonDae_R static route

en

show ip route connected

conf t

ip route 120.1.2.0 255.255.255.128 120.1.2.241

ip route 120.1.2.192 255.255.255.224 120.1.2.254

ip route 120.1.2.224 255.255.255.240 120.1.2.254

end

copy run start

show run

show ip route

 

각 라우터의 라우팅 테이블에 모든 경로가 있는 지, 게이트웨이주소가 맞는지 확인

PC들 끼리 통신이 가야하는 ping test해보기

 

=> * routing table: S networkAddr [1/0] via gw_ip

  -> static route: ad value =1, metric(목적지까지의 경로 비용 Path Cost)= 0

 

ex) Route CLI

> show ip route

-> S 120.1.2.128 [1/0] via 120.1.2.246

-> S를 보고 관리자가 직접 설정 했다는 걸 알수있음.

-> [1/0]을 보고 static의 AD Value가 1임을 알 수 있음. 그리고 metric은 0임을 확인 가능(실습에서는 직접 경로를 지정했으므로 경로 비용이 발생하지 않아 0임.)

AD값과 Metric값은 라우팅 프로토콜마다 다름

-> 즉, 120.1.2.246을 통해서(via) 120.1.2.128로 갈수있다는 의미

 

*라우팅 프로토콜 고유한 값이 있음(식별하기위한 목적)

 

*AD value: Administrative Distance value

 

* Google -> ad value 검색

 Static Route의 ad value값 1(default) ->낮을수록 우선순위가 큼

 

*Metric: 네트워크 비용(cost)

 

 

* ping 120.1.2.227(DST(목적지)) <- Sungsu_R show ip route 해서 227에 해당되는 Static확인 (ex) S 120.x.x.x [y/y] via ~

  -> Kondae_R의 Mac주소 알아야함->과정 반복

 


 

 

  Default Gateway 
  Subnet Mask
Sungsu_R

 fa0/0  120.1.2.126
             255.255.255.128 <- PC0,1
fa0/1  120.1.2.241   255.255.255.248
Kondae_R


 fa0/0      120.1.2.190                   255.255.255.192 <- PC2,3
fa0/1    120.1.2.249     255.255.255.248
  fa1/0    120.1.2.246   255.255.255.248
Guui_R


fa0/0   120.1.2.222                 255.255.255.224 <- PC4,5
 fa0/1  120.1.2.238               255.255.255.240 <- PC6,7
fa1/0 120.1.2.254   255.255.255.248

 

(Default Gateway -> IP Addr(할당가능대역의 첫, 마지막 IP입력))

 

1. 케이블 연결(같은 것 끼린 ----(크로스 연결선)으로 연결, 처음 연결부 fa숫자 맞춰서 연결해야함)

2. 모든 Router CLI에 들어가서

    en

    conf t

    int fa~

    ip address 120.1.2.x 255.255.255.y

    no shutdown

    end

    show run

    wr(저장)

3. R1 fa 0/0, fa 0/1

    R2 fa 1/0, fa 0/0, fa 1/1

    R3 fa 1/0, fa 0/0, fa 0/1 <- 맞춰서 전부 다 하기

4. 모듈 추가 (라우터 클릭->Physical->전원끄고->NM-2FE-2W모듈 드래그해서 추가->전원다시켜기)

모듈추가예시

5. PC들 전부 IP추가

6. ping 120.1.2.z 입력 및 확인

 

<PC0 IP Config>

IP Addr: 120.1.2.2 <- 임의로 2번째 주소 줌(NW Addr가 120.1.2.0 이므로 2번째인 ~.2)

Subnet Mask : 255.255.255.128 -> NW Addr의 prefix가 /25 이므로 7bit, 2^7=128

Default Gateway : 120.1.2.126 -> NW Addr의 할당가능 대역의 첫or마지막 IP입력

(잘못입력시 앞에 no 붙이고 엔터)

 

en

show ip route c

             c

             c

             c

conf t

 

*오늘의 정리

Static Route(무엇인지, 왜 설정하는지, 어떻게 설정하는지, Dynamic 라우팅과 비교)

 


lab 1 - VLSM pkt파일에 rip 작동하기

 

<기존 static route 삭제 후 진행>

*Sungsu_R

en

conf t

no ip route 120.1.2.128 255.255.255.192 120.1.2.246 

no ip route 120.1.2.192 255.255.255.224 120.1.2.246 

no ip route 120.1.2.224 255.255.255.240 120.1.2.246 

no ip route 120.1.2.248 255.255.255.248 120.1.2.246

end

 

*Kondae_R

en

conf t

no ip route 120.1.2.0 255.255.255.128 120.1.2.241 

no ip route 120.1.2.192 255.255.255.224 120.1.2.254 

no ip route 120.1.2.224 255.255.255.240 120.1.2.254

end

 

*Guui_R

en

conf t

no ip route 120.1.2.0 255.255.255.128 120.1.2.249 

no ip route 120.1.2.128 255.255.255.192 120.1.2.249 

no ip route 120.1.2.240 255.255.255.248 120.1.2.249 

end

 

*SungSu_R

en

show ip route connected

conf t

router rip

  network 120.0.0.0

end

show run

show  ip route

show ip protocols

copy run start

 

*Kondae_R

en

show ip route connected

conf t

router rip

  network 120.0.0.0

end

show run

show ip route

show ip protocols

copy run start

 

*Guui_R

en

show ip route 

show ip protocols

copy run start



*SungSU_R, Kondae_R, Guui_R

en

conf t

router rip

   version 2

end

 


 

*trace route(경로 추적)

 PC0 win -> cmd창 -> tracert 120.1.2.227 <- 얘까지 가는 경로 추적해줌

 

*TTL 값 확인해보기

TTL값 0(1-1=0)이면 라우터가 버림

 

* Default Route 0.0.0.0 0.0.0.0 = 0.0.0.0/0 (라우팅 테이블에 이렇게 나오는 것을 의미함) 내가 알고있는 것 외에 몽땅 다가 DR.

그리고 인터넷 연결망은 반드시 디폴트 라우트가 추가되어야함.

-> Default Route 설정법: Router > en > conf t > ip route 0.0.0.0 0.0.0.0 [gateway(ex 120.1.2.246)] > end > show ip route

ex) 성수라우터에 디폴트라우트 설정해주면 예를들어 ping 1.1.1.1 이라는 해당안되는 ip를 써도 DR을 설정해줬으므로 시뮬레이터 돌려보면 안버려지고 에러메세지 안뜸(버려지는 것에는 편지아이콘에 X표시 뜸)

 

*나온순서: Static Route -> RIP, IS-IS -> OSPF(표준) -> IGRP, EIGRP ->BGP

스태틱라우트가 불편하여 RIP 생김(Routing Information Protocol)

OSPF는 네트워크 변화감지 가능, 그래서 그걸 다른 네트워크한테 말해줄 수 있음

IGRP, EIGRP-> Cisco전용이라 많이 안씀, 딜레이(지연)도 봄 ->> /IGP(internal): 회사안에서 쓸수 있는것

BGP     /EGP(external): 회사-회사 연결하는 것(IGP-IGP)

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.