You Can If You Think You Can >
Mr.Jodoi say

" โจดอยทำได้คุณก็ต้องทำได้ "

นายเกรียงศักดิ์ นามโคตร (อาจารย์ดอย)

ผู้ก่อตั้ง บริษัทโจดอย ไอทีแอนด์เซอร์วิส จำกัด ปัจจุบันดำรงตำแหน่งกรรมการผู้จัดการบริษัทโจดอย ไอทีแอนด์เซอร์วิส จำกัดและเป็นวิทยากรบรรยายพิเศษให้กับหน่วยงานทั้งภาครัฐและเอกชน

Certifications :
- CCNA (Cisco Certify Nework Associate)
- CCNA Security (Cisco Certified Network Associate Security)
- CCDA (Cisco Certified Design Associate)
- Cisco Express Foundation Design Specialist
- CCNP (Cisco Certified Network Professional)
- CCDP (Cisco Certified Design Professional)
- SBCSEN , SBCSAM , SMBAM , SMBEN , CQS-SMBE from Cisco SMB University
- CompTIA Linux+
- CompTIA Security+
- Pearson VUE Certified Administrator

More

--------------------------------------------------------------------

Basic Network Command by Mr.Jodoi

มาเรียนรู้การใช้ Network Command เบื้องต้นกันนะครับ ขอแนะนำ command ping และ command traceroute จากวีดีโอที่อาจารย์เกรียงศักดิ์ นามโคตร (อาจารย์ดอย) ทำไว้ใน youtube ครับ


IP Address version 4 ตอนที่ 1 by Jodoi

มาเรียนรู้การคำนวณ IP Address version 4 ด้วยเทคนิคการใช้ตารางมหัศจรรย์ซึ่งทำให้ศิษย์นำไปใช้ในการทำงานและการสอบ Cert.IT ได้อย่างดีเยี่ยม

Basic Linux Command ตอนที่ 1 (ls,cat,vi)by Jodoi

มาเรียนรู้การใช้ Linux Command เบื้องต้นกันครับ เริ่มต้นด้วย command ls , cat และ vi ซึ่งปัจจุบันมีความจำเป็นต้องเรียนรู่อย่างยิ่งเพราะหลายๆองค์กรมีการใช้ Linux Server กันมากขึ้น

 

และยังมีวีดีโอดีๆอีกมากมายรับชมได้ใน แชลแนล Mr.Jodoi ตามด้านล่างนะครับ

https://www.youtube.com/user/MrJodoi

 




ACL on CISCO Router

มาแก้ไข ACL บน Router CISCO กันครับ 

ก่อนจะพูดถึงการแก้ไข ACL บน Router CISCO ควรจะรู้ก่อนเบื้องต้นว่า ACL (Access Control List ) แบ่งเป็น 2 ประเภทคือ แบบ Standard ACL และ แบบ Extended ACL โดย Standard ACL สนใจเฉพาะ source address เท่านั้น ส่วน Extended ACL สนใจ source และ destination address รวมถึง ต้องระบุ protocols และ applications ให้ถูกต้องด้วย

ส่วนการ Config บน Router CISCO นั้น Config ได้ 2 แบบคือ แบบ Numbered ACLs และแบบ Named ACLs

### Standard ACL (1-99) ###########################################
(config)#access-list(1-99)(permit,deny)(Source-IP)(Wildcard-Mask)
#################################################################
ตัวอย่างการ Config Standard ACL

1)ประกาศ ACL
R1(config)#access-list 1 deny 192.168.2.200 0.0.0.0
R1(config)#access-list 1 deny host 192.168.2.2
R1(config)#access-list 1 deny 192.168.2.100 0.0.0.3
R1(config)#access-list 1 permit any

R1(config)#access-list 1 deny any ( ปิดท้ายเสมอ ไม่ต้องพิมพ์ )
(implicit deny all - not visible in the list)
(access-list 1 deny 0.0.0.0 255.255.255.255)

2)Enable ACL ที่ INterface
R1(config)#interface f0/1
R1(config-if)#ip access-group 1 in

ทดสอบผล

R3#ping 1.1.1.1
!!!!!

C:\Users\jodoi>ping 192.168.2.254
Reply from 192.168.2.254: Destination net unreachable.
Reply from 192.168.2.254: Destination net unreachable.
Reply from 192.168.2.254: Destination net unreachable.
Reply from 192.168.2.254: Destination net unreachable.

PC1> ping 1.1.1.1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=33.048 ms
84 bytes from 1.1.1.1 icmp_seq=2 ttl=254 time=45.638 ms
84 bytes from 1.1.1.1 icmp_seq=3 ttl=254 time=33.206 ms
84 bytes from 1.1.1.1 icmp_seq=4 ttl=254 time=46.520 ms

 

R1#show ip access-lists
Standard IP access list 1
20 deny 192.168.2.2 (15 matches)
10 deny 192.168.2.200 (474 matches)
30 deny 192.168.2.100, wildcard bits 0.0.0.3
40 permit any (10 matches)

### Extended ACL (100-199) ########################################
(config)#access-list(100-199)(permit,deny)(Protocol-ip,icmp,tcp,udp)(Source-IP)(Wildcard-Mask)(Dest-IP)(Wildcard-Mask)eq(Port-Number)

#################################################################

ตัวอย่างการ Config Extended ACL

1)ประกาศ ACL
R1(config)#access-list 100 permit tcp host 192.168.2.253 host 2.2.2.2 eq 23
R1(config)#access-list 100 deny tcp any any eq 23
R1(config)#access-list 100 deny icmp any any
R1(config)#access-list 100 permit ip any any

2)Enable ACL ที่ INterface
R1(config)#interface f0/0
R1(config-if)#ip access-group 100 out

ทดสอบผล

R3#ping 1.1.1.1
UUUUU
R3#ping 2.2.2.2
UUUUU

R3#telnet 1.1.1.1
Trying 1.1.1.1 ...
% Destination unreachable; gateway or host down

R3#telnet 10.10.10.6
Trying 10.10.10.6 ...
% Destination unreachable; gateway or host down

R3#telnet 2.2.2.2
Trying 2.2.2.2 ... Open
User Access Verification
Username: admin
Password: cisco
ISP>exit
[Connection to 2.2.2.2 closed by foreign host]
R3#

R3#ssh -l admin 2.2.2.2
Password: cisco
ISP>exit
[Connection to 2.2.2.2 closed by foreign host]
R3#

R1#show ip access-lists 100
Extended IP access list 100
10 permit tcp host 192.168.2.253 host 2.2.2.2 eq telnet (36 matches)
20 deny tcp any any eq telnet (84 matches)
30 deny icmp any any (20 matches)
40 permit ip any any (36 matches)

สามารถดูตัวอย่างการ Config ACL ได้จากวีดีโอด้านล่างนะครับ

 

การแก้ไข ACL บน Router CISCO จากเดิม ถ้าเราต้องการแก้ไข config ACL เดิมนั้น ต้องทำการ Copy ใส่ Notepad ไว้ก่อน แล้วจัดบรรทัดให้ถูกต้อง แล้วจึง Config ลงไปใหม่ได้ เพราะเมื่อทำการลบ Config ACL แบบ ตัวเลขนั้น ลบเพียงบรรทัดเดียวจะหายทั้งหมด

ปัจจุบัน IOS เวอร์ชั่นใหม่ ( เวอร์ชั่น 12.3 ขึ้นไป ) สามารถแก้ไข ACL ได้ทั้งแบบตัวเลขและแบบชื่อ ( Number ACL และ Name ACL ) แล้ว
ตัวอย่างการแก้ไขดังนี้ครับ

Jodoi-HQ-NAT#show run

!
access-list 1 deny host 192.168.1.100
access-list 1 deny host 192.168.1.101
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 1 permit 192.168.2.0 0.0.0.255
!
จากเดิมมีการทำ ACL แบบตัวเลขไว้ คือ ACL number 1 มี 4 บรรทัด ให้ใช้ command show ip access-lists 1

Jodoi-HQ-NAT#show ip access-lists 1
Standard IP access list 1
10 deny host 192.168.1.100
20 deny host 192.168.1.101
30 permit 192.168.1.0 0.0.0.255
40 permit 192.168.2.0 0.0.0.255
จะเห็นตัวเลขข้างหน้า เช่น 10 ,20 เป็นต้น จะทำการลบ บรรทัด 20 deny host 192.168.1.101 ออก โดยใช้วิธีการ config แบบ Name ACL เข้ามาช่วยดังนี้

Jodoi-HQ-NAT(config)#ip access-list standard 1
Jodoi-HQ-NAT(config-std-nacl)#no 20

Jodoi-HQ-NAT#show ip access-lists 1
Standard IP access list 1
10 deny host 192.168.1.100
30 permit 192.168.1.0 0.0.0.255
40 permit 192.168.2.0 0.0.0.255

จะเห็นว่าบรรทัด 20 deny host 192.168.1.101 ได้หายไปแล้ว

ต่อไปจะเป้นการเพิ่ม ACL ลงไป ทำได้โดยใช้วิธีการ config แบบ Name ACL เข้ามาช่วยเช่นกันดังนี้ โดยใส่ตัวเลขที่อยู่ระหว่างบรรทัดที่ต้องการ เช่นเลือกเป็นเลข 15

Jodoi-HQ-NAT(config)#ip access-list standard 1
Jodoi-HQ-NAT(config-std-nacl)#15 deny host 192.168.1.200

Jodoi-HQ-NAT#show ip access-lists 1
Standard IP access list 1
10 deny host 192.168.1.100
15 deny host 192.168.1.200
30 permit 192.168.1.0 0.0.0.255
40 permit 192.168.2.0 0.0.0.255

จะเห็นว่ามีบรรทัด 15 deny host 192.168.1.200 เพิ่มเข้ามา

ส่วนการแก้ไข ACL แบบ ชื่อ หรือ Name ACL นั้นทำได้แบบเดียวกันครับ ดูตัวอย่างได้ในวีดีโอด้านล่างนะครับ

 

หวังว่าคงจะเป็นประโยชน์ไม่มากก็น้อยนะครับ

 

--------------------------------------------------------------------------------------------------------

บทความ Network

บทความ Linux

บทความ Certificate