관리 메뉴

개발 노트

13주차 Subnetting_Examples_I 본문

학부 공부 : 21.03.02~06.20/인터넷 이론 및 실습

13주차 Subnetting_Examples_I

hayoung.dev 2021. 5. 27. 08:00

<실험 1>

이것처럼 설정

 

 

(fastEthernet이 자신임)

 

 

switch 0 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int g
Switch(config)#int gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 216.21.5.161 255.255.255.224
Switch(config-if)#int gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 216.21.5.33 255.255.255.224
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 216.21.5.0
Switch(config-router)#

 

 

switch1 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int g
Switch(config)#int gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 216.21.5.65 255.255.255.224
Switch(config-if)#int gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 216.21.5.34 255.255.255.224
Switch(config-if)#int gigabitEthernet 1/0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to up

Switch(config-if)#ip address 216.21.5.97 255.255.255.224
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 216.21.5.0
Switch(config-router)#

 

switch2 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#in
Switch(config)#interface g
Switch(config)#interface gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 216.21.5.129 255.255.255.224
Switch(config-if)#interface gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 216.21.5.98 255.255.255.224
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 216.21.5.0
Switch(config-router)#

 

 

switch2에서 모든 5개의 서브넷이 라우팅 테이블에 올라와 있는 것 확인 가능

 

 

 

 

<실험 2>

스위치와 PC끼리는 전부 1/0/1, 스위치끼리는 그림처럼

 

switch0 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int g
Switch(config)#int gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 211.114.122.5
% Incomplete command.
Switch(config-if)#ip address 211.114.122.5 255.255.255.252
Switch(config-if)#int gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 211.114.122.21 255.255.255.252
Switch(config-if)#int gigabitEthernet 1/0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to up

Switch(config-if)#ip address 211.114.122.17 255.255.255.252
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 211.114.122.0

show run으로 할당된 모습 확인

 

 

switch1 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int
Switch(config)#interface g
Switch(config)#interface gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 211.114.122.9 255.255.255.252
Switch(config-if)#interface gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 211.114.122.18 255.255.255.252
Switch(config-if)#interface gigabitEthernet 1/0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to up

Switch(config-if)#ip address 211.114.122.25 255.255.255.252
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 211.114.122.0
Switch(config-router)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console

 

구성 확인

 

 

 

switch2 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#int g
Switch(config)#int gigabitEthernet 1/0/1
Switch(config-if)#no sw
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch(config-if)#ip address 211.114.122.13 255.255.255.252
Switch(config-if)#int gigabitEthernet 1/0/2
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

Switch(config-if)#ip address 211.114.122.26 255.255.255.252
Switch(config-if)#int gigabitEthernet 1/0/3
Switch(config-if)#no switchport 
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/3, changed state to up

Switch(config-if)#ip address 211.114.122.22 255.255.255.252
Switch(config-if)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console

 

설정 결과

 

 

show ip route를 하면 이렇게 6개가 나와야 함

반응형