정적 경로
-
복잡한 네트워크 경로 지정 쉽게 풀어보기 (정적 경로)2009.05.13
-
라우팅 테이블 설정하기(1) - 정적 경로 설정2009.05.12
복잡한 네트워크 경로 지정 쉽게 풀어보기 (정적 경로)
정적 경로 종합문제 (1)
다음 topology를 보고 각 PC가 서로 통신이 되도록 정적 라우팅 설정을 하세요. (시리얼 클럭 동기 무시)
그림. 네트워크 토폴로지
라우터 R1 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface fastethernet 0/0
R1(config-if)# ip address 192.168.0.1 255.255.255.0
R1(config-if)# no shutdown
R1(config)# interface fastethernet 0/1
R1(config-if)# ip address 192.168.100.9 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface serial 0/0
R1(config-if)# ip address 192.168.100.1 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.10
R1(config)# ip route 192.168.100.4 255.255.255.252 192.168.100.2
R1(config)# ip route 192.168.20.0 255.255.255.0 192.168.100.2
R1(config)# end
R1#
라우터 R2 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface fastethernet 0/0
R2(config-if)# ip address 192.168.100.5 255.255.255.252
R2(config-if)# no shutdown
R2(config)# interface serial 0/0
R2(config-if)# ip address 192.168.100.2 255.255.255.252
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# ip route 192.168.0.0 255.255.255.0 192.168.100.1
R2(config)# ip route 192.168.100.8 255.255.255.252 192.168.100.1
R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.1
R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.6
R2(config)# end
R2#
라우터 R3 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R3
R3(config)# interface fastethernet 0/0
R3(config-if)# ip address 192.168.100.10 255.255.255.252
R3(config-if)# no shutdown
R3(config)# interface fastethernet 0/1
R3(config-if)# ip address 192.168.10.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit
R3(config)# ip route 192.168.0.0 255.255.255.0 192.168.100.9
R3(config)# ip route 192.168.100.0 255.255.255.252 192.168.100.9
R3(config)# ip route 192.168.100.4 255.255.255.252 192.168.100.9
R3(config)# ip route 192.168.20.0 255.255.255.0 192.168.100.9
R3(config)# end
R3#
라우터 R4 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R4
R4(config)# interface fastethernet 0/0
R4(config-if)# ip address 192.168.100.6 255.255.255.252
R4(config-if)# no shutdown
R4(config)# interface fastethernet 0/1
R4(config-if)# ip address 192.168.20.1 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# exit
R4(config)# ip route 192.168.0.0 255.255.255.0 192.168.100.5
R4(config)# ip route 192.168.100.0 255.255.255.252 192.168.100.5
R4(config)# ip route 192.168.100.8 255.255.255.252 192.168.100.5
R4(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.5
R4(config)# end
R4#
디폴트 게이트웨이를 사용하여 라우팅 테이블 단순화하기
라우터 R1 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface fastethernet 0/0
R1(config-if)# ip address 192.168.0.1 255.255.255.0
R1(config-if)# no shutdown
R1(config)# interface fastethernet 0/1
R1(config-if)# ip address 192.168.100.9 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface serial 0/0
R1(config-if)# ip address 192.168.100.1 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.10
R1(config)# ip route 0.0.0.0 0.0.0.0 192.168.100.2
R1(config)# end
R1#
라우터 R2 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface fastethernet 0/0
R2(config-if)# ip address 192.168.100.5 255.255.255.252
R2(config-if)# no shutdown
R2(config)# interface serial 0/0
R2(config-if)# ip address 192.168.100.2 255.255.255.252
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# ip route 0.0.0.0 0.0.0.0 192.168.100.1
R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.6
R2(config)# end
R2#
라우터 R3 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R3
R3(config)# interface fastethernet 0/0
R3(config-if)# ip address 192.168.100.10 255.255.255.252
R3(config-if)# no shutdown
R3(config)# interface fastethernet 0/1
R3(config-if)# ip address 192.168.10.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit
R3(config)# ip route 0.0.0.0 0.0.0.0 192.168.100.9
R3(config)# end
R3#
라우터 R4 설정하기
Router> enable
Router# configure terminal
Router(config)# hostname R4
R4(config)# interface fastethernet 0/0
R4(config-if)# ip address 192.168.100.6 255.255.255.252
R4(config-if)# no shutdown
R4(config)# interface fastethernet 0/1
R4(config-if)# ip address 192.168.20.1 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# exit
R4(config)# ip route 0.0.0.0 0.0.0.0 192.168.100.5
R4(config)# no shutdown
R4(config)# end
R4#
라우팅 테이블 설정하기(1) - 정적 경로 설정
정적 경로의 설정(Static Routing)
정적 경로(static route)의 설정은 일반적으로 규모가 작은 네트워크에서 주로 사용합니다. 동적 경로와 비교하여 정적 경로는 다음과 같은 장점을 갖습니다.
- 라우팅 프로토콜로 인한 부하가 거의 없습니다. 동적 경로는 라우팅 테이블을 유지하기 위하여 활성된 라우팅 프로토콜이 주기적으로 라우터간 정보를 지속적으로 교환합니다. 이로 인한 네트워크상의 트래픽 발생과 라우팅 정보 교환 및 경로 계산 등으로 인한 CPU와 메모리의 사용 등 부하가 발생하지만 정적 경로는 라우팅 정보의 교환이나 경로 계산 등의 작업이 없기 때문에 가볍게 사용할 수 있는 경로 지정 방법입니다.
- 경로의 지정시 네트워크 관리자에 의해 자세한 설정이 가능합니다. 목적지 네트워크와 목적지 네트워크로의 경로 지정에 필요한 next hop IP 주소를 관리자가 의도한 대로 설정할 수 있습니다.
정적 경로는 이와 같은 장점외에 치명적인 단점도 가지고 있습니다.
- 네트워크의 연결 링크 다운, 새로운 네트워크의 연결 등 토플로지의 변화를 반영하지 못합니다. 정적 경로의 경우 직접 연결된 링크의 up, down에 의한 변화는 감지할 수 있지만 정적 경로로 등록한 인접하지 않은 네트워크 정보는 상태를 반영할 수 없습니다.
- 네트워크의 규모가 커지면 관리 노력이 필요 이상으로 증가합니다. 네트워크 수가 조금만 늘어나도 각 라우터마다 일일이 관리자가 라우팅 테이블을 직접 관리해야 하므로 라우팅 테이블을 유지하는 노력이 과중해지며 복수의 경로 발생시 백업 및 로드밸런싱 등의 설정을 자동화하기 어렵고 이로 인해 장애 발생시 자동 복구 능력이 없습니다.
정적 경로 설정하기
그림. 정적 경로 설정 연습을 위한 토플로지
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface fastethernet 0/0
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface serial 0/0
R1(config-if)# ip address 192.168.0.1 255.255.255.0
R1(config-if)# clock rate 128000
R1(config-if)# exit
R1(config)# ip route 192.168.20.0 255.255.255.0 192.168.0.2
R1(config)# end
R1# copy running-config startup-config
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface fastethernet 0/0
R2(config-if)# ip address 192.168.20.1 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# interface serial 0/0
R2(config-if)# ip address 192.168.0.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.0.1
R2(config)# end
R2# copy running-config startup-config
시리얼 인터페이스의 설정시 랩(lab) 환경에서 보통 라우터 대 라우터의 시리얼 인터페이스 간의 연결은 DCE-DTE 케이블이라고도 하는 백투백 케이블을 사용하여 연결합니다. 이때 시리얼 인터페이스의 DCE측에는 동기 클럭을 설정해야 합니다. DTE측은 설정해도 무시됩니다.
그림. 백투백 케이블
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.0.0/24 is directly connected, Serial0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
S 192.168.20.0/24 [1/0] via 192.168.0.2
R1#
R2# ping 192.168.10.101
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.101, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms
R1#
show ip route 명령을 사용하여 라우팅 테이블을 확인한다. 인터페이스로 직접 연결된 네트워크는 'C'로 표시되고 정적 경로로 등록된 네트워크는 'S'로 표시됩니다.