프로젝트 005
기본 설정
스위치
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
[R2]
config t
hostname kje
interface fastethernet0/0
ip address 192.168.2.254 255.255.255.0
no shutdown
exit
PC3 > ip 192.168.2.1 255.255.255.0 192.168.2.254
PC3에서 R2 연결 확인 (ping 192.168.2.254)
하지만 kali(0.1)에서 pc3(2.1)까지 연결이 되지 않는다.
라우터의 인터페이스에 ip를 넣어주지 않았기 때문.
라우터를 1.1.1.0/30으로 설정.
서브넷마스크(/30)가 255.255.255.252, 1111 1100이므로 각 범위가 4개씩 나누어지기 때문에 0,1,2,3 중 0과 3을 사용할 수 없으니 1과 2만 사용가능하다.
그러므로 R1에는 1.1.1.1 , R2에는 1.1.1.2번을 넣어준다.
---
R1에 1.1.1.37/30
R2에 1.1.1.38/30
설정.
[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
추가해준다.
show ip interface brief / show running-config 로 ip 확인
---
kali -> R1 연결됨
R1 -> R2 연결됨
R2 -> pc3 연결됨
전 구간이 연결 되었으나, kali에서 (192.168.0.1) pc3까지 (192.168.2.1) ping을 보내면 연결되지 않는다.
라우터에 목적지를 설정해주어야 함 > 라우팅 테이블 설정 필요.
[R1]
ip route 192.168.2.0 255.255.255.0 1.1.1.38
[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
-----
*라우터 총정리
[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
[R2]
config t
hostname kje
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
exit
라우터 총정리
[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
[R2]
config t
hostname kje
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
exit
프로젝트 006 (정적 라우팅)
-수동으로 일일이 라우팅한다. (경로 지정)

---
[R1]
config t
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
exit
[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.0.0 255.255.255.0 1.1.1.1
ip route 192.168.1.0 255.255.255.0 2.2.2.2
exit
[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.0.0 255.255.255.0 2.2.2.1
ip route 192.168.1.0 255.255.255.0 3.3.3.2
exit
.
.
.
[R14]
config t
interface serial1/0
ip address 13.13.13.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 14.14.14.1 255.255.255.252
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 13.13.13.1
ip route 192.168.1.0 255.255.255.0 14.14.14.2
exit
[R15]
config t
interface serial1/0
ip address 15.15.15.1 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 14.14.14.2 255.255.255.252
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 14.14.14.1
ip route 192.168.1.0 255.255.255.0 15.15.15.2
exit
[R16]
config t
interface fastethernet0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 15.15.15.2 255.255.255.252
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 15.15.15.1
exit
프로젝트 007 (동적 라우팅)
1. 거리벡터 라우팅 프로토콜 (라우터-라우터)
2. 상태링크 라우팅 프로토콜 (OSPF)
-----
거리벡터 라우팅 프로토콜(RIP)
-어떤 네트워크가 연결되었는지 알려주면 된다.
-예를들어, R2는 1.1.1.0과 2.2.2.0이 연결되어 있으니 두개가 연결되어있다고 알려주면 됨.
-라우터끼리 정보를 주고받고, 30초마다 데이터를 업데이트 한다.
-14개 이상 라우터부터는 연결이 되지 않는다.
-모든 라우터가 업데이트 되기까지 시간이 많이 걸리기 때문에 소규모 네트워크에 사용됨.
[R1]
config t
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
exit
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
exit
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
exit
router rip
version 2
network 3.3.3.0
network 4.4.4.0
[R5]
config t
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