관리 메뉴

개발 노트

10주차 Standard Access List 설정 본문

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

10주차 Standard Access List 설정

hayoung.dev 2021. 5. 8. 22:54

 

PC1 설정

 

 

PC2 설정

 

 

PC3 설정

switch0 설정 (R1)

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 10/1
                                   ^
% Invalid input detected at '^' marker.
	
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 203.100.1.1 255.255.255.0
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 203.100.3.1 255.255.255.0
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 203.100.2.1 255.255.255.0
Switch(config-if)#exit
Switch(config)#router rip
Switch(config-router)#network 203.100.1.0
Switch(config-router)#network 203.100.2.0
Switch(config-router)#network 203.100.3.0
Switch(config-router)#exit
Switch(config)#access-list 10 deny 203.100.4.2
Switch(config)#access-list 10 permit 203.100.4.0 0.0.0.255
Switch(config)#
Switch(config)#access-list 10 permit 203.100.5.0 0.0.0.255
Switch(config)#access-list 10 permit 203.100.1.0 0.0.0.255
Switch(config)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console

 

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 swit
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 203.100.5.1 255.255.255.0
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 203.100.2.2 255.255.255.0
Switch(config-if)#exit
Switch(config)#router rip	
Switch(config-router)#network 203.100.2.0
Switch(config-router)#network 203.100.5.0
Switch(config-router)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

 

 

switch2 설정

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname R2
R2(config)#ip routing
R2(config)#int gi
R2(config)#int gigabitEthernet 1/0/1
R2(config-if)#no sw
R2(config-if)#no switchport 
R2(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

R2(config-if)#ip address 203.100.4.1 255.255.255.0
R2(config-if)#in
R2(config-if)#int gigabitEthernet 1/0/2
R2(config-if)#no switchport 
R2(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

R2(config-if)#ip address 203.100.3.2 255.255.255.0
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#network 203.100.3.0
R2(config-router)#network 203.100.4.0
R2(config-router)#^Z
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

 

 

Standard Access List 설정 전 ping 테스트 결과 잘 됨

 

스위치 R1에 Standard Access List 설정 소스코드

Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#in
Switch(config)#interface g
Switch(config)#interface gigabitEthernet 1/0/1
Switch(config-if)#ip access-group 10 out

 

PC3에서 PC1으로 ping 테스트 결과

destination host unreachable 결과가 나옴.

반응형