วันพฤหัสบดีที่ 21 กรกฎาคม พ.ศ. 2554

Routing Information Protocol (RIP)

RIP เป็น Routing Protocol แบบ Distance Vector โดยจะส่ง Routing Table ทั่งหมดของตัวเองให้กับเพื่อนบ้าน ทุกๆ 30 วินาที เพื่อทำการ update routing table โดยใช้งาน UPD ที่ Port 520

RIP มี 2 Version คือ

RIP Version 1 มีลักษณะดังนี้


Classful Distance Vector (DV) routing protocol
Metric = Hop count เชื่อมต่อสูงสุด 15 Hop ถ้าเกินกว่า 15 จะเป็น unreachable
Update broadcast ทุกๆ 30 วินาที
ใช้ Hold-down timer 
ใช้ Split Horizon หรือ Split Horizon with Poison Reverse
Auto Summery


RIP Version 2 มีลักษณะดังนี้


Classless Distance Vector (DV) routing protocol
Metric = Hop count เชื่อมต่อสูงสุด 15 Hop ถ้าเกินกว่า 15 จะเป็น unreachable
Update broadcast ทุกๆ 30 วินาที
ใช้ Hold-down timer 
ใช้ Split Horizon หรือ Split Horizon with Poison Reverse
Auto Summery
Support VLSM
Support CIDR
ใช้ Authentication


โดยปัจจุบันไม่มีการใช้งาน RIPv1 แล้ว


ตัวอย่าง ขั้นตอนการ config RIPv2 บน Cisco Packet Tracer


ในที่นี้จะจำลองการเชื่อมต่อ Router 3 ตัว โดยใช้ Port Serial ในการเชื่อมต่อแต่ละ Router 


ในที่นี้กำหนดให้ Roter 0 เชื่อมต่อกับ Router 1 ที่ Port Serial 0/1/0 ทั่ง 2 ฝั่ง
Router 0 เชื่อมต่อกับ Router 2 ที่ Port Serial 0/1/1 ที่ Router 0 และ Serial 0/1/0 ที่ Router 2
Router 1 เชื่อมต่อกับ Router 2 ที่ Port Serial 0/1/1 ทั่ง 2 ฝั่ง


เริ่มทำการ config ที่ router 0
พิมพ์คำสั่ง router0> enable
พิมพ์คำสั่ง router0# configuration terminal
พิมพ์คำสั่ง router0(config)# interface serial0/1/0
พิมพ์คำสั่ง router0(config-if)# ip address 192.168.1.1 255.255.255.252
พิมพ์คำสั่ง router0(config-if)# clock rate 56000 (จะดูได้อย่างไรว่าขาไหนที่ต้องทำการ config clock rate โดยให้เอา mouse ไปวางไว้บนเส้น สีแดงหรือ สาย Serial DCE มันจะแสดงPort ที่เชื่อมต่อกันโดยด้านที่มีรูป นาฬิกาให้พิมพ์คำสั่ง clock rate ส่วนด้านที่ไม่มีรูปนาฬิกาไม่ต้องทำการใส่ค่า clock rate ส่วนค่า 56000 นั้นการกำหนดซึ่ง Provider จะเป็นผู้กำหนดให้)

พิมพ์คำสั่ง router0(config-if)# no shutdown
พิมพ์คำสั่ง router0(config-if)# exit

พิมพ์คำสั่ง router0(config)# interface serial0/1/1
พิมพ์คำสั่ง router0(config-if)# ip address 192.168.3.1 255.255.255.252
พิมพ์คำสั่ง router0(config-if)# clock rate 56000
พิมพ์คำสั่ง router0(config-if)# no shutdown
พิมพ์คำสั่ง router0(config-if)# exit

พิมพ์คำสั่ง router0(config)# interface fastEthernet 0/0
พิมพ์คำสั่ง router0(config-if)# ip address 192.168.10.254 255.255.255.0
พิมพ์คำสั่ง router0(config-if)# no shutdown
พิมพ์คำสั่ง router0(config-if)# exit

ทำการ config router 1
พิมพ์คำสั่ง router1> enable
พิมพ์คำสั่ง router1# configuration terminal
พิมพ์คำสั่ง router1(config)# interface serial0/1/0
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.1.2 255.255.255.252
พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit

พิมพ์คำสั่ง router1(config)# interface serial0/1/1
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.2.1 255.255.255.252
พิมพ์คำสั่ง router0(config-if)# clock rate 56000

พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit


พิมพ์คำสั่ง router1(config)# interface fastEthernet 0/0
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.11.254 255.255.255.0
พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit

ทำการ config router 2
พิมพ์คำสั่ง router1> enable
พิมพ์คำสั่ง router1# configuration terminal
พิมพ์คำสั่ง router1(config)# interface serial0/1/0
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.3.2 255.255.255.252
พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit

พิมพ์คำสั่ง router1(config)# interface serial0/1/1
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.2.2 255.255.255.252
พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit


พิมพ์คำสั่ง router1(config)# interface fastEthernet 0/0
พิมพ์คำสั่ง router1(config-if)# ip address 192.168.12.254 255.255.255.0
พิมพ์คำสั่ง router1(config-if)# no shutdown
พิมพ์คำสั่ง router1(config-if)# exit


เมื่อทำการ config เรียบร้อยแล้ว Lineprotocol ทั่งหมดก็จะ UP ดังรูป



ต่อไปจะเป็นประกาศ routing table ของแต่ละ router
เริ่มจาก Router0
router0> enable

พิมพ์คำสั่ง router0> enable
พิมพ์คำสั่ง router0# show ip interface brief <----จะแสดงสถานะของ interface





พิมพ์คำสั่ง router0# configuration terminal
พิมพ์คำสั่ง router0(config)# router rip <----การประกาศ routing table ของตัวเองไปให้เพื่อนบ้าน
พิมพ์คำสั่ง router(config-router)# version 2 <----กำหนด version ที่ใช้งาน
พิมพ์คำสั่ง router(config-router)# network 192.168.1.0 <----ประกาศ ip ที่ตัวเองมีอยู่ไปให้เพื่อนบ้าน
พิมพ์คำสั่ง router(config-router)# network 192.168.3.0
พิมพ์คำสั่ง router(config-router)# network 192.168.10.0
พิมพ์คำสั่ง router(config-router)# no auto summary <----ปิด auto summary
พิมพ์คำสั่ง router(config-router)# exit

ทำการประกาศ routing table แบบนี้กับ router1 และ router 2
เมื่อทำการประกาศ routing table เสร็จทั่ง 3 router แล้วเรามาลองทำการตรวจสอบ ว่า routing table ที่เราประกาศออกไปนั้นเพื่อนบ้านได้รับ routing table รึเปล่าด้วยคำสั่ง show ip route


พิมพ์คำสั่ง router0# show ip route


โดยผลแสดงมีดังต่อไป 
C คือ routing table ของตัวมันเอง และอยู่บน interface ไหนของ router
R คือ routing table ของเพื่อนบ้านที่ทำการเชื่อมต่ออยู่ โดยจะแสดงค่า Administrative Distance คือ 120 เป็นค่า AD ของ RIP และ /2 ที่อยุ่หลัง 120 คือ ค่า cost , via จะบอกถึง ip address ของ hop count และ interface ของ ip address นั้น

สามารถทำการทดสอบด้วยคำสั่ง ping โดย ping ไปที่ network ของเพื่อนบ้านถ้ามีการตอบสนองกลับแสดงว่าได้ทำการประกาศ routing table สำเร็จ

จบแล้วครับลองไปหัดทำกันเล่นดู

ไม่มีความคิดเห็น:

แสดงความคิดเห็น