หน้าเว็บ

วันอังคารที่ 23 ธันวาคม พ.ศ. 2557

วิธีการปิดกั้น Unknown Unicast , DHCP Snooping กับ Dynamic ARP Inspection

วิธีการปิดกั้น Unknown Unicast
https://www.facebook.com/virintr/photos/pcb.427982014012340/427981194012422/?type=1

เมื่อใดที่ Switch ได้รับเฟรมข้อมูลซึ่งระบุจุดหมายปลายทางที่ไม่ได้มีอยู่ในตาราง MAC Address ของ Switch แล้ว ตัว Switch จะมีพฤติกรรม ส่งกระจายออกไปยังทุกๆ Port ในลักษณะท่วมท้นไปทุกๆ Port ที่มีอยู่ รวมทั้ง Port อันเป็นเส้นทางที่เชื่อมต่อกับ Switch ตัวอื่นๆ และทั้งหมดที่เชื่อมต่อกัน ลักษณะเช่นนี้ จะส่งผลเสียต่อเครือข่าย เนื่องจากจะมีปริมาณของเฟรมข้อมูลที่ไม่จำเป็นเพิ่มขึ้น รบกวนต่อการใช้แบนด์วิธของเครือข่าย
ลักษณะเช่นนี้ แม้จะมีพฤติกรรมที่คล้ายกับการทำงานของ Broadcast แต่ข้อเท็จจริง เป็นเพียงการส่ง เฟรมแบบ Unicast (เฟรมที่ระบุผู้รับโดยตรง ต่างกันตรงที่เฟรมของ Broadcast ไม่ระบุผู้รับโดยตรง)
เพื่อที่จะหลีกเลี่ยงปัญหาดังกล่าว ท่านสามารถจัดคอนฟิกบน Switch ของ Cisco เพื่อให้สามารถปิดกั้นกระแสจราจร ประเภท Unicast หรือ Multicast ซึ่งปลายทาง เป็นผู้รับที่ไม่มีตัวตน และเหตุการณ์ในลักษณะนี้ สามารถเกิดขึ้นได้ตามปกติ ในกรณีที่เครื่องคอมพิวเตอร์ที่ท่านติดต่อด้วย เกิดปิดเครื่องและออกจากเครือข่ายไป หรือด้วยเหตุผลเครื่องมีปัญหา นอกจากนี้ ยังมีความเป็นไปได้ที่จะเกิดการคุกคามเครือข่าย ด้วยหวังผลว่าจะทำให้เครือข่ายเต็มไปด้วยกระแสจราจร ที่ไม่จำเป็นและส่งผลให้ประสิทธิภาพลดลง การติดตั้งกระบวนการปิดกั้นดังกล่าว สามารถทำได้โดยกำหนด Port ที่ต้องการจะปิดกั้นการจราจรดังกล่าว ด้วยคำสั่ง ดังนี้
Switch(config-if)# switchport block unicast
Switch(config-if)# switchport block multicast
มีผู้สงสัยว่า การปิดกั้น Multicast เช่นนี้อาจส่งผลต่อการทำงานของ IGMP Snooping แต่มีข้อเท็จจริงสำหรับ Switch รุ่น Catalyst 3560 ระบุไว้ว่า “มีเพียง กระแสจราจรของ Multicast ที่ทำงานภายใน Layer 2 เท่านั้นที่จะถูกปิดกั้น แต่ Packet แบบ Multicast ที่ประกอบด้วยข่าวสาร IPv4 และ IPv6 เท่านั้น ที่จะไม่ถูกปิดกั้น จากการทดสอบพบว่า ถึงแม้ว่าในระบบจะไม่มีการทำงานของ IGMP Snooping ก็ตาม Multicast packet ที่ทำงานบน IPv4 หรือ IPv6 ไม่ได้ถูกปิดกั้นแต่อย่างไร
***********************************************
DHCP Snooping กับ Dynamic ARP Inspection
DHCP Snooping เป็นคุณลักษณะการทำงานของ Catalyst Switch ที่จะตรวจสอบกระแสจราจรของ DHCP ที่วิ่งบน Switch ในระดับ Layer 2 และติดตามดูว่าไอพีแอดเดรสใดที่ DHCP Server แจกจ่ายให้กับเครื่องคอมพิวเตอร์ของ Client และแจกไปให้ Client บน Port ใดบ้าง ข่าวสารนี้ ให้ประโยชน์ต่อการ Troubleshooting เป็นอย่างมาก แต่ทั้งหมดนี้ จะสามารถทำงานได้อย่างสมบูรณ์ก็ต่อเมื่อมีการใช้ IP Source Guard และ Dynamic ARP Inspection
วิธีการติดตั้ง
ประการแรก ท่านจะต้อง Enable การทำงานของ DHCP Snooping โดยให้ Enable m Global Configuration Mode รวมทั้งในแต่ละ VLAN ที่มีอยู่
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 10
Switch(config)# ^Z
หลังจากติดตั้งแล้ว ท่านสามารถใช้คำสั่ง show ip dhcp snooping เพื่อดูว่าค่าที่ท่านจัดตั้งนั้น เข้าไปสู่ระบบเรียบร้อยแล้วหรือยัง ?
Switch# show ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs: 10
DHCP snooping is operational on following VLANs: 10
DHCP snooping is configured on the following L3 Interfaces:
Insertion of option 82 is enabled
circuit-id format: vlan-mod-port
remote-id format: MAC
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Verification of giaddr field is enabled
DHCP snooping trust/rate is configured on the following Interfaces:
Interface Trusted Rate limit (pps)
------------------------ ------- ----------------
จากตัวอย่างนี้ Switch ที่ใช้เป็นแบบ Multilayer Switch (Switch ที่ทำงานบน Layer 2/3) ทำหน้าที่ถ่ยทอดการร้องขอ DHCP จาก Client ไปที่ DHCP Server บนเครือข่าย ซึ่งพฤติกรรมการทำงานเช่นนี้ ทำได้โดยเพิ่มคำสั่ง ip helper-address ภายใต้ Access VLAN interface อย่างไรก็ตาม หาก Switch ที่ใช้ทำงานในระดับ Layer 2 เท่านั้น ท่านอาจต้องกำหนดให้ อินเตอรเฟสของ Uplink ให้เป็น Trusted Mode โดยการกำหนดคำสั่ง ip dhcp snooping trust ให้กับอินเตอรเฟสที่ทำงานในระดับ layer 2 คำสั่งนี้จะเป็นการบอกให้ Switch รู้ว่า การตอบสนองการขอรับไอพีแอดเดรสจาก Client จะต้องเกิดขึ้นที่ Port นี้
Client ที่ทำงานบนเครือข่าย จะได้รับไอพีแอดเดรสจาก Port ที่ถูกกำหนดให้เป็น Trust นอกจากนี้ หมายเลขไอพีแอเดรส รวมทั้ง DHCP Client จะไปปรากฏบนตาราง DHCP Snooping Binding Table บน Switch ดังนี้
Switch# show ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
--------------- --------------- ---------- ------------- ---- --------
00:19:AA:7D:E6:88 192.168.10.2 86250 dhcp-snooping 10 FastEthernet0/3
Total number of bindings: 1
ต่อไป ท่านจะต้อง Enable dynamic ARP inspection ให้กับ VLAN (เมื่อมีการ Enable ให้กับหลายๆ VLAN ท่านสามารถกำหนดพิกัด (Range) ของ VLAN ได้)
Switch(config)# ip arp inspection vlan 10
Switch(config)# ^Z
Switch# show ip arp inspection
Source Mac Validation : Disabled
Destination Mac Validation : Disabled
IP Address Validation : Disabled
Vlan Configuration Operation ACL Match Static ACL
---- ------------- --------- --------- ----------
10 Enabled Active
Vlan ACL Logging DHCP Logging Probe Logging
---- ----------- ------------ -------------
10 Deny Deny Off
Vlan Forwarded Dropped DHCP Drops ACL Drops
---- --------- ------- ---------- ---------
10 0 0 0 0
Vlan DHCP Permits ACL Permits Probe Permits Source MAC Failures
---- ------------ ----------- ------------- -------------------
10 0 0 0 0
Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data
---- ----------------- ---------------------- ---------------------
10 0 0 0
โปรดสังเกตจากข้อมูล Output จากตัวอย่างข้างบน จะเห็นว่า MAC Address ต้นทาง MAC Address ปลายทาง ได้ระบุว่า Disable ท่านสามารถ Enable กระบวนการตรวจสอบหลายๆแบบได้ ด้วยคำสั่ง ip arp inspection เพื่อให้ Switch สามารถดำเนินการตรวจสอบ MAC Address ต้นทางและปลายทาง รวมถึงไอพีแอดเดรส
ตอนนี้ สมมตว่า ผู้บุกรุกมีการเชื่อมต่อเข้ามาที่ VLAN 10 บน FastEthernet0/5 และเริ่มส่ง Gratuitous ARP Reply (Gratuitous ARP ถูกนำมาใช้เมื่อคอมพิวเตอร์ต้องการอัพเดทข้อมูล ARP Table ในเครื่องคอมพิวเตอร์อื่น มีการตรวจสอบไอพีแอเดรสที่ซ้ำกัน) ออกมา ตัว Switch จะตรวจสอบ ARP Packet เหล่านี้ และไม่สามารถตรวจพบในตาราง DHCP Snooping สำหรับแอดเดรสต้นทาง 192.168.10.1 บน Port ของ FastEthernet0/5 ดังนั้นจะดำเนินการละทิ้ง Packet เหล่านี้ จากนั้นจะแสดงข่าวสาร ดังนี้
%SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Fa0/5, vlan 10.
([0013.6050.acf4/192.168.10.1/ffff.ffff.ffff/192.168.10.1/05:37:31UTC Mon Mar 1 1993])
ท่านสามารถแสดงดูจำนวนของ Packet ที่ถูกละทิ้งไปด้วยคำสั่งต่อไปนี้
Switch# show ip arp inspection
Source Mac Validation : Disabled
Destination Mac Validation : Disabled
IP Address Validation : Disabled
Vlan Configuration Operation ACL Match Static ACL
---- ------------- --------- --------- ----------
10 Enabled Active
Vlan ACL Logging DHCP Logging Probe Logging
---- ----------- ------------ -------------
10 Deny Deny Off
Vlan Forwarded Dropped DHCP Drops ACL Drops
---- --------- ------- ---------- ---------
10 22 2 2 0
Vlan DHCP Permits ACL Permits Probe Permits Source MAC Failures
---- ------------ ----------- ------------- -------------------
10 22 0 0 0
Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data
---- ----------------- ---------------------- ---------------------
10 0 0 0
ข้อควรระวัง
หาก DHCP Server ถูกติดตั้งบนเราเตอร์และเชื่อมต่อเข้ากับ Switch ระดับ Layer 2 ท่านจะได้เห็นข่าวสารเกี่ยวกับความผิดพลาดเกิดขึ้น หากท่านติดตั้งคำสั่ง Debug บนการทำงานของ DHCP Server คำสั่งคือ debug ip dhcp server packet
DHCPD: inconsistent relay information.
DHCPD: relay information option exists, but giaddr is zero.

วันพฤหัสบดีที่ 18 ธันวาคม พ.ศ. 2557

Brocade Virtual Cluster Switching (VCS) fabrics

Brocade Virtual Cluster Switching (VCS) fabrics
Brocade Network OS

ด้านการจัดการ
คือ การขยายขีดความสามารถในการดำเนินงานของการใช้งานคลาวด์ที่มีขนาดใหญ่มากหรือแบบไดนามิก
fabrics หลายโหนด
สามารถจัดการได้โดย logical เดียวและ fabrics สามารถใช้งานได้อย่างง่ายดายและนำไปใช้งานอีกครั้ง
ในความหลากหลายของการกำหนดค่าปรับให้เหมาะสมกับความต้องการของปริมาณงานโดยเฉพาะอย่างยิ่ง

ความยืดหยุ่นสูง
ใช้ hardware-based Inter-Switch Link (ISL) Trunking เพื่อทำ automatic link fail over โดยการเชื่อมโยงไม่หยุดชะงัก


การใช้ประโยชน์ เครือข่ายที่ดีขึ้น
-  Transparent Interconnection of Lots of Links (TRILL)  เป็น based Layer 2 routing service ที่ทำ equal-cost multipaths ใน Network
-  Fully load-balanced Layer 3 gateways  เพื่อลดข้อจำกัดบน Layer 2 domain ที่มากขึ้น
-  สามารถทำ inter-VLAN routing ภานใน Fabric
-  Virtual Router Redundancy Protocol (VRRP) ขจัด เรื่อง single point of failure ที่ใช้ใน สถานะการ Default-Route

Server virtualization
Automatic Migration of Port Profile (AMPP) เป็น ฟังก์ชั่นของการกำหนดค่า Policy ให้เครือข่ายใน Fabric
ต่อพอร์ตและช่วยให้คุณสมบัติของเครือข่ายระดับ
สนับสนุนเครื่องเสมือน (VM) การเคลื่อนไหว

Network convergence
Data Center Bridging (DCB) เป็น based lossless Ethernet service ซึ่งทำการแยกระหว่าง IP และ Storage traffic บนโครงสร้าง  Network
ด้วย Multi-hop Fibre Channel over Ethernet (FCoE) ให้ FCoE initiator ได้ communicate ด้วย FCoE target

Brocade VCS Fabric terminology คำศัพท์

Edge ports =  พอร์ตของสวิทช์ที่ใช้ในการเชื่อมต่ออุปกรณ์ ภายนอก รวมถึง สวิทช์และเราเตอร์ ตัวปลายๆ

Ethernet fabric = Flat Network topologically ของ  Ethernet Switch กับการ shared intelligence

Fabric ports = ports บน ทั้ง end of an Inter-Switch Link (ISL) ในหนึ่ง Ethernet fabric

Inter-Switch Link (ISL) = interface ที่ connected ระหว่าง switches ใน VCS fabric หนึ่งๆ,  ports บน ทั้ง end of the interface เรียกว่า ISL ports หรือ Fabric ports. ISL สามารถเป็น a single link หรือ trunk links ก็ได้

RBridge =  physical switch ในหนึ่ง  VCS fabric.

RBridge ID = unique ID สำหรับ RBridge แต่ละ switch จะมี หนึ่ง unique RBridge ID

VCS ID  = unique ID สำหรับ VCS fabric โดย default VCS ID = 1 ทุก switches ใน VCS fabric หนึ่งๆ
จะต้องมี VCS ID เดียวกัน.

WWN = World Wide Name. เป็น globally unique ID ซึ่งถูก burned อยู่ใน switch ตั้งแต่โรงงาน เหมือน MAC Address


ความรู้เบื้องต้นเกี่ยวกับเทคโนโลยี Brocade VCS Fabric

Brocade VCS Fabric technology เป็น  technology Ethernet แบบหนึ่ง ที่ช่วยให้คุณสามารถสร้าง flatter, virtualized, และ converged data center networks.









วันพฤหัสบดีที่ 11 ธันวาคม พ.ศ. 2557

VRRP and VRRP-E

Virtual Router Redundancy Protocol

ทำงานในการ redundant ในการ route ภานใน วง LAN สามารถสลับเส้นทาง โดย host ไม่จำเป็นต้องเปลี่ยน IP หรือ MAC ของ Gateway การ Config สามารถทำงานได้เลยไม่จำเป็นต้อง Reload

ตัวอย่าง Host 1 ชี้ Gatewayไปที่ Switch 1 หาก Switch 1 down Host 1 จะไม่สามารถออก Internet ได้


VRRP: Host 1 ชี้ Gateway ไปที่ VRID 1 ซึ่งเป็น IP ที่กำหนดไว้ทั้ง 2 ฝั่ง เป็น Master และ Backup (Priority ; 255 = 255 Master, 100 = 100 Backup) ซึ่งใช้เป็น Gateway ของ Host 1


Virtual router MAC address
เมื่อ configure a VRID software automatically assigns its MAC address
ถ้า Master Fail ตัว Backup จะ Forward traffic ไปยัง VRID MAC ซื่ง Host เชื่อว่า MACนี้เป็น Interface gateway
อย่างไรก็ตาม Backup จะไม่ response Ping เพราะ IP เป็นของ Master ถ้า Master Fail IP ก็ไม่มีด้วย

Master negotiation
VRRP ใช้ Priority ในการกำหนด Master/Backup (Priority : 1-255, โดย 255 เป็น สูงสุด)

Hello messages
Hello messages to IP Multicast address 224.0.0.18 

Master and Owner backup routers
ถ้า Master กลับมาทำงานได้ใหม่ traffic จะกลับมาทำงานที่ mAster

Track ports and track priority
เป็นการ Monitor สถานะของ Interface port ในส่วนอื่น ของเส้นทางเส้นทางผ่านเราเตอร์
จากรูปข้างบน
ถ้าเรา Config interface e1/6 to track the state of interface e2/4, คือ Master = 1/6 ตรวจสอบ Port 2/4
ถ้า Interface 2/4 down. Interface 1/6 จะทำการ ลด Priority ลง เช่น จาก 255 -> 20 และ Master Hello messages จะกลายเป็น Backup แทน

VRRP-E overview
ความต่างของ VRRP กับ VRRP-E คือ Router ทุกตัวเป็น Backup หมด ไม่มี Master router
ข้อแตกต่าง ด้านต่างๆ

Owners and Backup routers
VRRP จะต้องมี 1xMaster และ (1+N)Backup Router , IP ที่ Config เป็น iP VRID จริงบน Master, และ ต้องมี VRID เหมือนกัน บน Backup Router
VRRP-E Router ทุกตัวสามารถมี VRID ได้ Priority ตัวไหนสูงสุดเป็น master

VRRP ต้องการ VRID’s IP address ที่เป็น real IP address config บน

VRID's interface บน Master Owner. ในขณะที่ VRRP-E ไม้ต้อง


VRRP-E ใช้  
UDP port number is 8888 
Hello messages to IP Multicast address =224.0.0.2

Track ports and track priority
VRRP-E จะลด priority ลงเมื่อ Interface link down เช่น ถ้า VRRP-E interface
priority เป็น 200 และ tracked interface ด้วย track priority 20 goes down ,Software จะลด VRRP-E interface priority ลง เป็น 200-20 =180




จากรูปเป็นการทำ Load sharing รวมทั้ง redundant เส้นทางให้กับ Host

Switch 1 เป็น Master router ของ VRID 1 (backup priority = 110)
Switch 2 เป็น  Backup router ของ VRID 1 (backup priority = 100)
Switch 1 และ Switch 2  track  uplinks(2/4,3/2) ไปยัง Internet

จุดสังเกตุ Host 1,2 Gateway ชี้ VRID 1 = 192.53.5.254
ถ้า Uplink บน switch 1 fail , Backup Priority บนตัวมันจะลดไป 20 (110-20= 90) ซึ่งน้อยกว่า VRID 1 ของ Backup ดังนั้น traffic ที่วิ่งไป Internet จะวิ่งผ่าน Switch 2 แทน

ในทำนองเดียวกัน


Switch 2 เป็น Master router ของ VRID 2 (backup priority = 110)
Switch 1 เป็น  Backup router ของ VRID 2 (backup priority = 100)
Switch 1 และ Switch 2  track  uplinks (2/4,3/2) ไปยัง Internet

จุดสังเกตุ Host 3,4 Gateway ชี้ VRID 1 = 192.53.5.253
ถ้า Uplink บน switch 2 fail , Backup Priority บนตัวมันจะลดไป 20 (110-20= 90) ซึ่งน้อยกว่า VRID 2 ของ Backup ดังนั้น traffic ที่วิ่งไป Internet จะวิ่งผ่าน Switch 1 แทน

พฤติกรรม ARP กับ VRRP-E
source MAC address request sent โดย VRRP-E Master router ซึ่งเป็นVRRP-E virtual MAC address.
เมื่อ Router ส่ง ARP Requesr/Reply Packet  ผู้ส่ง