<문제>
어느 회사 내부 ip를 192.168.0.0/24로 할당받았다고 가정할때
8개의 부서가 있고 각 부서 당 인원은 10명일때 부서별로 ip를 설정하고 OSPF 1 area 0 으로 구성하라
*알고 있어야 하는 개념
OSPF 설정, 스위치 기초 설정 (VLAN , 트렁킹), 서브인터페이스, 서브넷마스크, VLSM
<풀이 & 명령어>
IP주소 할당
192.168.0.0/24
1: 192.168.0.0 ~ 192.168.0.15/28
2: 192.168.0.16 ~ 192.168.0.31/28
3: 192.168.0.32 ~ 192.168.0.47/28
4: 192.168.0.48 ~ 192.168.0.63/28
5: 192.168.0.64 ~ 192.168.0.79/28
6: 192.168.0.80 ~ 192.168.0.95/28
7: 192.168.0.96 ~ 192.168.0.111/28
8: 192.168.0.112 ~ 192.168.0.127/28
R1 - R2 : 192.168.0.128 ~ 192.168.0.131/30
R1 - R3 : 192.168.0.132 ~ 192.168.0.135/30
--------------------------------------------------------------------
명령어
<라우터 1>
인터페이스 설정
R1(config)#int s1/0
R1(config-if)#ip add 192.168.0.129 255.255.255.252
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int s1/1
R1(config-if)#ip add 192.168.0.133 255.255.255.252
R1(config-if)#no sh
R1(config-if)#exit
---------------------------------------------------------------------
핑 테스트
R1(config)#do ping 192.168.0.130
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.130, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/44 ms
OSPF 설정
R1(config)#do show ip route
192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C 192.168.0.128/30 is directly connected, Serial1/0
L 192.168.0.129/32 is directly connected, Serial1/0
C 192.168.0.132/30 is directly connected, Serial1/1
L 192.168.0.133/32 is directly connected, Serial1/1
----------------------------------------------------------------------
R1(config)#router ospf 1
R1(config-router)#ne
R1(config-router)#network 192.168.0.129 0.0.0.0 area 0
R1(config-router)#network 192.168.0.133 0.0.0.0 area 0
R1(config-router)#exit
---------------------------------------------------
<라우터 2>
인터페이스 & 서브인터페이스 설정
R2(config)#int fa0/0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int fa0/0.10
R2(config-subif)#encapsulation dot1Q 10
R2(config-subif)#ip add 192.168.0.1 255.255.255.240
R2(config-subif)#exit
R2(config)#int fa0/0.20
R2(config-subif)#encapsulation dot1Q 20
R2(config-subif)#ip add 192.168.0.17 255.255.255.240
R2(config-subif)#exit
R2(config)#int fa0/0.30
R2(config-subif)#encapsulation dot1Q 30
R2(config-subif)#ip add
R2(config-subif)#ip address 192.168.0.33 255.255.255.240
R2(config-subif)#exit
R2(config)#int fa0/0.40
R2(config-subif)#encapsulation dot1Q 40
R2(config-subif)#ip add 192.168.0.49 255.255.255.240
R2(config-subif)#exit
R2(config)#int s1/0
R2(config-if)#ip add 192.168.0.130 255.255.255.252
R2(config-if)#no sh
R2(config-if)#exit
OSPF 설정
R2(config)#do show ip route
192.168.0.0/24 is variably subnetted, 10 subnets, 3 masks
C 192.168.0.0/28 is directly connected, FastEthernet0/0.10
L 192.168.0.1/32 is directly connected, FastEthernet0/0.10
C 192.168.0.16/28 is directly connected, FastEthernet0/0.20
L 192.168.0.17/32 is directly connected, FastEthernet0/0.20
C 192.168.0.32/28 is directly connected, FastEthernet0/0.30
L 192.168.0.33/32 is directly connected, FastEthernet0/0.30
C 192.168.0.48/28 is directly connected, FastEthernet0/0.40
L 192.168.0.49/32 is directly connected, FastEthernet0/0.40
C 192.168.0.128/30 is directly connected, Serial1/0
L 192.168.0.130/32 is directly connected, Serial1/0
R2(config)#router ospf 1
R2(config-router)#network 192.168.0.1 0.0.0.0 area 0
R2(config-router)#network 192.168.0.17 0.0.0.0 area 0
R2(config-router)#network 192.168.0.33 0.0.0.0 area 0
R2(config-router)#network 192.168.0.49 0.0.0.0 area 0
R2(config-router)#network 192.168.0.130 0.0.0.0 area 0
R2(config-router)#exit
------------------------------------------------------------------
<라우터 3>
R3(config)#int fa0/0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int fa0/0.50
R3(config-subif)#encapsulation dot1Q 50
R3(config-subif)#ip add 192.168.0.65 255.255.255.240
R3(config-subif)#exit
R3(config)#int fa0/0.60
R3(config-subif)#encapsulation dot1Q 60
R3(config-subif)#ip address 192.168.0.81 255.255.255.240
R3(config-subif)#exit
R3(config)#int fa0/0.70
R3(config-subif)#encapsulation dot1Q 70
R3(config-subif)#ip add 192.168.0.97 255.255.255.240
R3(config-subif)#exit
R3(config)#int fa0/0.80
R3(config-subif)#encapsulation dot1Q 80
R3(config-subif)#ip address 192.168.0.113 255.255.255.240
R3(config-subif)#exit
R3(config)#do show ip route
192.168.0.0/24 is variably subnetted, 10 subnets, 3 masks
C 192.168.0.64/28 is directly connected, FastEthernet0/0.50
L 192.168.0.65/32 is directly connected, FastEthernet0/0.50
C 192.168.0.80/28 is directly connected, FastEthernet0/0.60
L 192.168.0.81/32 is directly connected, FastEthernet0/0.60
C 192.168.0.96/28 is directly connected, FastEthernet0/0.70
L 192.168.0.97/32 is directly connected, FastEthernet0/0.70
C 192.168.0.112/28 is directly connected, FastEthernet0/0.80
L 192.168.0.113/32 is directly connected, FastEthernet0/0.80
C 192.168.0.132/30 is directly connected, Serial1/1
L 192.168.0.134/32 is directly connected, Serial1/1
R3(config)#router ospf 1
R3(config-router)#network 192.168.0.65 0.0.0.0 area 0
R3(config-router)#network 192.168.0.81 0.0.0.0 area 0
R3(config-router)#network 192.168.0.97 0.0.0.0 area 0
R3(config-router)#network 192.168.0.113 0.0.0.0 area 0
R3(config-router)#network 192.168.0.134 0.0.0.0 area 0
R3(config-router)#exit
---------
스위치 설정시 알아두면 좋은 개념
[Cisco] 패킷트레이서 Vlan (Trunk) 설정
VLAN이란? 스위치의 각 포트를 서로 다른 네트워크로 구분할 수 있게 해주는 기능이다. VLAN의 포트는 Access / Trunk 두가지이다. 트렁크란? 트렁크란 복수개의 VLAN 프레임을 전송할 수 있는 링크를 말
jeongzzang.com
스위치 1
VLAN 설정
ESW1#vlan database
ESW1(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
ESW1(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
ESW1(vlan)#vlan 30
VLAN 30 added:
Name: VLAN0030
ESW1(vlan)#vlan 40
VLAN 40 added:
Name: VLAN0040
ESW1(vlan)#exit
트렁크
ESW1(config)#int fa1/0
ESW1(config-if)#switchport trunk encapsulation dot1q
ESW1(config-if)#switchport mode trunk
액세스
ESW1(config)#int f1/1
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 10
ESW1(config-if)#exit
ESW1(config)#int f1/2
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 20
ESW1(config-if)#exit
ESW1(config)#int f1/3
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 30
ESW1(config-if)#exit
ESW1(config)#int f1/4
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 40
ESW1(config-if)#exit
--------------------------------------------------------
스위치 2
VLAN 설정
ESW2#vlan database
ESW2(vlan)#vlan 10
ESW2(vlan)#exit
range명령어로 한번에 액세스 설정
ESW2#conf t
ESW2(config)#int range fa1/0 - 15
ESW2(config-if-range)#switchport mode access
ESW2(config-if-range)#switchport access vlan 10
ESW2(config-if-range)#exit
---------------------------------------------------------
스위치 3
ESW3#vlan database
ESW3(vlan)#vlan 20
ESW3(vlan)#exit
ESW3#conf t
ESW3(config)#int range fa1/0 - 15
ESW3(config-if-range)#switchport mode access
ESW3(config-if-range)#switchport access vlan 20
ESW3(config-if-range)#exit
----
스위치 4
ESW4#vlan database
ESW4(vlan)#vlan 30
ESW4(vlan)#exit
ESW4#conf t
ESW4(config)#int range fa1/0 - 15
ESW4(config-if-range)#switchport mode access
ESW4(config-if-range)#switchport access vlan 30
ESW4(config-if-range)#exit
-----------------------------------------
스위치 5
ESW5#
ESW5#vlan database
ESW5(vlan)#vlan 40
ESW5(vlan)#exit
ESW5#conf t
ESW5(config)#int range fa1/0 - 15
ESW5(config-if-range)#switchport mode access
ESW5(config-if-range)#switchport access vlan 40
ESW5(config-if-range)#exit
--------------------------------------------------------------------
스위치 6
ESW6#vlan database
ESW6(vlan)#vlan 50
VLAN 50 added:
Name: VLAN0050
ESW6(vlan)#vlan 60
VLAN 60 added:
Name: VLAN0060
ESW6(vlan)#vlan 70
VLAN 70 added:
Name: VLAN0070
ESW6(vlan)#vlan 80
VLAN 80 added:
Name: VLAN0080
ESW6(vlan)#exit
ESW6#conf t
ESW6(config)#int fa1/0
ESW6(config-if)#switchport trunk encapsulation dot1q
ESW6(config-if)#switchport mode trunk
ESW6(config-if)#exit
ESW6(config)#int f1/1
ESW6(config-if)#switchport mode access
ESW6(config-if)#switchport access vlan 50
ESW6(config-if)#exit
ESW6(config)#int f1/2
ESW6(config-if)#switchport mode access
ESW6(config-if)#switchport access vlan 60
ESW6(config-if)#exit
ESW6(config)#int f1/3
ESW6(config-if)#switchport mode access
ESW6(config-if)#switchport access vlan 70
ESW6(config-if)#exit
ESW6(config)#int f1/4
ESW6(config-if)#switchport mode access
ESW6(config-if)#switchport access vlan 80
ESW6(config-if)#exit
---------------------------------------------------------------
스위치 7
ESW7#vlan database
ESW7(vlan)#vlan 50
VLAN 50 added:
Name: VLAN0050
ESW7(vlan)#exit
ESW7#conf t
ESW7(config)#int range fa1/0 - 15
ESW7(config-if-range)#switchport mode access
ESW7(config-if-range)#switchport access vlan 50
ESW7(config-if-range)#exit
---------------------------------------------------------------
스위치8
ESW8#vlan database
ESW8(vlan)#vlan 60
VLAN 50 added:
Name: VLAN0060
ESW8(vlan)#exit
ESW8#conf t
ESW8(config)#int range fa1/0 - 15
ESW8(config-if-range)#switchport mode access
ESW8(config-if-range)#switchport access vlan 60
ESW8(config-if-range)#exit
-------------------------------------------
스위치9
ESW9#vlan database
ESW9(vlan)#vlan 70
VLAN 50 added:
Name: VLAN0070
ESW9(vlan)#exit
ESW9#conf t
ESW9(config)#int range fa1/0 - 15
ESW9(config-if-range)#switchport mode access
ESW9(config-if-range)#switchport access vlan 70
ESW9(config-if-range)#exit
-----------------------------------------------------
스위치10
ESW10#vlan database
ESW10(vlan)#vlan 80
VLAN 50 added:
Name: VLAN0080
ESW10(vlan)#exit
ESW10#conf t
ESW10(config)#int range fa1/0 - 15
ESW10(config-if-range)#switchport mode access
ESW10(config-if-range)#switchport access vlan 80
ESW10(config-if-range)#exit
------------------------------------------------
부서별 IP
1: 192.168.0.0 ~ 192.168.0.15/28
2: 192.168.0.16 ~ 192.168.0.31/28
3: 192.168.0.32 ~ 192.168.0.47/28
4: 192.168.0.48 ~ 192.168.0.63/28
5: 192.168.0.64 ~ 192.168.0.79/28
6: 192.168.0.80 ~ 192.168.0.95/28
7: 192.168.0.96 ~ 192.168.0.111/28
8: 192.168.0.112 ~ 192.168.0.127/29
각 PC 주소 할당
PC1에서 192.168.0.0은 네트워크 주소 192.168.0.1은 서브인터페이스 설정시 사용 ( 게이트웨이) 했기 때문에 192.168.0.2부터 할당한다 (다른 pc들도 동일한 방법)
PC1> ip 192.168.0.2/28 192.168.0.1
Checking for duplicate address...
showPC1 : 192.168.0.2 255.255.255.240 gateway 192.168.0.1
PC2> ip 192.168.0.18/28 192.168.0.17
Checking for duplicate address...
PC1 : 192.168.0.18 255.255.255.240 gateway 192.168.0.17
PC3> ip 192.168.0.34/28 192.168.0.33
Checking for duplicate address...
PC1 : 192.168.0.34 255.255.255.240 gateway 192.168.0.33
PC4> ip 192.168.0.50/28 192.168.0.49
Checking for duplicate address...
PC1 : 192.168.0.50 255.255.255.240 gateway 192.168.0.49
PC5> ip 192.168.0.66/28 192.168.0.65
Checking for duplicate address...
PC1 : 192.168.0.66 255.255.255.240 gateway 192.168.0.65
PC6> ip 192.168.0.82/28 192.168.0.81
Checking for duplicate address...
PC1 : 192.168.0.82 255.255.255.240 gateway 192.168.0.81
PC7> ip 192.168.0.98/28 192.168.0.97
Checking for duplicate address...
PC1 : 192.168.0.98 255.255.255.240 gateway 192.168.0.97
PC8> ip 192.168.0.114/28 192.168.0.113
Checking for duplicate address...
PC1 : 192.168.0.114 255.255.255.240 gateway 192.168.0.113
---------------------------------------------------------------
'기타 > 1' 카테고리의 다른 글
라우터 실제 장비 & 개인 pc 연결해보기 (0) | 2021.12.24 |
---|---|
GNS3 , VM VirtualBoX 연동하는 방법 (0) | 2021.12.16 |
[국비과정] OSPF 개념 정리 , 에어리어, OSPF네트워크 타입 (0) | 2021.11.28 |
[국비과정] OSPF개념, 실습으로 쉽게 이해하기 , 네트워크 엔지니어 독학 책 추천 (0) | 2021.11.24 |
[국비과정] 스패닝트리 프로토콜 (STP) 동작원리 (0) | 2021.11.17 |