| 구분 | 명령어 | 설명 |
| PC 설정 | PC0: 203.230.7.2/24 PC1: 203.230.9.2/24 PC2: 203.230.11.2/24 | |
라우터 R1 - IP 설정 | Router> enable Router# conf t Router(config)# hostname R1
R1(config)# interface gi0/0 R1(config-if)# ip address 203.230.7.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# exit
R1(config)# interface se0/0/0 (DCE) R1(config-if)# ip address 203.230.8.1 255.255.255.0 R1(config-if)# clock rate 64000 R1(config-if)# no shutdown R1(config-if)# exit
| 호스트명을 R1로 바꾼다.
Giga 인터페이스 주소 설정
Serial 인터페이스 주소 설정 (DCE인 경우 클럭 설정)
|
라우터 R2 - IP 설정 | Router> enable Router# conf t Router(config)# hostname R2
R2(config)# interface gi0/0 R2(config-if)# ip address 203.230.9.1 255.255.255.0 R2(config-if)# no shutdown R2(config-if)# exit
R2(config)# interface se0/0/0 (DCE) R2(config-if)# ip address 203.230.8.2 255.255.255.0 R2(config-if)# clock rate 64000 R2(config-if)# no shutdown R2(config-if)# exit
R2(config)# interface se0/0/1 (DTE) R2(config-if)# ip address 203.230.10.1 255.255.255.0 R2(config-if)# no shutdown R2(config-if)# exit
| DCE와 DTE개념 |
라우터 R3 - IP 설정 | Router> enable Router# conf t Router(config)# hostname R3
R3(config)# interface gi0/0 R3(config-if)# ip address 203.230.11.1 255.255.255.0 R3(config-if)# no shutdown R3(config-if)# exit
R3(config)# interface se0/0/0 (DTE) R3(config-if)# ip address 203.230.10.2 255.255.255.0 R3(config-if)# no shutdown R3(config-if)# exit
| |
| (이웃 라우터) IP주소 를 이용한 정적 경로 설정 | ( ip route 목적ip subnet mask 이웃라우터ip ) R1(config)# ip route 203.230.9.0 255.255.255.0 203.230.8.2 R1(config)# ip route 203.230.10.0 255.255.255.0 203.230.8.2 R1(config)# ip route 203.230.11.0 255.255.255.0 203.230.8.2 R1(config)# exit R1# wr
R2(config)# ip route 203.230.7.0 255.255.255.0 203.230.8.1 R2(config)# ip route 203.230.11.0 255.255.255.0 203.230.10.2 R2(config)# exit R2# wr
R3(config)# ip route 203.230.7.0 255.255.255.0 203.230.10.1 R3(config)# ip route 203.230.8.0 255.255.255.0 203.230.10.1 R3(config)# ip route 203.230.9.0 255.255.255.0 203.230.10.1 R3(config)# exit R3# wr
| R1 라우터의 경우 세 구간(R2의 LAN, R2-R3 연결구간, R3의 LAN)에 정적 경로를 설정해야 함
R2의 경우 두 구간(R1의 LAN, R3의 LAN)에 정적 경로를 설정해야 함
R3 라우터의 경우 세 구간(R1의 LAN, R1-R2 연결구간, R2의 LAN)에 정적 경로를 설정해야 함 |
| 라우팅 테이블 확인 | R1#show ip route R2#show ip route R3#show ip route
Codes: L-local, C-connected, S-static, R-RIP, M-moble, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area ㆍㆍㆍ 중략 ㆍㆍㆍ
S 203.230.9.0/24[1/0] via 203.230.8.2 S 203.230.10.0/24[1/0] via 203.230.8.2 S 203.230.11.0/24[1/0] via 203.230.8.2 | [1/0] : 관리 거리(AD) / 메트릭값 [AD/Metric]
AD는 아래 표 참고 1: static |
| ping 테스트 | R1(config)# do ping 203.230.9.1 R1(config)# do ping 203.230.10.1 R1(config)# do ping 203.230.11.1
PC>ping 203.230.9.2 PC>ping 203.230.11.2 | (pc0 ⇒ Desktop ⇒ Command Prompt) |
| 출력 인터페이스를 이용한 정적 경로 설정 | R1(config)# no ip route 203.230.9.0 255.255.255.0 203.230.8.2 R1(config)# no ip route 203.230.10.0 255.255.255.0 203.230.8.2 R1(config)# no ip route 203.230.11.0 255.255.255.0 203.230.8.2
R1(config)# ip route 203.230.9.0 255.255.255.0 se0/0/0 R1(config)# ip route 203.230.10.0 255.255.255.0 se0/0/0 R1(config)# ip route 203.230.11.0 255.255.255.0 se0/0/0 R1(config)# exit
R1# wr R1# show ip route
R2(config)# no ip route 203.230.7.0 255.255.255.0 203.230.8.1 R2(config)# no ip route 203.230.11.0 255.255.255.0 203.230.10.2
R2(config)# ip route 203.230.7.0 255.255.255.0 se0/0/0 R2(config)# ip route 203.230.11.0 255.255.255.0 se0/0/1 R2(config)# exit
R2# wr R2# show ip route
R3(config)# no ip route 203.230.7.0 255.255.255.0 203.230.10.1 R3(config)# no ip route 203.230.8.0 255.255.255.0 203.230.10.1 R3(config)# no ip route 203.230.9.0 255.255.255.0 203.230.10.1
R3(config)# ip route 203.230.7.0 255.255.255.0 se0/0/0 R3(config)# ip route 203.230.8.0 255.255.255.0 se0/0/0 R3(config)# ip route 203.230.9.0 255.255.255.0 se0/0/0 R3(config)# exit
R3# wr R3# show ip route | no ip route 는 기존 정적 경로 삭제
이웃 라우터 ip를 자신의 인터페이스로 변경한다.
203.230.8.2 -> se0/0/0
IP 주소를 이용한 정적결로 설정은 ip주소를 검색하기 위해 룩업 프로세스를 한번 더 거친다.
출력인터페이스 방법이 효과적이다. |
| 디폴드 정적 경로 설정 | R1(Config)# ip route 0.0.0.0 0.0.0.0 203.230.8.2 R1(Config)# ip route 0.0.0.0 0.0.0.0 se0/0/0 (위와 같은 결과)
R3(Config)# ip route 0.0.0.0 0.0.0.0 203.230.10.1 R3(Config)# ip route 0.0.0.0 0.0.0.0 se0/0/0 | 패킷의 출입 경로가 라우터 하나 밖에 없는 스터브 네트워크에 적용(R1과 R3 라우터) |
| 디버깅 (debugging) 설정 | R1> en R1# debug ip routing | (R1에 디버그 기능 활성화) |
| 디버깅 - 시리얼 인터페이시 비활성화 | R2> en R2# conf t R2(config)# int s0/0/0 R2(config-if)# shutdown (R2에 비활성화 시켜보자)
R1# (R1의 CLI로 이동한다.)
(s0/0/0이 비활성화 되어 라우팅테이블로부터 203.230.8.0/24 네트워크 경로가 삭제 되었다.) %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down ㆍㆍㆍ 중략 ㆍㆍㆍ RT: delete network route to 203.230.8.1 RT: NET-RED 203.230.8.1/32
R1# show ip route
(네트워크 경로가 203.230.7.0 밖에 남지 않았다) C 203.230.7.0/24 is directly connected, GigabitEthernet0/0 L 203.230.7.1/32 is directly connected, GigabitEthernet0/0 | 라우터 R2의 s0/2/1 인터페이스를 비 활성화 시킨 순간
라우터 R1의 콘솔에 메시지가 표시된다. |
| 디버깅 - 시리얼 인터페이시 활성화 | R2> en R2# conf t R2(config)# int s0/0/0 R2(config-if)# no shutdown (R2에 활성화 시켜보자)
R1# (R1의 CLI로 이동한다.)
(s0/0/0이 활성화 되어 라우팅테이블에 203.230.8.0/24 네트워크 경로가 추가 되었다.) %LINK-5-CHANGED: Interface Serial0/0/0, changed state to up ㆍㆍㆍ 중략 ㆍㆍㆍ RT: add 203.230.8.0/24 via 0.0.0.0, connected metric [0/0] RT: NET-RED 203.230.8.0/32
R1# show ip route
(네트워크 경로가 203.230.8.0 이 추가 되었다.) C 203.230.7.0/24 is directly connected, GigabitEthernet0/0 L 203.230.7.1/32 is directly connected, GigabitEthernet0/0 C 203.230.8.0/24 is directly connected, Serial0/0/0 L 203.230.8.1/32 is directly connected, Serial0/0/0 | |
| 디버깅 해제 | R1# no debug ip routing | undebug all; u al 디버깅은 시스템에 부하를 줌 |
| IP 주소와 MAC 주소 쌍에 대한 정보 | R1> en R1# show arp
Protocol Address Age Hardware Addr Type Interface Internet 203.230.7.1 - 0030.A3E3.8201 ARPA Gi0/0 Internet 203.230.7.2 30 0000.BA87.9D53 ARPA Gi0/0 | ARP (Address Resolution Protocol) 프록시 ARP
논리주소(IP)를 물리주소(MAC)로 변환시키는 프로토콜 |
시스코 탐색 프로토콜 CDP (Cisco Discovery Protocol) | R1# conf t R1(config)# cdp run
R2# conf t R2(config)# cdp run
R3# conf t R3(config)# cdp run
R1# show cdp neighbors R2 Ser 0/0/0 138 R c2900 Ser 0/0/1
R1# show cdp entry * R1# show cdp interface
R1# conf t R1(config)# no cdp run R1(config)# do show cdp neighbors % CDP is not enabled | CDP: 네트워크 유지관리 프로토콜 - 이웃 장비에 대한 정보 수집 |