4일차 : 라우터

라우터 2번 설정 방법
config t
hostname yys
interface fastethernet0/0
ip address 192.168.2.254 255.255.255.0
no shutdown
exit

설정하면 3번 컴퓨터에서 라우터 2번으로 통신이 가능함

이제는 끝에서 끝으로 연결하기

1.1.1.0./30 > 서버는 1.1.1.0 서브넷은 255.255.255.252

0000 0000 -24 1
1000 0000 -25 2개
1100 0000 -26 4개
1110 0000 -27 8개
1111 0000 -28 16개
1111 1000 -29 32개
1111 1100 -30 64개
1111 1110 -31 128개

1당 4개씩
1 1 1 1 > 4 4 4 4

0-3 1번
4-7  2번
8-11 3번
12-15 4번
16-19 5번 
20-23 6번
24-27 7번
28-31 8번 
32-35 9번 형식으로 4의배수로 곱하고 그 뒤에 더하기 3을 해주기
ex> 1.1.1.0/30 을 10번째 네트워크 계산 > 37 38

라우터1에
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
--------------------
show running-config
show ip interface breif

라우터2에
config t
hostname jjcom
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.38 255.255.255.252
no shutdown
exit
do show ip int b

연결 후 라우터끼리 ping을 입력하면 !!!!! 가 뜨면 통신이 되는 것으로 알 수 있다.

라우터끼리 연결되었는데도 192.168.2.254까지 통신 시도를 하면 연결이 되지 않는다. 이유는?
> 라우팅 테이블을 연결해주지 않아서 (표지판이 필요함) 
라우터 1에 ip route 192.168.2.0 255.255.255.0 1.1.1.38 넣어주기 들어는 오는데  돌아가진 못함 
ping 192.168.2.1
192.168.2.1 icmp_seq=1 timeout
192.168.2.1 icmp_seq=2 timeout

> 라우터 2에도 넣어줘야 함 ip route 192.168.0.0 255.255.255.0 1.1.1.37에 넣어주기

라우팅을 연결하는 방법은 2가지가 존재함

라우팅 16개 연결하기 - 정적라우팅 설정법
라우터1
config t
hostname jjcom
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.0.0 255.255.255.0 1.1.1.2

라우터2
config t
hostname jjcom
interface serial1/0
ip address 1.1.1.2 255.255.255.252
no shutdown
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

라우터3
config t
hostname jjcom
interface serial1/0
ip address 2.2.2.2 255.255.255.252
no shutdown
interface serial1/1
ip address 3.3.3.1 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

라우터4
config t
hostname jjcom
interface serial1/0
ip address 3.3.3.2 255.255.255.252
no shutdown
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

라우터5
config t
hostname jjcom
interface serial1/0
ip address 4.4.4.2 255.255.255.252
no shutdown
interface serial1/1
ip address 5.5.5.1 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

라우터6
config t
hostname jjcom
interface serial1/0
ip address 5.5.5.2 255.255.255.252
no shutdown
interface serial1/1
ip address 6.6.6.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 6.6.6.2
ip route 192.168.0.0 255.255.255.0 5.5.5.1

라우터7
config t
hostname jjcom
interface serial1/0
ip address 6.6.6.2 255.255.255.252
no shutdown
interface serial1/1
ip address 7.7.7.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 7.7.7.2
ip route 192.168.0.0 255.255.255.0 6.6.6.1

라우터8
config t
hostname jjcom
interface serial1/0
ip address 7.7.7.2 255.255.255.252
no shutdown
interface serial1/1
ip address 8.8.8.1 255.255.255.252
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 7.7.7.1
ip route 192.168.1.0 255.255.255.0 8.8.8.2

라우터9
config t
hostname jjcom
interface serial1/0
ip address 8.8.8.2 255.255.255.252
no shutdown
interface serial1/1
ip address 9.9.9.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 9.9.9.2
ip route 192.168.0.0 255.255.255.0 8.8.8.1

라우터10
config t
hostname jjcom
interface serial1/0
ip address 9.9.9.2 255.255.255.252
no shutdown
interface serial1/1
ip address 10.10.10.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 10.10.10.2
ip route 192.168.0.0 255.255.255.0 9.9.9.1

라우터11
config t
hostname jjcom
interface serial1/0
ip address 10.10.10.2 255.255.255.252
no shutdown
interface serial1/1
ip address 11.11.11.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 11.11.11.2
ip route 192.168.0.0 255.255.255.0 10.10.10.1

라우터12
config t
hostname jjcom
interface serial1/0
ip address 11.11.11.2 255.255.255.252
no shutdown
interface serial1/1
ip address 12.12.12.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 12.12.12.2
ip route 192.168.0.0 255.255.255.0 11.11.11.1

라우터13
config t
hostname jjcom
interface serial1/0
ip address 12.12.12.2 255.255.255.252
no shutdown
interface serial1/1
ip address 13.13.13.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 13.13.13.2
ip route 192.168.0.0 255.255.255.0 12.12.12.1

라우터14
config t
hostname jjcom
interface serial1/0
ip address 13.13.13.2 255.255.255.252
no shutdown
interface serial1/1
ip address 14.14.14.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 14.14.14.2
ip route 192.168.0.0 255.255.255.0 13.13.13.1

라우터15
config t
hostname jjcom
interface serial1/0
ip address 14.14.14.2 255.255.255.252
no shutdown
interface serial1/1
ip address 15.15.15.1 255.255.255.252
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 15.15.15.2
ip route 192.168.0.0 255.255.255.0 14.14.14.1

라우터16
config t
hostname jjcom
interface serial1/0
ip address 15.15.15.2 255.255.255.252
no shutdown
config t
hostname jjcom
interface fastethernet0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
ip route 192.168.0.0 255.255.255.0 15.15.15.1

정적라우팅은 일일이 추가해주어야 통신이 가능함
----------------------------------------------------
동적라우팅 - 경로만 알려주면 자동으로 통신할 수 있음 30초마다 업데이트를 해줌 (224.0.0.9라는 아이피로)

[RIP 동적라우팅 설정]
거리백터라우팅프로토콜(라우터-라우터)

상태링크라우팅프로토콜
OSPF
- 중대규모 네트워크에 사용이 많이 됨
- 라우팅 정보 업데이트 224.0.0.5와 224.0.0.6의 멀티캐스트 주소 사용함
- 프로토콜 번호 89번 사용
- 경로 상태에 변화가 생기면 변화된 부분만 업데이트 진행함
- 업데이트 할 내용이 없더아도 30분 간격으로 링크 상태 재생기능을 통해 주기적으로 라우팅 업데이트 정보를 교환함

[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]
conf 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
version2
network 1.1.1.0
network 2.2.2.0

[R3]
conf t
interface serial1/0
ip address 2.2.2.2 255.255.255.252
no shutdown
exit
interface serial1/1
ip address 3.3.3.1 255.255.255.252
no shutdown
router rip
version 2
network 2.2.2.0
network 3.3.3.0

[R4]
conf 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 R5
interface fastethernet0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
interface serial1/0
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

2025 산대특