본문 바로가기

CCNA 기초

IP Routing - default rounting


Serial port는 Static routing으로 Fastethernet은 Default routing으로 설정하시오.




Router 0 설정 -Default routing

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int se 0/0/0
Router(config-if)#ip add 10.1.12.1 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#exit

Router(config)#int fa 0/0
Router(config-if)#ip add 10.1.41.1 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int se 0/0/0
Router(config-if)#clock rate 64000
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.41.2
- Default routing 설정을 해준다. 라우팅 테이블이 없을 경우에 모든 곳에 정보를 뿌리게 된다. 여기서 0은 무한대의 의미를 지닌다.
- 10.1.41.2 는 중간 라우터 IP이다.

Router(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#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 10.1.41.2 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, Serial0/0/0
C       10.1.41.0 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 10.1.41.2     - Default routing  설정을 통해 생성된다.

Router#ping 10.1.34.1  - Default routing 설정이 모두 끝난 후 확인한다.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.34.1, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 9/13/17 ms

------------------------------------------------------------------------------------------------------------------

Router 1 설정

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int se 0/0/0
Router(config-if)#ip add 10.1.12.2 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
Router(config-if)#exit
Router(config)#int se 0/0/1
Router(config-if)#ip add 10.1.23.1 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int se 0/0/1
Router(config-if)#clock rate 64000
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#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

     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, Serial0/0/0
C       10.1.23.0 is directly connected, Serial0/0/1

------------------------------------------------------------------------------------------------------------------

Router 2 설정 - Static routing

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int se 0/0/1
Router(config-if)#ip add 10.1.23.2 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa 0/1

Router(config-if)#ip add 10.1.34.1 255.255.255.0

- Fastethernet 으로 ip route 설정

Router(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip route 10.1.41.0 255.255.255.0 10.1.34.2

- Default routing을 통해서 설정해 준다음 Router 0에서 ping을 통해 확인해보면
Router 2에서 수신만 할뿐 다시 Router 0에게 재전송해 주지 않는다.
이를 해결하기 위해 다시 Default routing을 해주거나 Static routing을 통해 ip route를 설정해 준다.
 
Router(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#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

     10.0.0.0/24 is subnetted, 3 subnets
C       10.1.23.0 is directly connected, Serial0/0/1
C       10.1.34.0 is directly connected, FastEthernet0/1
S       10.1.41.0 [1/0] via 10.1.34.2

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip route 10.1.12.0 255.255.255.0 10.1.23.1

- Serial port 로 ip route 설정

Router(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#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

     10.0.0.0/24 is subnetted, 4 subnets
S       10.1.12.0 [1/0] via 10.1.23.1
C       10.1.23.0 is directly connected, Serial0/0/1
C       10.1.34.0 is directly connected, FastEthernet0/1
S       10.1.41.0 [1/0] via 10.1.34.2

Router#ping 10.1.12.1  - ip route 설정 확인

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/9 ms


------------------------------------------------------------------------------------------------------------------

Router 3 설정 - Default routing

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa 0/0
Router(config-if)#ip add 10.1.41.2 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int fa 0/1
Router(config-if)#ip add 10.1.34.2 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.34.1
- Default routing 설정을 해준다.


Router(config)#end

%SYS-5-CONFIG_I: Configured from console by console
Router#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 10.1.34.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.34.0 is directly connected, FastEthernet0/1
C       10.1.41.0 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 10.1.34.1                      - Default routing  설정을 통해 생성된다.