Cisco Switch 2950 + Cisco Router 1721 + adsl
Lab : Cisco
รูป Diagram คร่าวๆ ในpacket Tracer (เพื่อความเข้าใจ)
ที่มาของเรื่องนี้ คือ ผมได้ซื้อ router cisco 1721 มือสอง มีพอร์ตเพียง 1 port fastEthernet เเละ Switch Cisco 2950 24 port มือสอง เพื่อมาทำ lab ทดลอง วันนี้มีเวลาทำlab ใช้งานจริงในห้อง 2 ห้อง
อุปกรณ์ Network ที่ใช้
Router linksys 320n
Router Linksys Wrt54gl (ลง firmware Wrt เพื่อทำโหมด Bridge)
Router Cisco 1721
Switch Cisco 2950
client ที่เชื่อมต่อ
Nas server (Software Freenas)
MacBook
laptop
เเละ อื่นๆ
อุปกรณ์ ที่เชื่อมต่อ wireless (จะรับ ip DHCP เพื่อความสะดวกในการ join เเต่ละ access point )
Smart Phone 3 เครื่อง
Tablet 1 เครื่อง
Wireless Drive Fuel (Firmware linux ซื้อจาก Hackseagatesatellite.com)
รูป Device ต่างๆ
Code configure
เริ่มต้นโดย enable เพื่อไปconfig switch เเละ Router
สิ่งที่ต้องทำอันดับเเรกตั้ง hostname & password ต่างๆ เช่น
เปลี่ยนชื่อ hostname
enable
configuer terminal
hostname Sw1
Password enable >>> จะต้องตั้ง password เพื่อที่ตอน Remote เข้ามา enable config ได้
enable
#configure terminal >> เข้าสู่โหมด global configure
#enable password cisco
Password Line vty 0 4 >>> จะต้องตั้ง password เพื่อให้สามารถ Remote เข้ามาได้
enable
#configure terminal
#line vty 0 4
#password cisco
#login
Password Line con 0 >>> ทุกครั้งที่เสียบสาย console ด้านหลัง จะต้องทำการใส่ password
enable
#configure terminal
#line con 0
#password cisco
#login
กำหนด ip ให้กับ VLAN1 >>> เพื่อ ที่จะทำการ Remote ตั้งค่าให้ กับ Switch
SW1#configure terminal
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.2.200 255.255.255.0
คำสั่ง การ กำหนด หลายๆ port
SW1(config)#interface range fastEthernet 0/1-2
SW1(config-if-range)#no shutdown
คำสั่ง save
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
คำสั่ง access vlan 1 f0/1-8 , vlan10 9-16, vlan 20 17-24
SSW1(config)#interface range f0/2-8
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 1
คำสั่ง ตั้งชื่อ vlan
SW1(config-if)#vlan 10
SW1(config-vlan)#name server
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name User
คำสั่ง show vlan
# show vlan
#show intreface vlan 20
คำสั่ง f0/1 Trunk port ตย f0/1
SW1(config)#interface f0/1
SW1(config-if)#switchport mode trunk
การตั้งค่า ip address for Router * เเต่เราไม่ต้องตั้ง ip address ให้กับ port ที่จะทำการ vlan routing หรือ ถ้าจำเป็นต้องตั้งให้ตั้ง ip address ต่างจาก subnet ที่ต้องทำการ routing
R1#configure terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shutdown
Vlan Routing ,Inter Vlan
en
conf t
interface fastethernet 0/1
no ip address
no shutdown
exit
interface fastethernet 0/0.1
encapsulation dot1q 1
ip address 192.168.1.254 255.255.255.0
description Link-to-Vlan1
interface fastethernet 0/0.2
encapsulation dot1q 10
ip address 192.168.2.254 255.255.255.0
description Link-to-Vlan10
การตั้งค่า ip address ให้ device ต่างๆ ที่เชื่อมต่อ Vlan 1 , Vlan10, Vlan20
1 ตั้งค่า ip address เเละ subnetmask
2 ตั้ง ip default Gateway (ประตูขาออก)
รูป Diagram คร่าวๆ ในpacket Tracer (เพื่อความเข้าใจ)
ที่มาของเรื่องนี้ คือ ผมได้ซื้อ router cisco 1721 มือสอง มีพอร์ตเพียง 1 port fastEthernet เเละ Switch Cisco 2950 24 port มือสอง เพื่อมาทำ lab ทดลอง วันนี้มีเวลาทำlab ใช้งานจริงในห้อง 2 ห้อง
อุปกรณ์ Network ที่ใช้
Router linksys 320n
Router Linksys Wrt54gl (ลง firmware Wrt เพื่อทำโหมด Bridge)
Router Cisco 1721
Switch Cisco 2950
client ที่เชื่อมต่อ
Nas server (Software Freenas)
MacBook
laptop
เเละ อื่นๆ
อุปกรณ์ ที่เชื่อมต่อ wireless (จะรับ ip DHCP เพื่อความสะดวกในการ join เเต่ละ access point )
Smart Phone 3 เครื่อง
Tablet 1 เครื่อง
Wireless Drive Fuel (Firmware linux ซื้อจาก Hackseagatesatellite.com)
รูป Device ต่างๆ
![]() |
| show Run เเสดง การทำ Vlan Routing ใน router 1721 |
![]() |
| Show Vlan เเสดง vlan ต่างๆ |
| รูปนี้ทดลอง ping ข้าม vlan ผ่าน IPhone โดยที่ Iphone เชื่อมต่ออยู่กับ access point 2 |
![]() |
| ก่อนทำ lab จริงผมได้ทดลอง ใน packet tracer การ เเบ่ง vlan เเละ ลอง Routing |
Code configure
เริ่มต้นโดย enable เพื่อไปconfig switch เเละ Router
สิ่งที่ต้องทำอันดับเเรกตั้ง hostname & password ต่างๆ เช่น
เปลี่ยนชื่อ hostname
enable
configuer terminal
hostname Sw1
Password enable >>> จะต้องตั้ง password เพื่อที่ตอน Remote เข้ามา enable config ได้
enable
#configure terminal >> เข้าสู่โหมด global configure
#enable password cisco
Password Line vty 0 4 >>> จะต้องตั้ง password เพื่อให้สามารถ Remote เข้ามาได้
enable
#configure terminal
#line vty 0 4
#password cisco
#login
Password Line con 0 >>> ทุกครั้งที่เสียบสาย console ด้านหลัง จะต้องทำการใส่ password
enable
#configure terminal
#line con 0
#password cisco
#login
กำหนด ip ให้กับ VLAN1 >>> เพื่อ ที่จะทำการ Remote ตั้งค่าให้ กับ Switch
SW1#configure terminal
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.2.200 255.255.255.0
คำสั่ง การ กำหนด หลายๆ port
SW1(config)#interface range fastEthernet 0/1-2
SW1(config-if-range)#no shutdown
คำสั่ง save
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
คำสั่ง access vlan 1 f0/1-8 , vlan10 9-16, vlan 20 17-24
SSW1(config)#interface range f0/2-8
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 1
คำสั่ง ตั้งชื่อ vlan
SW1(config-if)#vlan 10
SW1(config-vlan)#name server
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name User
คำสั่ง show vlan
# show vlan
#show intreface vlan 20
คำสั่ง f0/1 Trunk port ตย f0/1
SW1(config)#interface f0/1
SW1(config-if)#switchport mode trunk
การตั้งค่า ip address for Router * เเต่เราไม่ต้องตั้ง ip address ให้กับ port ที่จะทำการ vlan routing หรือ ถ้าจำเป็นต้องตั้งให้ตั้ง ip address ต่างจาก subnet ที่ต้องทำการ routing
R1#configure terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shutdown
Vlan Routing ,Inter Vlan
en
conf t
interface fastethernet 0/1
no ip address
no shutdown
exit
interface fastethernet 0/0.1
encapsulation dot1q 1
ip address 192.168.1.254 255.255.255.0
description Link-to-Vlan1
interface fastethernet 0/0.2
encapsulation dot1q 10
ip address 192.168.2.254 255.255.255.0
description Link-to-Vlan10
การตั้งค่า ip address ให้ device ต่างๆ ที่เชื่อมต่อ Vlan 1 , Vlan10, Vlan20
1 ตั้งค่า ip address เเละ subnetmask
2 ตั้ง ip default Gateway (ประตูขาออก)
![]() |
| รูปนี้ให้สั่งเกตุ ip address เเละ Gateway |





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