Menu

English Translate

Datpin Chat


Thursday, June 16, 2011

Cisco Acl

Configuring IP Access Lists in Cisco Router

การคอนฟิก Access Lists ใน Cisco Router
1. การสร้าง Access-list ขึ้นใหม่แต่ละครั้งควรจะเริ่มต้นด้วยคำสั่ง no access-list xxx (เมื่อ xxx แทนตัวเลขใดๆ เช่น 123) ก่อนเสมอ เพื่อลบค่าเดิมในกรณีมีการใช้งานอยู่ก่อนหน้า

Cisco_Router1 (config) # no access-list 50
Cisco_Router1 (config) # access-list 50 permit host 192.168.10.9
Cisco_Router1 (config) # access-list 50 deny any log

2. กำหนดหมายเลขพอร์ตที่ต้องการควบคุมสำหรับในแต่ละ Access list ซึ่งจะช่วยเพิ่มประสิทธิภาพการทำงานของ IOS เนื่องจากทำให้ไม่ต้องทำการตรวจสอบข้อมูลในส่วน Header ทั้งหมดของแพ็กเก็ตโดยไม่จำเป็น

นอกจากนี้ ยังช่วยให้แน่ใจว่าข้อมูลการใช้งานที่เก็บในล็อกมีข้อมูลของหมายเลขพอร์ตที่ ถูกต้อง โดยการกำหนดหมายเลขพอร์ตในช่วงที่ต้องการเป็นอาร์กิวเมนต์หนึ่งของ Access list ที่สร้างขึ้น ดังตัวอย่าง

no access-list 101
access-list 101 deny udp any range 1 65535 any range 1 65535 log
access-list 101 deny tcp any range 1 65535 any range 1 65535 log
access-list 101 deny ip any any log

คำ สั่งในบรรทัดสุดท้ายใส่เพื่อให้แน่ใจว่า Router จะปฏิเสธแพ็กเก็ตที่ใช้งานโพรโตคอลอื่นๆ นอกเหนือจาก TCP และ UDP รวมทั้งเก็บค่าลงในล็อก

3. อนุญาต ให้เฉพาะแอดเดรสของเครือข่ายภายในส่งข้อมูลเข้าสู่ router ผ่านทางอินเทอร์เฟซภายใน โดยการบังคับที่ Access list รวมทั้งการปิดไม่ให้แอดเดรสที่ไม่ถูกต้องออกจากเครือข่ายที่อินเทอร์เฟซที่ เชื่อมต่อกับเครือข่ายภายนอก เพื่อป้องกันผู้บุกรุกไม่ให้ใช้ Router เป็นเครื่องมือในการโจมตีที่อื่น วิธีการนี้อาจจะไม่สามารถนำไปใช้งานได้จริงกับเครือข่ายที่มีความซับซ้อน

Cisco_Router1 (config) # no access-list 101
Cisco_Router1 (config) # access-list 101 permit ip 192.168.10.0 0.0.0.255 any
Cisco_Router1 (config) # access-list 101 deny udp any range 1 65535 any log
Cisco_Router1 (config) # access-list 101 deny tcp any range 1 65535 any log
Cisco_Router1 (config) # access-list 101 deny ip any any log
Cisco_Router1 (config) # interface eth 1
Cisco_Router1 (config-if) # ip access-group 101 in
Cisco_Router1 (config-if) # exit
Cisco_Router1 (config) # interface eth 0
Cisco_Router1 (config-if) # ip access-group 101 out

4. ไม่ควรให้แพ็กเก็ตที่มาจากภายนอก (จากเครือข่ายที่ไม่น่าเชื่อถือ) ผ่านเข้ามาในเครือข่าย เนื่องจากอาจจะเป็นแพ็กเก็ตที่มีการปลอมแปลง หรือส่งมาเพื่อโจมตีเครือข่าย สามารถทำได้โดยการแบ่งส่วนของเครือข่ายทั้งหมดตามแต่ละอินเทอร์เฟซของ Router และออกแบบว่าจะเลือกให้มีการส่งผ่านข้อมูล ที่มาจากเครือข่ายภายนอกและเครือข่ายที่ไม่น่าเชื่อถือจากที่ใดได้บ้าง

5. แพ็กเก็ตที่ส่งมาจากภายนอกที่มีแอดเดรสต้นทางเหมือนกับแอดเดรสของเครือข่าย ภายในใดๆ (เครือข่ายที่เชื่อถือ) จัดว่าเป็นแพ็กเก็ตที่ส่งเข้ามาเพื่อโจมตีระบบโดยวิธีการ TCP sequence number guessing หรือวิธีอื่นๆ ในทำนองเดียวกัน จึงไม่ควรให้ผ่านเข้ามาในเครือข่าย ป้องกันได้โดยการสร้าง access list ขึ้นมาใช้งานที่แต่ละอินเทอร์เฟซที่ต้องติดต่อกับเครือข่ายที่ไม่น่าเชื่อ ถือ

6. สกัดกั้นแพ็กเก็ตชนิด Loopback (มาจากเครือข่าย 127.0.0.0) เนื่องจากแพ็กเก็ตเหล่านี้ไม่มีทางเกิดขึ้นได้จริง นอกจากนั้น ให้ดร็อปแพ็กเก็ตขาเข้า (Inbound) ที่มาจาก IP address ที่ถูกสำรองไว้ (ได้แก่ 10.0.0.0, 172.16.0.0 - 172.31.0.0 และ 192.168.0.0) [ตาม RFC 1918]

7. หากเครือข่ายไม่มีความจำเป็นต้องใช้ IP Multicast ก็ควรจะกั้นแพ็กเก็ตชนิด Multicast ด้วย

8. สกัดกั้นแพ็กเก็ตชนิด Broadcast

หมาย เหตุ: การปิดแพ็กเก็ตชนิด Broadcast อาจจะทำให้บริการ DHCP และ BOOTP ไม่สามารถใช้งานได้ด้วย อย่างไรก็ตาม บริการทั้งสองอันนี้ไม่ควรนำมาใช้ที่อินเทอร์เฟซที่ต่อกับเครือข่ายภาย นอกอยู่แล้ว

9. การโจมตีเครือข่ายจากภายนอกส่วนมากจะใช้วิธีการส่ง ICMP Redirect จึงควรปิดบริการนี้ (วิธีการที่ดีกว่านี้แต่มีความยุ่งยากมากขึ้นคือการอนุญาตให้แพ็กเก็ตชนิด ICMP ที่จำเป็นเพียงบางชนิดผ่านเข้าออก)

ตัวอย่างที่แสดงดังต่อไปนี้ เป็นวิธีการหนึ่งที่จะนำเอาคำแนะนำด้านบนไปใช้งานจริง

Cisco_Router2 (config) # no access-list 103
Cisco_Router2 (config) # ! block internal addresses
Cisco_Router2 (config) # access-list 103 deny ip 14.2.0.0 0.0.255.255 any log
Cisco_Router2 (config) # access-list 103 deny ip 14.1.0.0 0.0.255.255 any log
Cisco_Router2 (config) # ! block loopback/reserved addresses
Cisco_Router2 (config) # access-list 103 deny ip 127.0.0.0 0.255.255.255 any log
Cisco_Router2 (config) # access-list 103 deny ip 10.0.0.0 0.255.255.255 any log
Cisco_Router2 (config) # access-list 103 deny ip 172.16.0.0 0.15.255.255 any log
Cisco_Router2 (config) # access-list 103 deny ip 192.168.0.0 0.0.255.255 any log
Cisco_Router2 (config) # ! block multicast (if not used)
Cisco_Router2 (config) # access-list 103 deny ip 224.0.0.0 0.0.255.255 any
Cisco_Router2 (config) # ! block broadcast
Cisco_Router2 (config) # access-list 103 deny ip host 0.0.0.0 any log
Cisco_Router2 (config) # ! block ICMP redirects
Cisco_Router2 (config) # access-list 103 deny icmp any any redirect log
Cisco_Router2 (config) # interface eth 0/0
Cisco_Router2 (config-if) # ip access-group 103 in

10. ทำการสกัดกั้นแพ็กเก็ตที่มีแอดเดรสต้นทาง (Source Address) และแอดเดรสปลายทาง (Destination Address) เหมือนกันไม่ให้เข้ามาในเครือข่าย (แพ็กเก็ตลักษณะนี้จัดเป็นวิธีการบุกรุกเครือข่ายที่เรียกว่า "Land") โดยการสร้าง Access list ในลักษณะตามตัวอย่างด้านล่าง

Cisco_Router2 (config) # no access-list 101
Cisco_Router2 (config) # access-list 101 deny ip host 10.2.6.250 host 10.2.6.250 log
Cisco_Router2 (config) # access-list 101 permit ip any any
Cisco_Router2 (config) # interface Eth 0/0
Cisco_Router2 (config-if) # ip address 10.2.6.250 255.255.255.0
Cisco_Router2 (config-if) # ip access-group 101 in

11. กำหนดค่า Access list ให้กับ Virtual terminal line เพื่อควบคุมการ telnet เข้า Router ในลักษณะตามตัวอย่างด้านล่าง

Cisco_Router1 (config) # line vty 0 4
Cisco_Router1 (config-line) # access-class 93 in
Cisco_Router1 (config-line) # exit
Cisco_Router1 (config) # no access-list 93
Cisco_Router1 (config) # access-list 93 permit 10.1.1.1
Cisco_Router1 (config) # access-list 93 permit 10.1.1.2

15 comments:

Anonymous said...

[url=http://onlinecasinose25.com ]online casino [/url]orders him off on account of our Holy Ghost, because the Holy http://onlinecasinose25.com onlinecasino.dk online casino trail to send off my report, I should find a letter from you, I should go

Anonymous said...

Ρost wгiting is also a fun, if
you be familiaг with aftеr that you can
write otheгwisе іt is cοmplicated to write.


my wеb blog; payday loans

Anonymous said...

Exсellent blоg hеre! Αlsο
your site lοаds uρ faѕt! What host aгe you using?
Cаn I get уouг аffіlіate link to уour host?
Ι wish my ѕite loaԁеd up аs quіcklу аs yours lоl

mу homepage ... same day loans

Anonymous said...

Do you mind if Ι quοte a couplе οf yοuг posts as long as I prοvіԁe сrеdit and sourcеs back to your websіte?
My blog sіte iѕ in the eхact ѕаme
nіche аѕ yours anԁ my visitors ωоuld reаlly benеfit fгom a lot
of the informatіon you present here. Ρlеaѕе
lеt me know іf this okaу with yоu. Сheers!


Heгe iѕ my webpаge: bad credit personal loans

Anonymous said...

constantly i used to read smaller articles οr revieωs thаt as well сlear theiг mοtіve, аnd thаt iѕ аlso happening with thіs
article whiсh I am reading at thiѕ ρlаcе.


my site; Payday Loans

Anonymous said...

For hottest news you have tо go to ѕee world-wide-ωeb and on internet Ι found thiѕ ωеbsite as a finest site fοr latest updatеs.


Take a loоk at my homepage: payday loans

Anonymous said...

These rental family homes will bring a nice home-away from-home looking in you.
Finishing materials in order to clean and smooth with
possible textured or boldly distinct accents.


Here is my site :: tanie noclegi zakopane

Anonymous said...

Now there are are several various kinds of
movie stars free music the required permits offered.
It makes you feel sure when pressed with the pressures of
life.

My homepage - rolety tychy

Anonymous said...

As a musical lover, it is approved as a lifetimes companion.

These music artists and bands and singers included a major consequence on
the enlargement of the Madchester scene.


Also visit my web page :: grzejniki łazienkowe

Anonymous said...

Some of you may recognize the small claims court system through Texas.
Solicitors should know the way it operates of the laws to help direct
you.

my blog post ... pomiary natężenia oświetlenia

Anonymous said...

If an not skilled individual uses the type of tools they would probably sustain injuries.
Avoidance is better when compared cure - this
goes the explaining.

Here is my web-site serwer-zuromin.pl

Anonymous said...

The research cluster recently filed a single patent for the actual whole device.

Additionally, advanced techniques for crystal growing and divorce will
assist in cost reductions.

my weblog; gsa search engine ranker

Anonymous said...

Good old-fashioned canvas tents make getting in contact
with nature easy.

my web site; stormchaser.pl (Stormchaser.pl)

Anonymous said...

Concerts, church, conferences, and neighborhood meetings are just several of the potentials.
Need to be fixed cesspools may run and release excessive odors.


Stop by my web-site; wrzucpliki.pl :: wrzucpliki.pl ::

Anonymous said...

Usually Kauai vacation home rental can be had in the country of these beaches.



Stop by my site - pozycjonowanie

This album is powered by BubbleShare - Add to my blog

datpin comment