✔ Static Routing
◾ 장점
- 라우터가 경로 계산을 할 필요 없어 부담이 작음으로 성능이 좋아지고 자원 사용량이 낮아진다
- 라우팅 정보 교환이 없기 때문에 네트워크 대역폭을 절약할 수 있다
- 외부에 정보를 알리지 않기 때문에 보안이 강화된다
- 라우팅 테이블의 크기가 상대적으로 작아짐
◾ 단점
- 일일이 목적지 경로를 지정해야 하기 때문에 번거롭다
- 입력해둔 경로에 문제가 생기면 장애 처리가 어렵다
- 경로 변경 시 다시 다 지정해줘야 한다
◾ 설정 방법
Routing(config)# ip route [목적지 네트워크 주소] [서브넷 마스크] [넥스트 홉 주소]
[ AD값 / 매트릭 값] 이 값이 제일 작은 것이 최적 경로로 라우팅 테이블에 올라간다.
AD 값 : Administrative Distance, 작을 수록 우선 순위가 높다.
Connected : 0 / Static : 1 / RIP : 120 / EIGRP : 90 / OSPF : 170
◾ Floating Static Routing
- 플로팅 스태틱 라우팅을 설정하면 회선 백업이 가능하다.
- 이중화된 회선 구성에서 평소에는 한 회선을 주 회선으로 사용하다가 주 회선에 장애가 발생하면
백업 회선으로 자동으로 트래픽을 전달하기 위해 사용한다.
- AD값을 조정하면 된다.
(config)# ip route [목적지 네트워크 주소] [서브넷 마스크] [다음 홉 주소] [AD 값]
✔ 연습 문제 Static Routing
Router0(config)# ip route 211.175.185.0 255.255.255.0 1.1.1.2
Router1(config)# ip route 192.168.1.0 255.255.255.0 1.1.1.1
R1(config)# ip route 10.0.0.0 255.0.0.0 1.1.1.2
R1(config)# ip route 172.16.0.0 255.255.0.0 1.1.1.2
R2(config)# ip route 150.50.0.0 255.255.0.0 1.1.1.1
R2(config)# ip route 192.168.10.0 255.255.255.0 1.1.1.1
R1(config)# ip route 2.0.0.0 255.0.0.0 1.1.1.2
R1(config)# ip route 126.0.0.0 255.0.0.0 1.1.1.2
R1(config)# ip route 223.160.0.0 255.255.255.0 1.1.1.2
R2(config)# ip route 192.168.10.0 255.255.255.0 1.1.1.1
R2(config)# ip route 223.160.0.0 255.255.255.0 2.2.2.3
R3(config)# ip route 1.0.0.0 255.0.0.0 2.2.2.2
R3(config)# ip route 192.168.10.0 255.255.255.0 2.2.2.2
R3(config)# ip route 126.0.0.0 255.0.0.0 2.2.2.2
R0(config)# int f0/0
R0(config-if)# ip add 192.168.10.254 255.255.255.0
R0(config-if)# no sh
R0(config)# int s0/0/0
R0(config-if)# ip add 10.10.10.1 255.255.255.252
R0(config-if)# no sh
R0(config)# ip route 10.10.20.0 255.255.255.252 10.10.10.2
R0(config)# ip route 192.168.20.0 255.255.255.0 10.10.10.2
R1(config)# int s0/0/0
R1(config-if)# ip add 10.10.10.2 255.255.255.252
R1(config-if)# no sh
R1(config)# int s0/0/1
R1(config-if)# ip add 10.10.20.1 255.255.255.252
R1(config-if)# no sh
R1(config)# ip route 192.168.10.0 255.255.255.0 10.10.10.1
R1(config)# ip route 192.168.20.0 255.255.255.0 10.10.20.2
R2(config)# int f0/0
R2(config-if)# ip add 192.168.20.254 255.255.255.0
R2(config-if)# no sh
R2(config)# int s0/0/0
R2(config-if)# ip add 10.10.20.2 255.255.255.252
R2(config-if)# no sh
R2(config)# ip route 10.10.10.0 255.255.255.252 10.10.20.1
R1(config)# ip route 192.168.10.0 255.255.255.0 10.10.20.1
R1(config)# ip route 172.16.10.0 255.255.255.0 10.10.12.2
R1(config)# ip route 10.10.23.0 255.255.255.252 10.10.12.2
R1(config)# ip route 10.10.32.0 255.255.255.252 10.10.12.2
R1(config)# ip route 10.10.34.0 255.255.255.252 10.10.12.2
R2(config)# ip route 192.168.10.0 255.255.255.0 10.10.12.1
R2(config)# ip route 10.10.34.0 255.255.255.252 10.10.23.2
R2(config)# ip route 10.10.34.0 255.255.255.252 10.10.32.2
R2(config)# ip route 172.16.10.0 255.255.255.0 10.10.23.2
R2(config)# ip route 172.16.10.0 255.255.255.0 10.10.32.2
R3(config)# ip route 172.16.10.0 255.255.255.0 10.10.34.2
R3(config)# ip route 10.10.12.0 255.255.255.252 10.10.23.1
R3(config)# ip route 10.10.12.0 255.255.255.252 10.10.32.1
R3(config)# ip route 192.168.10.0 255.255.255.0 10.10.23.1
R3(config)# ip route 192.168.10.0 255.255.255.0 10.10.32.1
R4(config)# ip route 192.168.10.0 255.255.255.0 10.10.34.1
R4(config)# ip route 10.10.12.0 255.255.255.252 10.10.34.1
R4(config)# ip route 10.10.23.0 255.255.255.252 10.10.34.1
R4(config)# ip route 10.10.32.0 255.255.255.252 10.10.34.1
※ Floating Static Routing 설정
10.10.23.0을 주 회선으로 설정하겠다.
R2(config)#ip route 10.10.34.0 255.255.255.252 10.10.32.2 5
R2(config)#ip route 172.16.10.0 255.255.255.0 10.10.32.2 5
기존 R2의 라우팅 테이블을 보면 10.10.34.0 에 대한 경로가 2개 있다.
그 이유는 같은 스태틱 라우팅이며, 같은 AD 값과 매트릭 값을 가지고 있기 때문이다.
R2(config)#ip route 10.10.34.0 255.255.255.252 10.10.32.2 5 이 명령을 통해
S0/1/0을 통한 경로는 AD값이 5가 되어 우선순위에서 밀리게 된다.
그래서 라우팅 테이블에는 우선순위가 높은 경로가 10.10.23.2인 것이 올라간다.
여기서 10.10.23.0 대역의 회선에 장애가 생긴다면
자동적으로 10.10.32.0 대역의 회선이 라우팅 테이블에 등록된다.
● Default Routing
- Stub 네트워크에서 사용
- 경로가 하나밖에 없기 때문에 모르는 네트워크는 모두 그 쪽으로 보냄
- 정적 라우팅은 특정 목적지를 가기 위한 구성이고,
- 디폴트 라우팅은 특정 목적지를 정하지 않고 그냥 모두 디폴트로 지정한 곳으로 보낸다는 차이가 있다.
※ Stub : 말단, 끝
Router(config)# ip route 0.0.0.0 0.0.0.0 [넥스트 홉 주소]
R0(config)# ip route 0.0.0.0 0.0.0.0 1.1.1.2
R1(config)# ip route 0.0.0.0 0.0.0.0 1.1.1.1
R1(config)# ip route 192.168.10.0 255.255.255.0 2.1.1.3
R1(config)# ip route 192.168.20.0 255.255.255.0 2.1.1.3
R1(config)# ip route 192.168.30.0 255.255.255.0 2.1.1.3
R2(config)# ip route 0.0.0.0 0.0.0.0 2.1.1.2
R1(config)# ip route 0.0.0.0 0.0.0.0 1.1.1.2
R2(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.3
R2(config)# ip route 192.168.10.0 255.255.255.0 1.1.1.1
R2(config)# ip route 20.0.0.0 255.0.0.0 1.1.1.1
R3(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.2
R3(config)# ip route 8.0.0.0 255.0.0.0 3.3.3.4
R3(config)# ip route 223.200.10.0 255.255.255.0 3.3.3.4
R4(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.3
※ Longest Prefix Match Rule
- 라우터가 패킷을 보낼 때 목적지를 향한 경로가 여러 개 있을 때
라우팅 테이블에 있는 경로 중 패킷의 목적지와 일치하는 네트워크 중 프리픽스가 가장 긴 경로로 보냄