วันพุธที่ 22 เมษายน พ.ศ. 2558

เรียนรู้พื้นฐานการกำหนด เส้นทางแบบ Static

ในส่วนบทความนี้เราจะเรียนรู้พื้นฐานการกำหนด เส้นทางแบบ Static 
โดย http://www.prasansoft.com
เพื่อให้ Router สามารถสื่อสารกัับเครื่อข่ายผ่าน subnet ที่ต่างกันได้ 

Diagram Network เราจะทำการเชื่อมต่อ Router1 , Router2 , Router3 

และทำการกำหนดเส้นทาง การเชื่อมต่อของเครือข่ายแบบ static 




เราจะใช้ command เบื้องต้นเพื่อให้ router สื่อสารแบบ static ในการทดลองนี้ดังนี้ 

สถานะ promt ของ Routerคำสั่งที่ใช้ในในการทดลองนี้ความหมายของคำสั่ง
Router>enableเข้าไปยัง Router
Router#configure terminalเข้าสู่โหมด privilege
Route
r(config)#
interface fastethernet0/0ทำงานกับ interface fastethernet port0/0
(ต้องดำเนินการกำหนดค่า config ให้กับ router ทั้ง 3)
Router
(config-if)#
ip address 192.168.1.1
255.255.255.0
กำหนด Ip address ให้กับ port interface
fastethernet 0/0 มีค่าเท่ากับ 192.168.1.1
subnet mask 255.255.255.0
(ต้องดำเนินการกำหนดค่า config ให้กับ router ทั้ง 3 เป็น IP ประจำ interface fastethernet)
Router
(config-if)#
no shutกระตุ้นหรือการเปิดการทำงานของ interface
(ต้องดำเนินการกำหนดค่า config ให้กับ router ทั้ง 3)
Router
(config-if)#
interface serial 0/1กำหนด IP address ประจำ port
interface serial port0/1 ของ WAN
(ต้องดำเนินการกำหนดค่า config ให้กับ router ทั้ง 3)
Router
(config-if)#
ip address 10.82.1.1
255.255.255.0
ค่า Wan Ip address ที่กำหนดให้WAN
(ต้องดำเนินการกำหนดค่า config ให้กับ router ทั้ง 3)
Router
(config-if)#
clock rate 64000กำหนด clock rate สำหรับ router (CDE)
Router
(config-if)#
no shutกระตุ้นหรือการเปิดการทำงานของ interface
(ต้องดำเนินการกระตุ้น ให้กับ router ทั้ง 3)
Router1
(config)#
ip route 192.168.2.0
255.255.255.0
10.82.1.2
ทำการกำหนดเส้นทางการสื่อสารของ
Router 1 เพื่อให้ติดต่อกับ network ID
192.168.2.0 โดยผ่านประตูทางเข้า
10.82.1.2 ของ Router 2
เพื่อให้ Router 1 --> Router 2
Router1
(config)#
ip route 192.168.3.0
255.255.255.0
10.82.1.2
ทำการกำหนดเส้นทางการสื่อสารของ
Router 1 เพื่อให้ติดต่อกับ network ID
192.168.3.0 โดยผ่านประตูทางเข้า
10.82.1.2 ของ Router 2
เพื่อให้ Router 1 --> Router 3
Router2
(config)#
ip route 192.168.1.0
255.255.255.0
10.82.1.1
ทำการกำหนดเส้นทางการสื่อสารของ
Router 2 เพื่อให้ติดต่อกับ network ID
192.168.1.0 โดยผ่านประตูทางเข้า
10.82.1.1 ของ Router 1
เพื่อให้ Router 2 --> Router 1
Router2
(config)#
ip route 192.168.3.0
255.255.255.0
10.82.2.2
ทำการกำหนดเส้นทางการสื่อสารของ
Router 2 เพื่อให้ติดต่อกับ network ID
192.168.3.0 โดยผ่านประตูทางเข้า
10.82.2.2 ของ Router 3
เพื่อให้ Router 2 --> Router 3
Router3
(config)#
ip route 192.168.1.0
255.255.255.0
10.82.2.1
ทำการกำหนดเส้นทางการสื่อสารของ
Router 3 เพื่อให้ติดต่อกับ network ID
192.168.1.0 โดยผ่านประตูทางเข้า
10.82.2.1 ของ Router 3
เพื่อให้ Router 3 --> Router 1
Router3
(config)#
ip route 192.168.2.0
255.255.255.0
10.82.2.1
ทำการกำหนดเส้นทางการสื่อสารของ
Router 3 เพื่อให้ติดต่อกับ network ID
192.168.2.0 โดยผ่านประตูทางเข้า
10.82.2.1 ของ Router 3
เพื่อให้ Router 3 --> Router 2



คำสั่งที่เราต้องการเปิดให้ Router ทั้ง 3 มีขั้นตอนพื้นฐานดังนี้
การ Configure ที่ router 1

Router>
Router>enableRouter#
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#hostname Router1Router1(config)#
Router1(config)#interface fastethernet0/0Router1(config-if)#
Router1(config-if)#ip address 192.168.1.1 255.255.255.0Router1(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router1(config-if)#exitRouter1(config)#
Router1(config)#interface serial0/0 Router1(config-if)#
Router1(config-if)#ip address 10.82.1.1 255.255.255.0Router1(config-if)#clock rate 64000Router1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
Router1(config-if)#
Router1(config-if)#exit
Router1(config)#
Router1(config)#ip route 192.168.2.0 255.255.255.0 10.82.1.2Router1(config)#ip route 192.168.3.0 255.255.255.0 10.82.1.2Router1(config)#
Router1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router1#
Router1#
Router1#write memory
Building configuration...
[OK]
Router1#
Router1#

การ Configure ที่ router 2
Router>
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#hostname Router2Router2(config)#
Router2(config)#interface fastethernet0/0Router2(config-if)#
Router2(config-if)#ip address 192.168.2.1 255.255.255.0Router2(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router2(config-if)#
Router2(config-if)#exitRouter2(config)#
Router2(config)#interface serial 0/0Router2(config-if)#ip address 10.82.1.2 255.255.255.0Router2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
Router2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router2(config-if)#
Router2(config-if)#exit
Router2(config)#
Router2(config)#interface serial0/1Router2(config-if)#
Router2(config-if)#ip address 10.82.2.1 255.255.255.0Router2(config-if)#clock rate 64000Router2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/1, changed state to down
Router2(config-if)#
Router2(config-if)#exitRouter2(config)#
Router2(config)#ip route 192.168.1.0 255.255.255.0 10.82.1.1Router2(config)#ip route 192.168.3.0 255.255.255.0 10.82.2.2Router2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router2#
Router2#write memory
Building configuration...
[OK]
Router2#
Router2#
การ Configure ที่ router 3

Router>enable Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#hostname Router3Router3(config)#
Router3(config)#interface fastethernet0/0
Router3(config-if)#ip address 192.168.3.1 255.255.255.0Router3(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router3(config-if)#
Router3(config-if)#
Router3(config-if)#exitRouter3(config)#
Router3(config)#
Router3(config)#interface serial0/0 Router3(config-if)#ip address 10.82.2.2 255.255.255.0 Router3(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
Router3(config-if)#
Router3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router3(config-if)#
Router3(config-if)#
Router3(config-if)#exitRouter3(config)#
Router3(config)#ip route 192.168.1.0 255.255.255.0 10.82.2.1Router3(config)#ip route 192.168.2.0 255.255.255.0 10.82.2.1Router3(config)#
Router3(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Router3#
Router3#write memory
Building configuration...
[OK]
Router3#
Router3#


ตรวจสอบสถานะการ COnfiguration IP Address ของ Router1,Router2,Router3


ด้วยการใช้คำสั่ง Show Ip interface brief


ทำการทดลอง การเชื่อมต่อด้วย Diagram ในที่นี้ สามารถทดสอบได้

ด้วยการ Ping จาก Network ID 192.168.1.0,192.168.2.0,192.168.3.0


ทดสอบด้วย การ Ping Command ของ 192.168.1.2 ซึ่งเชื่อมต่อที่ router 1
ไปยัง client ของ Router 2



ทดสอบด้วย การ Ping Command ของ client 192.168.1.2 ซึ่งเชื่อมต่อที่ router 1
ไปยัง client 192.168.3.2ของ Router 3 ผลลัพธ์มีการตอบกลับแสดงว่าเส้นทางถูกต้อง



ทดสอบด้วย การ Ping Command ของ client 192.168.2.2 ซึ่งเชื่อมต่อที่ router 2
ไปยัง client 192.168.1.2ของ Router 1 ผลลัพธ์มีการตอบกลับแสดงว่าเส้นทางถูกต้อง



ทดสอบด้วย การ Ping Command ของ client 192.168.2.2 ซึ่งเชื่อมต่อที่ router 2
ไปยัง client 192.168.3.2ของ Router 3 ผลลัพธ์มีการตอบกลับแสดงว่าเส้นทางถูกต้อง



โดย http://www.prasansoft.com/Main-Cisco-network.php

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

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