●4일차(20241224)
# 스위치 한번에 세팅
config t
vlan 2
name VLAN2
exit
interface fastethernet1/2
switchport mode access
switchport access VLAN 2
exit
interface fastethernet1/0
switchport mode trunk
exit
exit
show interface trunk
# 라우터 한번에 세팅
[R1]
config t
hostname jjcom
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
exit
interface fastethernet0/0.2
encapsulation dot1q 2
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.37 255.255.255.252
no shutdown
exit
ip route 192.168.2.0 255.255.255.0 1.1.1.38
------------------------------------------------------------------
exit
show running-config
show ip interface brief
(둘중에 하나 선택해서 쓰자 두번째게 더 보기 편하긴함)

------------------------------------------------------------------
[R2]
config t
hostname MSH
interface fastethernet0/0
ip address 192.168.2.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.38 255.255.255.252
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 1.1.1.37
ip route 192.168.1.0 255.255.255.0 1.1.1.37
# 해커(pc1)에서 pc3까지 ping이 가게 만들려고 한다.

1. pc3설정
[pc3]
ip 192.168.2.1 255.255.255.0 192.168.2.254
show ip
ping 192.168.2.254
save
-> pc1에서 핑이 안간다 인터페이스에 넣어주지 않아서이다
2. 인터페이스 설정
[R1]
interface serial1/0
ip address 1.1.1.37 255.255.255.252
no shutdown
exit
[R2]
interface serial1/0
ip address 1.1.1.38 255.255.255.252
no shutdown
exit
--> 둘다 설정해줘야 연결됨
--> R1에서 R2로 핑이 간다 (ping 1.1.1.38)
--> 연결만 된 상황 근데 표지판 데이터가 없는 상태
--> 라우팅 테이블을 해줘야함
3. 정적 라우팅
--> 목적지를 보면서 어디로 가야할지 수동으로 정해줘야 한다
[R1]
ip route 192.168.2.0 255.255.255.0 1.1.1.38
핑이 가긴 가는데 돌아오지를 못함
--> r2 pc3 사이에 선에서 wire shark에서 확인
[R2]
ip route 192.168.0.0 255.255.255.0 1.1.1.37
ip route 192.168.1.0 255.255.255.0 1.1.1.37
--> 돌아오는 표지판을 만들어줌
--> 해커(kari)에서 ping을 192.168.2.254(pc3)로 보내주면 정상적으로 작동한다.

ex) 5개의 라우터를 이용한 pc연결
[R1]
config t
hostname R1
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 1.1.1.2
[R2]
config t
interface serial1/0
ip address 1.1.1.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 2.2.2.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 2.2.2.2
ip route 192.168.0.0 255.255.255.0 1.1.1.1
[R3]
config t
interface serial1/0
ip address 3.3.3.1 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 2.2.2.2 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 3.3.3.2
ip route 192.168.0.0 255.255.255.0 2.2.2.1
[R4]
config t
interface serial1/0
ip address 3.3.3.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 4.4.4.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 4.4.4.2
ip route 192.168.0.0 255.255.255.0 3.3.3.1
[R5]
config t
interface serial1/0
ip address 5.5.5.1 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 4.4.4.2 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 5.5.5.2
ip route 192.168.0.0 255.255.255.0 4.4.4.1
4. 동적 라우팅
4-1. 거리벡터라우팅 프로토콜(라우터-라우터)(RIP)
--> 라우터를 기준으로 어느 네트워크에 연결되어 있는지만 알려주면 된다
--> 라우터가 15개 이상은 쓸수가 없다
--> 네트워크에 변동사항이 생기면 30초마다 데이터를 전달해준다
--> 큰 네트워크에 못씀
[RIP 동적라우팅 설정]
RIP1
RIP2(version 2 이용하자)
[R1]
config t
hostname R1
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.1 255.255.255.252
no shutdown
exit
router rip
version 2
network 192.168.0.0
network 1.1.1.0
[R2]
config t
interface serial1/0
ip address 1.1.1.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 2.2.2.1 255.255.255.252
no shutdown
router rip
version 2
network 1.1.1.0
network 2.2.2.0
[R3]
config t
interface serial1/0
ip address 3.3.3.1 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 2.2.2.2 255.255.255.252
no shutdown
router rip
version 2
network 2.2.2.0
network 3.3.3.0
[R4]
config t
interface serial1/0
ip address 3.3.3.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 4.4.4.1 255.255.255.252
no shutdown
router rip
version 2
network 3.3.3.0
network 4.4.4.0
[R5]
config t
hostname R1
interface fastethernet0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
interface serial1/1
ip address 4.4.4.2 255.255.255.252
no shutdown
exit
router rip
version 2
network 192.168.1.0
network 4.4.4.0
4-2. 상태링크라우팅 프로토콜(OSPF)
중대규모 네트워크에 가장 많이 사용됨
라우팅 정보 업데이트 224.0.0.5의 224.0.0.6의 멀티캐스트 사용
프로토콜 번호 89번 사용
경로 상태에 변화가 생기면 변화된 부분만 업데이트 진행
업데이트할 내용이 없더라도 30분 간격으로 링크 상태 재생 기능을 통해 주기적으로 라우팅 업데이트 정보를 교환함
http://boanin.jeonjucom.kr/