본문 바로가기

네트워크

라우터 포트에 IP 주소 설정 및 라우팅 테이블 확인

반응형

라우터 포트에 IP 주소 설정 및 라우팅 테이블 확인

Cisco 라우터에서 각 인터페이스(FastEthernet, GigabitEthernet 등)는 IP 주소를 직접 할당받아 네트워크와 통신하게 됩니다.

1. 라우터 포트에 IP 주소 설정하기

Privileged EXEC 모드로 진입

Router> enable

Global Configuration 모드로 진입

Router# configure terminal

해당 인터페이스(FastEthernet0/0 등) 선택 및 IP 설정

Router(config)# interface FastEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
※ no shutdown 명령은 해당 포트를 활성화하는 명령입니다.
이 명령 없이 설정만 해두면 포트가 "administratively down" 상태로 비활성화됩니다.

2. 라우터 포트 IP 주소 해제하기

포트에 할당된 IP 주소를 제거합니다.

Router> enable
Router# configure terminal
Router(config)# interface FastEthernet0/0
Router(config-if)# no ip address
Router(config-if)# exit

※ 포트의 IP가 제거되면 해당 네트워크와의 연결이 끊기며, 라우팅 테이블에서도 사라지게 됩니다.

3. 라우팅 테이블 확인(show ip route)

라우터는 네트워크 간 패킷 전달을 위해 라우팅 테이블을 유지합니다. 현재 연결된 네트워크 상태를 확인을 사용합니다.

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
C    172.16.0.0/16 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
Router#
  • C : 직접 연결된 네트워크
  • S : 정적(Static) 라우팅
  • O : OSPF를 통한 동적 라우팅
  • R : RIP을 통한 동적 라우팅

 

728x90
반응형