แสดงบทความที่มีป้ายกำกับ Routing แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Routing แสดงบทความทั้งหมด

วันพฤหัสบดีที่ 20 ตุลาคม พ.ศ. 2554

An ISR 819 Router in Extreme Conditions

สุดยอดของเราเตอร์ Cisco ISR819 แกร่ง ทน อึด เอาไปใช้กับพื้นที่เสียงที่จะเกิดอุทกภัยได้เลยครับ :)

วันศุกร์ที่ 9 กรกฎาคม พ.ศ. 2553

Cisco ASA to Cisco IOS Router Site to Site VPN reference

วิธีการทำ VPN Site to Site ระหว่าง ASA และ IOS Router นะครับ ผมแนะนำใช้ Wizard ทั้ง 2 ฝั่งจะง่ายกว่าครับ ซึ่งต้องทำการ set encryption algorithm ทั้ง 2 ฝั่งให้ตรงกัน มันก็จะสามารถทำ tunnel connection กันได้แล้วครับ แต่หากใครอยากจะใช้ CLI ก็ตามด้านล่างเลยนะครับ

Cisco IOS Router Configuration

crypto isakmp policy 10
encryption 3des
auth pre-share
hash md5
group 2

crypto isakmp key address

ip access-list extended vpn-acl permit ip

crypto ipsec transform-set 3DES-MD5 esp-3des esp-md5-hmac

crypto map VPN 10 ipsec-isakmp
set transform 3DES-MD5
match address vpn-acl
set peer

interface FastEthernet 0/0
crypto map VPN

——————————————————————-

Cisco ASA configuration

sysopt connection permit-vpn

crypto isakmp policy 10
authentication pre-share
encryption 3des
hash md5

tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key

access-list vpn-acl permit ip

crypto ipsec transform-set 3DES-MD5 esp-3des esp-md5-hmac

crypto map VPN 10 set transform-set 3DES-MD5
crypto map VPN 10 match address vpn-acl
crypto map VPN 10 set peer

crypto isakmp enable outside
crypto map VPN interface outside

Related posts:

1.ASA VPN Setup Configuration reference commands.
2.Cisco ASA troubleshooting Commands
3.IPv4 Multicast Addressing Quick Reference.
4.Cisco Site-to-Site VPN Comparison Sheet

วันพุธที่ 16 มิถุนายน พ.ศ. 2553

Set up DDNS for Cisco IOS Router

วันนี้ผมจะมา update เรื่องของการทำ DDNS บนตัว IOS เราเตอร์นะครับ ซึ่งส่วนใหญ่มักจะเป็น ADSL Router ซึ่งจะทำการ negotiate ip มาจากทางผู้ให้บริการอินเตอร์เน็ต เพราะฉะนั้นแล้วจะมีการเปลี่ยนแปลงของ IP เกิดขึ้นตลอดห้วงเวลา โดยปกติแล้วหากเราอยู่ภายนอกเครือข่าย LAN ของเรานั้น แต่มีความต้องการที่จะเข้ามาใช้ resource บางอย่างใน LAN เราต้องทำ Port Forwarding และต้องมี Public IP หรือ IP จริงที่เรามักจะใช้กัน เราสามารถใช้ DDNS เป็นตัวที่ทำการจับไอพีที่เปลี่ยนแปลงไปตลอดของขา WAN ฝั่งเราได้โดยไปลงทะเบียนกับทางผู้ให้บริการต่างๆ เช่น dyndns.org เป็นต้น วิธีการ configure สามารถดูตัวอย่างได้จากด้านล่างนี้ครับ

router#configure terminal
router(config)#ip domain lookup
router(config)#ip domain name dyndns.org
router(config)#ip host members.dyndns.org 63.208.196.96
router(config)#ip ddns update method mydyndns
router(config)#http
routerconfig#add ..................... >>> ใส่ username และ password
router(config)#interval maximum 28 0 0 0
router(config)#interval minimum 28 0 0 0
router(config)#end
router#configure terminal
router(config)#interface dialer0
router(config-if)#ip ddns update hostname myhostname.dyndns.org
router(config-if)#ip ddns update mydyndns host members.dyndns.org

ดูข้อมูลเพิ่มเติมได้จาก http://www.cisco.com/en/US/docs/ios/ipaddr/configuration/guide/iad_ddns_ps6441_TSD_Products_Configuration_Guide_Chapter.html#wp1221892

วิธีการทำ Port Forwarding เพื่อจะให้ผู้ใช้งานสามารถเข้าผ่าน Dynamic DNS มาที่อุปกรณ์ภายในเครือข่ายของเรา เช่น Server, IP Camera, DVR เป็นต้น

- หากเราจะเข้ามาที่ web server เบอร์ไอพีเป็น 192.168.1.21 จากฝั่งนอก เราจะต้องใช้คำสั่งตามด้านล่างนี้
ip nat inside source static tcp 192.168.1.21 80 int di0 80

- อีกทั้งเราสามารถ add Port Forwarding จาก CLI ได้เรื่อยๆ ทีละหลายๆ อุปกรณ์ได้ตัวอย่างตามด้านล่างนี้ครับ
ip nat inside source static udp 192.168.1.220 53 interface Dialer0 53
ip nat inside source static tcp 192.168.1.220 53 interface Dialer0 53
ip nat inside source static tcp 192.168.1.220 143 interface Dialer0 143
ip nat inside source static tcp 192.168.1.220 443 interface Dialer0 443
ip nat inside source static tcp 192.168.1.220 110 interface Dialer0 110
ip nat inside source static tcp 192.168.1.220 25 interface Dialer0 25
ip nat inside source static tcp 192.168.1.220 22 interface Dialer0 22
ip nat inside source static tcp 192.168.1.220 80 interface Dialer0 80
ip nat inside source static tcp 192.168.1.220 21 interface Dialer0 21
ip nat inside source static tcp 192.168.1.220 5222 interface Dialer0 5222
ip nat inside source static tcp 192.168.1.220 7777 interface Dialer0 7777
ip nat inside source static udp 192.168.1.220 5060 interface Dialer0 5060
ip nat inside source static udp 192.168.1.220 10000 interface Dialer0 10000
ip nat inside source static udp 192.168.1.220 10001 interface Dialer0 10001
ip nat inside source static udp 192.168.1.220 10003 interface Dialer0 10003
ip nat inside source static udp 192.168.1.220 10004 interface Dialer0 10004

วันจันทร์ที่ 4 พฤษภาคม พ.ศ. 2552

How to setup IP Policy based routing in Cisco IOS

Policy based routing สามารถถูกใช้งานได้จากการสร้าง "route-map"
route-map จะมีคำสั่งหลักๆ อยู่ 2 คำสั่ง คือ


1. คำสั่ง match เป็นการเลือก address ให้ทำการถูก permit (อาจจะใช้ Access list ก็ได้)
2. คำสั่ง Set เป็น action ที่จะให้ address ที่ถูก permit ออกไปยัง hop ไหน

Example จากโจทย์และไดอะแกรมด้านข้างนี้ เราจะให้ network เครือข่าย 10.1.1.0 ออกทาง Router B ส่วน Source อื่นๆ ออกไปทาง Router A จะทำได้ตาม step ดังต่อไปนี้

1.สร้าง standard ACL โดยทำที่ Global Configuration Mode ซึ่งจะทำ policy โดยการอนุญาต source network 10.1.1.0/24
router#conf ter
router#access-list 10 permit 10.1.1.0 0.0.0.255

2.สร้าง Route-map (แผนที่เส้นทาง >> ลายแทงนั่นเอง) โดยใช้คำสั่ง match และ set
router(config)#route-map SetNextHop permit 10
router(config-route-map)#match ip address 10
router(config-route-map)#set ip next-hop 192.168.0.1
Note. จากคำสั่งด้านบน เราสร้าง route-map ที่ชื่อว่า "SetNextHop" และทำการ match ให้เข้ากับ policy access list หมายเลข 10 ซึ่งเป็น Source Address ที่ได้สร้างไว้ก่อนหน้านี้ และสุดท้ายกำหนดให้ network ต้นทางนี้ถูกส่ง packet ไปยังไอพี 192.168.0.1

3. ทำการ Apply Policy Route-map ที่ Interface ของ router ที่เราได้สั่งให้ packet วิ่งออกไป
router(config)#int fa0/0
router(config-if)#ip policy route-map SetNextHop
router(config-if)#ip route-cache policy

Note. คำสั่ง ip route-cache policy ที่ interface configuration mode ทำเพื่อ enable fast switching ของ PBR (Policy Base Routing)