본문 바로가기

해봐야 안다.OTL/Network

Static Route

Static Route
네트워크 관리자가 직접 목적지 별로 네트워크 경로를 만들어 라우터에게 알려주는 것을 말한다
라우터는 네트워크 관리자가 지정해 준 네트워크 경로를 자신의 라우팅 테이블에 인스톨하고
패킷 요청이 있을 경우에 패킷을 목적지로 전송한다

장점
1. 라우터간에 대역폭을 낭비하는 일이 없으며 라우터의 메모리나 CPU상에 부담이 없다
2. Static Route는 Dynamic Routing Protocol 에 비해 대역폭을 덜 차지한다
3. 보안성이 높다

단점
1.네트워크 경로를 정확하게 알고 있어야 하며 한 회선이 추가 또는 변경될 때마다 라우터들에게
새로운 경로를 설정해 주어야 한다
2. 대규모 네트워크에 적용하기 힘들며 네트워크 변화를 잘 감지하지 못한다.

Static Route 구성하기
router(config)# ip route <Destination Network> <Destination Mask> <Next-Hop or Exit Interface>
Ip Route : Static Route를 설정할때 ip route 명령어를 사용하여 관리자가 직접 네트워크 경로를 설정할 수 있다.
Destination Network : 목적지 Network 지정
Destination Mask : 목적지 SubnetMask 지정
Next-Hop : 목적지 Network 로 패킷을 전송하기 위해 어느 경로를 통해 패킷을 전송할 것인지 지정
Exit Interface : 목적지 Network 로 가는 경로를 정확히 알지 못할때 IP 주소대신 Interface 이름 지정

실습랩 구성하기_예제
R11(config)# 192.168.3.0 255.255.255.0 192.168.2.2<Next-Hop IP>
R11(config)# 192.168.3.0 255.255.255.0 serial 1<Interface>

R12(config)# 192.168.1.0 255.255.255.0 192.168.2.1<Next-Hop IP>
R12(config)# 192.168.1.0 255.255.255.0 serial 1<Interface>

Static Route 삭제하기
R11(config)# no 192.168.3.0 255.255.255.0 192.168.2.2<Next-Hop IP>
R11(config)# no 192.168.3.0 255.255.255.0 serial 1<Interface>

R12(config)# no 192.168.1.0 255.255.255.0 192.168.2.1<Next-Hop IP>
R12(config)# no 192.168.1.0 255.255.255.0 serial 1<Interface>

 <실습>

 

!-- R11
R11(config)# interface serial 0/0
R11(config-if)# encapsulation ppp
R11(config-if)# ip address 192.168.2.1 255.255.255.0
R11(config-if)# bandwidth 2048
R11(config-if)# clock rate 2000000
R11(config-if)# no shutdown
R11(config-if)# exit
R11(config)# interface serial 0/1
R11(config-if)# encapsulation ppp
R11(config-if)# ip address 192.168.4.1 255.255.255.0
R11(config-if)# bandwidth 2048
R11(config-if)# clock rate 2000000
R11(config-if)# no shutdown
R11(config-if)# exit
R11(config)# interface loopback 0
R11(config-if)# ip address 192.168.5.1 255.255.255.0
R11(config-if)# no shutdown
R11(config-if)# end
R11이 보유하고 있는 Network 정보
192.168.2.0/24
192.168.4.0/24
192.168.5.0/24
R11이 필요한 Network 정보
192.168.1.0/24
192.168.3.0/24
R11 Static Route 구성하기
R11(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.2 or s0/0
R11(config)# ip route 192.168.3.0 255.255.255.0 192.168.4.2 or s0/1
확인하기
R11# show ip route --> routing table 정보 확인
Default Route 구성하기
R11(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.2 or s0/0
R13(config)# ip route 192.168.3.0 255.255.255.0 192.168.4.2 or s0/1
확인하기
R11# show ip route --> routing table 정보 확인

 


!-- R12
R12(config)# interface serial 0/0
R12(config-if)# encapsulation ppp
R12(config-if)# ip address 192.168.2.2 255.255.255.0
R12(config-if)# bandwidth 2048
R12(config-if)# clock rate 2000000
R12(config-if)# no shutdown
R12(config-if)# exit
R12(config)# interface loopback 0
R12(config-if)# ip address 192.168.1.1 255.255.255.0
R12(config-if)# no shutdown
R12(config-if)# end
R12이 보유하고 있는 Network 정보
192.168.1.0/24
192.168.2.0/24
R12이 필요한 Network 정보
192.168.3.0/24
192.168.4.0/24
192.168.5.0/24
R12 Static Route 구성하기
R12(config)# ip route 192.168.3.0 255.255.255.0 192.168.2.1 or s0/0
R12(config)# ip route 192.168.4.0 255.255.255.0 192.168.2.1 or s0/0
R12(config)# ip route 192.168.5.0 255.255.255.0 192.168.2.1 or s0/0
확인하기
R12# show ip route --> routing table 정보 확인
Default Route 구성하기
R12(config)# ip route 0.0.0.0 0.0.0.0 192.168.4.1 or s0/0
확인하기
R12# show ip route --> routing table 정보 확인


 

!-- R13
R13(config)# interface serial 0/0
R13(config-if)# encapsulation ppp
R13(config-if)# ip address 192.168.4.2 255.255.255.0
R13(config-if)# bandwidth 2048
R13(config-if)# clock rate 2000000
R13(config-if)# no shutdown
R13(config-if)# exit
R13(config)# interface loopback 0
R13(config-if)# ip address 192.168.3.1 255.255.255.0
R13(config-if)# no shutdown
R13(config-if)# end
R13이 보유하고 있는 Network 정보
192.168.3.0/24
192.168.4.0/24
R13가 필요한 Network 정보
192.168.1.0/24
192.168.2.0/24
192.168.5.0/24
R13 Static Route 구성하기
R13(config)# ip route 192.168.1.0 255.255.255.0 192.168.4.1 or s0/0
R13(config)# ip route 192.168.2.0 255.255.255.0 192.168.4.1 or s0/0
R13(config)# ip route 192.168.5.0 255.255.255.0 192.168.4.1 or s0/0
확인하기
R13# show ip route --> routing table 정보 확인
Default Route 구성하기
R13(config)# ip route 0.0.0.0 0.0.0.0 192.168.2.1 or s0/0
확인하기
R13# show ip route --> routing table 정보 확인