정적 라우팅 설정

정적 경로 종합문제 (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#

다음 그림에서 192.168.0.101 PC와 192.168.10.101 PC간에 서로 트래픽을 주고 받을 수 있도록 라우터를 설정하세요.

그림. 네트워크 구성

그림. 네트워크 구성

<<해설>>

라우터 A 설정하기

Router> enable
Router# configure terminal
Router(config)# hostname RouterA
RouterA(config)# interface fastethernet 0/0
RouterA(config-if)# ip address 192.168.0.1 255.255.255.0
RouterA(config-if)# no shutdown
RouterA(config)# interface fastethernet 0/1
RouterA(config-if)# ip address 192.168.5.1 255.255.255.0
RouterA(config-if)# no shutdown
RouterA(config-if)# exit
RouterA(config)# ip route 192.168.10.0 255.255.255.0 192.168.5.2
RouterA(config)# end
RouterA# show ip route

 

라우터 B 설정하기

Router> enable
Router# configure terminal
Router(config)# hostname RouterB
RouterB(config)# interface fastethernet 0/1
RouterB(config-if)# ip address 192.168.10.1 255.255.255.0
RouterB(config-if)# no shutdown
RouterB(config)# interface fastethernet 0/1
RouterB(config-if)# ip address 192.168.5.2 255.255.255.0
RouterB(config-if)# no shutdown
RouterB(config-if)# exit
RouterB(config)# ip route 192.168.0.0 255.255.255.0 192.168.5.1
RouterB(config)# end
RouterB# show ip route

hostname 라우터 이름을 변경한다.

ip route 정정 라우팅 설정을 한다. 목적지 네트워크 주소와 서브넷마스크를 입력하고 인접한 라우터의 인터페이스 주소를 지정한다.

ip route A.B.C.D(목적지 네트워크 주소) A.B.C.D(서브넷마스크) A.B.C.D(다음 홉 인터페이스 주소)

+ Recent posts