40.2 Security Sample Configurations Cisco Forum FAQ| FAQ Revisions | Editors: skj, Covenant, aryoba, Phraxos Last modified on 2008-11-21 15:11:04 |
40.2 Security Sample Configurations·Basic Internet Firewall ACL for Routers without IOS image Firewall feature | ||
| You probably have a router running basic IOS image without Firewall (FW) feature. You understand that you need a good firewall to protect your network from Internet intruders. There are choices to tackle the problem. 1. Setup a hardware firewall (i.e. PIX Firewall) in front of the router 2. Upgrade the router to run IOS image with FW feature 3. Apply basic Firewall ACL to Internet-facing router interface Option 1 Check out the following FAQ for sample configuration on setting a PIX in front of a router. »Cisco Forum FAQ »Internet - PIX - Router - LAN This setup should be the best approach to tackle the problem. However there are some constraints that might prevent you to choose this option, such as: 1. Financial burden 2. The router has integrated modem (i.e. DSL, cable modem, T1, ISDN) or the router Internet-facing (WAN) interface is not Ethernet interface 3. You do BGP peering with another AS, hence requires a router or layer-3 switch to be the public edge equipment When the WAN interface router is not Ethernet or your router is BGP peering, then you then have a choice to setup a hardware firewall behind the router, while the router run basic firewall ACL. Check out the following FAQ for sample configuration on setting a PIX behind a router. »Cisco Forum FAQ »Internet - Router - PIX - LAN When you have financial burden, then the only choice is to have the router run basic firewall ACL. Option 2 Upgrading the router is also a good approach. There are followings that might prevent you to do so. 1. You currently don't have proper Smartnet contract and upgrading the contract might be a hassle 2. The router might run too hot on memory and CPU when the router already run heavy routing 3. Activating any additional features on router (including FW feature) will take the router resources (memory and CPU) that might degrade the router robustness or performance 4. You don't have management control over the router, since there is another party doing so (i.e. your ISP or vendor) 5. You need to meet government agency regulations and using the router as a firewall might not meet such regulations When you have at least one of those situations, then your best option should be putting a hardware firewall in front of or behind the router. Option 3 This option is the most economical and might be a quick way to tackle the problem. Keep in mind that 1. This basic Firewall ACL only works on certain situations and certain protocol usages 2. Should you choose to implement this basic Firewall ACL on the router, it is suggested to have additional hardware firewall sitting behind the router for long-term solution Assumptions on the sample configuration: * There is Ethernet 0 interface as your LAN interface and Ethernet 1 interface as your WAN interface * You have a single static Public IP address within your network (the 1.1.1.2/30) * The Internet default gateway is 1.1.1.1/30 * Your LAN only has 10.0.0.0/24 as internal network and nothing else * You run public Web and Mail servers (the www and smtp) using the 1.1.1.2 as the public IP address * The internal Mail server IP address is 10.0.0.2 and the internal Web server IP address is 10.0.0.3 * You also use 1.1.1.2 for Internet browsing traffic from your LAN * You use your ISP DNS servers to browse the Internet (the TCP and UDP 53) * Your network daily usage is only browsing the Internet (that only use protocol TCP) and no other protocols used * You keep logs on potential illegitimate traffic attempts Following is the sample configuration Notes: 1. The sample configuration is not intended as full router configuration. It only shows related commands. 2. ACL 100: Inbound Traffic Firewall * The key of the Firewall ACL (ACL 100) is the "established" keyword * Internet browsing mean outbound connections initiated from your LAN out to the Internet * Most common Internet browsing (i.e. open up websites, FTP sites, some Internet video or audio live streaming) only requires protocol TCP * With Internet browsing, only established TCP packets that are necessary to enter your network as reply packets * These established TCP packets are TCP ACK (acknowledge) during the three-way handshake or on ESTABLISHED mode (the actual data transfer); and RST (reset to close the connection) * With "established" keyword, only TCP packet ACK and RST will be permitted to enter your network * Note that there is no need to specify "access-list 100 permit tcp any eq 53 host 1.1.1.2" since the "access-list 100 permit tcp any host 1.1.1.2 established" would take care reply TCP port 53 (DNS) packets * This ACL assumes that you have static IP address assignment from ISP (the real static IP; not static by DHCP - read this FAQ for more info »Cisco Forum FAQ »Between DHCP, PPP, Dynamic, and Static IP Address ). If your router must receive ISP IP address from ISP DHCP server, then you need to permit incoming bootps traffic as well. Here is the ACL 100 looks like which incorporates ISP DHCP incoming bootps packets. 3. ACL 101: Outbound Traffic Firewall * Those TCP and UDP ports are known used by virus/worm, therefore outbound connection to the Internet on such ports should be blocked * The host IP addresses are "invalid IP addresses" in Internet browsing perspective * Since only the 1.1.1.0/30 subnet is used as the Public IP subnet, any other IP addresses from different subnet try to go out to the Internet using the router should be illegitimate traffic; hence should be blocked 4. ACL 110: NAT/PAT Traffic Firewall * NAT/PAT sourcing from any IP address within your Public IP subnet or any IP address other than your internal subnet should be illegitimate traffic and known used by DOS (Denial of Service) attack; hence should be blocked * No private subnet on the Internet, hence NAT/PAT to those subnets should be blocked as well 5. Blackholing illegitimate traffic Since there are no other private subnets within your network than 10.0.0.0/24, traffic to other private subnets should go to Null interface (black hole) More Sample Configuration using ACL as Basic Firewall »Cisco Forum FAQ »Configure DMZ on routers by aryoba | ||
Configure DMZ on routers (#15913) | ||
| Suggested prerequisite reading: »Cisco Forum FAQ »Basic Internet Firewall ACL for Routers without IOS image Firewall feature On these sample configurations, it is assumed the following occur * There are at least three network segments; outside (i.e. WAN or The Internet), inside (LAN), DMZ * These segments are within their own subnet (Layer-3 separation) * Inside subnet is 10.0.0.0/24 and DMZ subnet is 10.0.1.0/24 Sample #1: Total Separation between Inside and DMZ This sample assumes the following * Internet-only access for DMZ * DMZ cannot access inside * Inside cannot access DMZ Sample #2: Restricted Access on DMZ specific services from Inside This sample assumes the following * Internet-only access for DMZ * DMZ cannot access inside * Inside can access DMZ only for web (TCP port 80) and email (TCP port 25) Sample #3: Restricted Access on DMZ most applications from Inside This sample assumes the following * Internet-only access for DMZ * DMZ cannot access inside * Inside can access DMZ on any TCP-based application and DNS (TCP and UDP port 53) * Note that most applications are TCP-based. Therefore this sample applies to most network by aryoba | ||
| When your router is running IOS image with FW feature, you can implement CBAC as a Stateful Firewall IOS-based. With such inspection, the router can inspect inbound traffic from outside such as The Internet to inside the network. The router can also inspect outbound traffic from inside the network to outside. Note that the sample configurations implement outbound inspection on the WAN (Internet) interface that regulate outbound traffic from inside to the Internet. Typically no inspection is necessary or even needed to regulate traffic between inside or non-Internet interfaces. When there are no public servers hanging off the router and there are only outbound traffic such as Internet browsing (in addition of no inspection between inside interfaces), there should be no reason to implement inspection on inside interface. Therefore it is common practice to implement inspection on the WAN (Internet) interface to regulate outbound traffic when there are multiple non-Internet interfaces on the router and/or there are no inbound traffic. Inspecting Generic Traffic version 12.3 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! hostname Router ! boot-start-marker boot-end-marker ! enable secret 5 $1$uOpf$emfDhaV0/UALCYwjF.iHf/ ! no aaa new-model ip subnet-zero no ip source-route ! ip inspect name OUTBOUND cuseeme ip inspect name OUTBOUND ftp ip inspect name OUTBOUND h323 ip inspect name OUTBOUND netshow ip inspect name OUTBOUND rcmd ip inspect name OUTBOUND realaudio ip inspect name OUTBOUND rtsp ip inspect name OUTBOUND sqlnet ip inspect name OUTBOUND tcp ip inspect name OUTBOUND udp ip inspect name OUTBOUND vdolive ip inspect name OUTBOUND icmp ip ssh break-string isdn switch-type basic-net3 ! ! ! ! ! ! interface Ethernet0 description LAN ip address 192.168.0.16 255.255.255.0 no ip proxy-arp ip nat inside ! interface BRI0 no ip address encapsulation ppp dialer pool-member 1 isdn switch-type basic-net3 ppp authentication chap pap callin ! interface Dialer1 description ISP ip address negotiated ip access-group 121 in no ip redirects no ip unreachables no ip proxy-arp ip nat outside ip inspect OUTBOUND out encapsulation ppp no ip split-horizon dialer pool 1 dialer remote-name Cisco1 dialer idle-timeout 360 dialer string 08089916001 class DialClass dialer hold-queue 10 dialer load-threshold 20 either dialer-group 1 no cdp enable ppp authentication chap pap callin ppp chap hostname host-username ppp chap password 7 **** ppp pap sent-username username-here password 7 **** ! ip nat inside source list 23 interface Dialer1 overload ip classless ip route 0.0.0.0 0.0.0.0 Dialer1 no ip http server no ip http secure-server ! ! map-class dialer DialClass access-list 23 permit 192.168.0.0 0.0.0.255 access-list 121 remark **** Permitted inbound packets **** access-list 121 deny udp any range 137 139 any access-list 121 deny tcp any range 137 139 any access-list 121 deny icmp any any echo access-list 121 permit icmp any any echo-reply access-list 121 permit icmp any any time-exceeded access-list 121 permit icmp any any unreachable access-list 121 deny icmp any any access-list 121 permit ip any any time-range TIME access-list 121 deny ip any any log-input dialer-list 1 protocol ip permit ! ! line con 0 exec-timeout 0 0 transport preferred all transport output all stopbits 1 line vty 0 4 access-class 23 in exec-timeout 0 0 login local transport preferred all transport input all transport output all ! no rcapi server ! ! time-range TIME periodic daily 0:00 to 23:59 ! ! end Inspecting Instant Messaging Traffic 1. Medium Security Policy on Application Traffic version 12.4 no service pad service tcp-keepalives-in service tcp-keepalives-out service timestamps debug datetime msec localtime show-timezone service timestamps log datetime msec localtime show-timezone service password-encryption service sequence-numbers ! hostname Router ! boot-start-marker boot-end-marker ! logging buffered 51200 debugging logging console critical enable secret 5 ??????????????????????? ! aaa new-model ! ! aaa authentication login default local aaa authorization exec default local ! aaa session-id common ! resource policy ! clock timezone PCTime -5 clock summer-time PCTime date Apr 6 2003 2:00 Oct 26 2003 2:00 ip subnet-zero no ip source-route ! ! ip cef ip inspect log drop-pkt ip inspect name SDM_MEDIUM appfw SDM_MEDIUM ip inspect name SDM_MEDIUM cuseeme ip inspect name SDM_MEDIUM dns ip inspect name SDM_MEDIUM ftp ip inspect name SDM_MEDIUM h323 ip inspect name SDM_MEDIUM https ip inspect name SDM_MEDIUM icmp ip inspect name SDM_MEDIUM imap reset ip inspect name SDM_MEDIUM pop3 reset ip inspect name SDM_MEDIUM rcmd ip inspect name SDM_MEDIUM realaudio ip inspect name SDM_MEDIUM rtsp ip inspect name SDM_MEDIUM esmtp ip inspect name SDM_MEDIUM sqlnet ip inspect name SDM_MEDIUM streamworks ip inspect name SDM_MEDIUM tftp ip inspect name SDM_MEDIUM tcp ip inspect name SDM_MEDIUM udp ip inspect name SDM_MEDIUM vdolive ip inspect name SDM_MEDIUM sip ip inspect name SDM_MEDIUM sip-tls ip tcp synwait-time 10 no ip bootp server ip domain name wtbhome.net ip name-server 71.242.0.12 ip ssh time-out 60 ip ssh authentication-retries 2 ! appfw policy-name SDM_MEDIUM application im aol service default action allow alarm service text-chat action allow alarm server permit name login.oscar.aol.com server permit name toc.oscar.aol.com server permit name oam-d09a.blue.aol.com application im msn service default action allow alarm service text-chat action allow alarm server permit name messenger.hotmail.com server permit name gateway.messenger.hotmail.com server permit name webmessenger.msn.com application http strict-http action allow alarm port-misuse im action reset alarm port-misuse p2p action reset alarm port-misuse tunneling action allow alarm application im yahoo service default action allow alarm service text-chat action allow alarm server permit name scs.msg.yahoo.com server permit name scsa.msg.yahoo.com server permit name scsb.msg.yahoo.com server permit name scsc.msg.yahoo.com server permit name scsd.msg.yahoo.com server permit name cs16.msg.dcn.yahoo.com server permit name cs19.msg.dcn.yahoo.com server permit name cs42.msg.dcn.yahoo.com server permit name cs53.msg.dcn.yahoo.com server permit name cs54.msg.dcn.yahoo.com server permit name ads1.vip.scd.yahoo.com server permit name radio1.launch.vip.dal.yahoo.com server permit name in1.msg.vip.re2.yahoo.com server permit name data1.my.vip.sc5.yahoo.com server permit name address1.pim.vip.mud.yahoo.com server permit name edit.messenger.yahoo.com server permit name messenger.yahoo.com server permit name http.pager.yahoo.com server permit name privacy.yahoo.com server permit name csa.yahoo.com server permit name csb.yahoo.com server permit name csc.yahoo.com ! username tborland privilege 15 secret 5 ?????????????? ! ! ! bridge irb ! ! ! interface FastEthernet0 ! interface FastEthernet1 ! interface FastEthernet2 ! interface FastEthernet3 ! interface FastEthernet4 description $ES_WAN$$FW_OUTSIDE$ ip address dhcp ip access-group 101 in no ip redirects no ip unreachables no ip proxy-arp ip inspect SDM_MEDIUM out ip nat outside ip virtual-reassembly ip route-cache flow duplex auto speed auto no cdp enable ! interface Dot11Radio0 no ip address ! encryption mode ciphers tkip ! encryption vlan 1 mode ciphers tkip ! ssid wtbhome vlan 1 authentication open authentication key-management wpa wpa-psk ascii 7 ****** ! speed basic-1.0 basic-2.0 basic-5.5 6.0 9.0 basic-11.0 12.0 18.0 24.0 36.0 48.0 54.0 station-role root no dot11 extension aironet no cdp enable bridge-group 1 ! interface Dot11Radio0.1 encapsulation dot1Q 1 native no snmp trap link-status no cdp enable bridge-group 1 bridge-group 1 subscriber-loop-control bridge-group 1 block-unknown-source no bridge-group 1 source-learning no bridge-group 1 unicast-flooding ! interface Vlan1 description Internal Network no ip address ip nat inside ip virtual-reassembly ip tcp adjust-mss 1452 bridge-group 1 bridge-group 1 spanning-disabled ! interface BVI1 description Bridge to Internal Network ip address 192.168.0.1 255.255.255.0 ip access-group 100 in no ip redirects no ip unreachables no ip proxy-arp ip nat inside ip virtual-reassembly ip route-cache flow ip tcp adjust-mss 1412 ! ip classless ! no ip http server no ip http secure-server ip nat inside source list 1 interface FastEthernet4 overload ! logging trap debugging access-list 1 remark INSIDE_IF=BVI1 access-list 1 remark SDM_ACL Category=2 access-list 1 permit 192.168.0.0 0.0.0.255 access-list 100 remark auto generated by Cisco SDM Express firewall configuration access-list 100 remark SDM_ACL Category=1 access-list 100 deny ip host 255.255.255.255 any access-list 100 deny ip 127.0.0.0 0.255.255.255 any access-list 100 permit ip any any access-list 101 remark auto generated by Cisco SDM Express firewall configuration access-list 101 remark SDM_ACL Category=1 access-list 101 permit udp any eq bootps any eq bootpc access-list 101 permit icmp any any echo-reply access-list 101 permit icmp any any time-exceeded access-list 101 permit icmp any any unreachable access-list 101 deny ip any any access-list 103 remark VTY Access-class list access-list 103 remark SDM_ACL Category=1 access-list 103 permit ip 192.168.0.0 0.0.0.255 any access-list 103 deny ip any any no cdp run ! control-plane ! bridge 1 protocol ieee bridge 1 route ip banner login ^CAuthorized access only! Disconnect IMMEDIATELY if you are not an authorized user!^C ! line con 0 no modem enable transport output telnet line aux 0 transport output telnet line vty 0 4 access-class 103 in transport input telnet ssh ! scheduler max-task-time 5000 scheduler allocate 4000 1000 scheduler interval 500 end 2. High Security Policy on Application Traffic version 12.4 no service pad service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Router ! boot-start-marker boot-end-marker ! logging buffered 51200 warnings enable secret 5 ??????????????????????? ! aaa new-model ! ! aaa authentication login default local aaa authorization exec default local ! aaa session-id common ! resource policy ! clock timezone PST -8 ip cef ! ! no ip dhcp use vrf connected ip dhcp excluded-address 10.10.10.1 10.10.10.10 ! ip dhcp pool sdm-pool import all network 10.10.10.0 255.255.255.0 default-router 10.10.10.1 dns-server 208.67.222.222 208.67.220.220 ! ! no ip domain lookup ip domain name yourdomain.com ip name-server 208.67.222.222 ip name-server 208.67.220.220 ip inspect log drop-pkt ip inspect name SDM_HIGH appfw SDM_HIGH ip inspect name SDM_HIGH icmp ip inspect name SDM_HIGH dns ip inspect name SDM_HIGH esmtp ip inspect name SDM_HIGH https ip inspect name SDM_HIGH imap reset ip inspect name SDM_HIGH pop3 reset ip inspect name SDM_HIGH tcp ip inspect name SDM_HIGH udp ! appfw policy-name SDM_HIGH application im aol service default action reset alarm service text-chat action reset alarm server deny name login.oscar.aol.com server deny name toc.oscar.aol.com server deny name oam-d09a.blue.aol.com audit-trail on application im msn service default action reset alarm service text-chat action reset alarm server deny name messenger.hotmail.com server deny name gateway.messenger.hotmail.com server deny name webmessenger.msn.com audit-trail on application http strict-http action reset alarm port-misuse im action port-misuse p2p action reset alarm port-misuse tunneling action reset alarm application im yahoo service default action reset alarm service text-chat action reset alarm server deny name scs.msg.yahoo.com server deny name scsa.msg.yahoo.com server deny name scsb.msg.yahoo.com server deny name scsc.msg.yahoo.com server deny name scsd.msg.yahoo.com server deny name cs16.msg.dcn.yahoo.com server deny name cs19.msg.dcn.yahoo.com server deny name cs42.msg.dcn.yahoo.com server deny name cs53.msg.dcn.yahoo.com server deny name cs54.msg.dcn.yahoo.com server deny name ads1.vip.scd.yahoo.com server deny name radio1.launch.vip.dal.yahoo.com server deny name in1.msg.vip.re2.yahoo.com server deny name data1.my.vip.sc5.yahoo.com server deny name address1.pim.vip.mud.yahoo.com server deny name edit.messenger.yahoo.com server deny name messenger.yahoo.com server deny name http.pager.yahoo.com server deny name privacy.yahoo.com server deny na server deny name csb.yahoo.com server deny name csc.yahoo.com audit-trail on ! ! crypto pki trustpoint TP-self-signed-2642721116 enrollment selfsigned subject-name cn=IOS-Self-Signed-Certificate-2642721116 revocation-check none rsakeypair TP-self-signed-2642721116 ! ! crypto pki certificate chain TP-self-signed-2642721116 certificate self-signed 01 3082024D 308201B6 A0030201 02020101 300D0609 2A864886 F70D0101 04050030 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69666963 6174652D 32363432 37323131 3136301E 170D3038 30313136 30353033 34325A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D32 36343237 32313131 3630819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281 8100CB9E 16476447 E416F6C1 A994AB08 1525CF8E FA38C653 49ED2B44 34A66AC9 4D9C2677 71756644 0D54DBB1 11C224E5 4D17EC67 2148384A FE15B177 3C8D3710 4338044F 6672B697 9FEBC408 EA552F2A 6B2C7035 2E38B6F8 55E09757 0AC5A2 163FFA91 C26D8443 3EFBDFD1 CE078C9C 350AE5E5 EE866021 491C4362 8476AD3D 0E930203 010001A3 75307330 0F060355 1D130101 FF040530 030101FF 30200603 551D1104 19301782 15526F75 7465722E 796F7572 646F6D61 696E2E63 6F6D301F 0603551D 23041830 16801444 9A67C06B 63BCAF40 5D467966 AA658D22 F6353430 1D060355 1D0E0416 0414449A 67C06B63 BCAF405D 467966AA 658D22F6 3534300D 06092A86 4886F70D 01010405 00038181 005D6986 D31370A4 A327EB4B FF7ED748 25C11602 76C2A0B7 A0A1D670 7DF73001 BFAEEFF9 E6C4BE6F EB9BF6DC 1FD7D8 9B571B6E C4A4307C B1A03F91 92EF08BF B249D567 1A46D51D 3405862C A88BFCC7 AD9B755A B2BB1298 271B6952 7A08CD61 F89A31B6 A2DB9C6F 62B00F6D 7089A7FB 44D7D866 D527960F 7A138B26 92252C4B D4 quit username tborland privilege 15 secret 5 ?????????????? ! ! ! bridge irb ! ! ! interface FastEthernet0 ! interface FastEthernet1 ! interface FastEthernet2 ! interface FastEthernet3 ! interface FastEthernet4 description $ETH-WAN$ no ip address duplex auto speed auto pppoe enable pppoe-client dial-pool-number 1 ! interface Vlan1 description $ETH-SW-LAUNCH$$INTF-INFO-HWIC 4ESW$ no ip address ip tcp adjust-mss 1452 bridge-group 1 ! interface Dialer0 description $FW_OUTSIDE$ ip address negotiated ip access-group 101 in ip mtu 1492 ip inspect SDM_HIGH out encapsulation ppp dialer pool 1 dialer-group 1 ppp authentication chap pap callin ppp chap hostname [my dsl account] ppp chap password 0 [password] ppp pap sent-username [my_dsl_account] password 0 [password] ppp ipcp dns request ppp ipcp route default ppp ipcp address accept ! interface BVI1 description $ETH-SW-LAUNCH$$INTF-INFO-HWIC 4ESW$ ip address 10.10.10.1 255.255.255.0 ip access-group 100 in ip tcp adjust-mss 1452 ! ! ! no ip http server no ip http secure-server ip nat inside source list 1 interface Dialer0 overload ! access-list 1 permit 10.10.10.0 0.0.0.255 access-list 100 remark auto generated by SDM firewall configuration access-list 100 remark SDM_ACL Category=1 access-list 100 deny ip host 255.255.255.255 any access-list 100 deny ip 127.0.0.0 0.255.255.255 any access-list 100 permit ip any any access-list 101 remark auto generated by SDM firewall configuration access-list 101 remark SDM_ACL Category=1 access-list 101 permit icmp any any echo-reply access-list 101 permit icmp any any time-exceeded access-list 101 permit icmp any any unreachable access-list 101 deny ip any any log dialer-list 1 protocol ip permit ! ! ! ! control-plane ! bridge 1 protocol ieee bridge 1 route ip banner login ^CAuthorized access only! Disconnect IMMEDIATELY if you are not an authorized user!^C ! line con 0 no modem enable line aux 0 line vty 0 4 access-class 1 in transport input ssh ! scheduler max-task-time 5000 end Some discussion /forum/remark,13205912?hilite=801+woes »801 ISDN access list woes by aryoba | ||
| Extracted from following thread: »[HELP] IOS IPS -- Is the performance hit worth it? Note: To run this configuration, your router needs to run IOS image that has IPSec/IDS feature and have the signature file on its flash memory. Check out the following FAQ for more info. »Cisco Forum FAQ »Protect my network! How do I do that using Cisco IOS? by aryoba | ||
| Note: * Router needs to run 12.4 IOS image by aryoba | ||
| A solution which uses the router to filter Internet access (web traffic), allowing what is defined to go through and deny all others. Option 1: Using CBAC feature This "work around" is the use of Cisco's Web Filtering functionality which goes hand in hand with the Websense products. This FAQ will utilise the current functionality of the Websense solution without a server by deviating from the original design of this suite of technologies by Cisco. Note that this is only supported in IOS that have the CBAC functionality. First off, create an ACL which will be used in the Java filter statement that allows everything through which will not trigger the Java applet scanner which can be CPU intensive. If not, degraded performance can occur. Define the IP INSPECT statements as below and then add what URLs are allowed to be accessed such as www.google.com and www.froogle.com in the example below: The statement "ip urlfilter exclusive-domain www.xxxx.com" adds a domain name to or from the exclusive domain list so that the firewall does not have to send look-up requests to the Websense server. So, regardless of the Websense server being available or not, which in this case does not exist, the router will allow all HTTP requests to the above domains through. There is a setting which is defined by the statement "ip urlfilter allow-mode on/off" where if the router can't talk to the Websense server, it will allow web traffic through or deny it depending on this setting. There is no Websense server defined at all but what we will do is turn off the allow-mode so all traffic will be denied bar the ones defined in the exclusive-domain statement. Now the configuration has been setup, it then has to be applied to the interface like a normal ip inspect statement, for example: or Option 2: Using QoS CBWFQ feature Using the same previous situation, the permitted web sites are only www.google.com and www.froogle.com; while traffic to other sites are blocked. This time the filtering technique is utilising CBWFQ which is also applied to the WAN interface. CBWFQ (Class Based Weighted Fair Queue) is Cisco QoS (Quality of Service) feature that can be used to shape or to drop certain traffic. In this sample configuration, outbound traffic to www.google.com, to www.froogle.com, and to ISP DNS servers are set to guarantee 20% bandwidth during congestion. Other traffic will be dropped even when there is no congestion. Let's review another illustration. Some organizations prevent their employee to access public social sites such as www.myspace.com and adult (porn) sites such as www.playboy.com; while still permit access to other Internet sites. Using the CBWFQ, following is blocked-access sample configuration. More illustration on CBWFQ technique to restrict/maintain website access »[Config] QoS with CBWFQ to prioritize a website Option 3: Using ACL IP Address-Based The downside of the two previous sample configurations is that your router may not support such feature. A good side is that most router support access block by IP addresses or subnets. Following is illustration on how to block access by the site's IP addresses, which the filter is applied to the LAN interface. Let's revisit the www.myspace.com access block. Using DNS A record and WHOIS checks, it is revealed that currently myspace.com subnet is 216.178.32.0/20 (from 216.178.32.0 to 216.178.47.255). Following is the sample configuration of block access to myspace.com based on its IP addresses. Side Note: You can use following site for public DNS A record and WHOIS checking http://www.iptools.com/ Note that this block access method only works when myspace.com still occupies the 216.178.32.0/20 subnet. It was known that originally myspace.com did not occupy this subnet. When the blocked site IP addresses are moved to different subnet, then there will be a need to adjust the blocked IP subnet to the new one. This adjustment is not needed when one of the two previous options is deployed. This FAQ was inspired by the following post: »How to Configure Internet Access restrictions ? by Covenant edited by aryoba | ||
| Suggested prerequisite reading »Cisco Forum FAQ »Setting Up Private Site-To-Site Connections Introduction Setting up site-to-site IPSec VPN connection in general involves two phases. Phase 1 is called ISAKMP SA (Security Association) establishment and Phase 2 is called IPSec SA establishment. Phase 1 In general, Phase 1 deals with confirmation among sites that are about to establish secure connection across unsecure network. This process is to verify that each site is authorized to establish such connection. Following is further description. Phase 1 is to establish the ISAKMP key matching with remote site. One popular technique of this ISAKMP key matching is to use preshared key. This key is basically a string (combination of alphabets, numbers, and characters) that both sites agree to use. The key is then stored (and encrypted) within each VPN device configuration. Phase 1 in IPSec VPN connection establishment is also involving the remote VPN device IP address (peer). A popular technique is to specifically set the remote peer IP address (for security purposes); known as static configuration. With this specific static configuration, both preshared key and remote IP address are statically configured into the VPN device. During the Phase 1 VPN tunnel establishment using the static configuration of both preshared key and remote IP address, the two VPN peer IP addresses (the local and the remote) must match. If the two VPN peer IP addresses match, then the next step is to match the preshared key between the two VPN devices. This preshared key matching process is done within an encapsulated secure (encrypted) tunnel. The encapsulation type and method used is the encryption specified for the Phase 1. In other word, Phase 1 VPN tunnel establishment in this case involves matching process of three factors where all the three are statically configured into both VPN devices. If there is a change needed to the either one of the three, manual adjustment is needed. The three factors are VPN peer IP addresses, preshared key, and encryption type and method. In this specific example, those three factors are the key of how Phase 1 process take place to verify security association establishment between sites that are about to setup secure connection over untrusted network. Phase 2 Once Phase 1 is passed successfully, then the setup process moves to the Phase 2. In general, Phase 2 deals with traffic management of the actual data communication between sites. There will be mechanism to determine which data goes where, encrypted or not. In Cisco security device, one mechanism factor is to use access list. An access list is used to specify or regulate which data (source and destination IP addresses or subnets) need to be encrypted or decrypted (going through the VPN tunnel). Similar to the Phase 1, there is also specific remote VPN peer IP addresses and IPSec VPN tunnel type and method only for the Phase 2. All the access list, remote VPN peer IP addresses, and the Phase 2 IPSec VPN tunnel type and method are statically configured into both VPN devices. The actual data passing (that are encrypted before leaving local VPN device to go to the remote VPN device; and are decrypted when arriving at local VPN device from the remote VPN device) are encapsulated within the Phase 2 IPSec VPN tunnel. In other word, the access list, VPN peer IP addresses, and IPSec VPN tunnel type and method are the key to establish the Phase 2. Once Phase 2 is established, the actual data between sites will be passing. Between Phase 1 and Phase 2 Note that only the Phase 2 involves the IPSec protocol, either ESP (Protocol 50) or AH (Protocol 51). Both Phase 1 (ISAKMP) and Phase 2 (IPSec) use specific encryption type (i.e. AES, 3DES, DES) and hash (MD5 or SHA). Specifically for Phase 1, there is the Diffie-Hellman group type (Group 1, 2, or 5) and the ISAKMP SA (Security Association) timeout or lifetime. Cisco Configuration Guide An Introduction to IP Security (IPSec) Encryption Virtual Private Networks with the Cisco PIX Firewall - Introduction and Implementation Illustration Let's review the following PIX IPSec VPN tunnel configuration To understand the complete picture, please review the PIX-to-PIX IPSec Fully Meshed Sample Configuration. Side Note: Further understanding regarding each PIX command and technology behind it, check out the following Cisco link: Cisco PIX Firewall Command Reference Version 6.3 Note that from VPN connection perspective, the actual data can only be passing between two sites when followings are met (in addition of other basic interconnectivity requirement) * Phase 1 is established: matching VPN peer IP address, preshared key, Phase 1 encryption type and method * Phase 2 is established: matching VPN peer IP address, access list, Phase 2 IPSec type and method * Proper IP Routing is in place: either by static routes or by dynamic routing protocol In other words, configuration between two VPN devices must match. Sample Configurations Following is sample configuration of site-to-site IPSec VPN tunnel between two sites. As to full mesh (or partially mesh) site-to-site VPN involving three or more sites, it is basically similar setup as the single site-to-site VPN between two sites. You just need to setup the tunnel one by one; between 1st and 2nd sites, between 1st and 3rd sites, between 2nd and 3rd sites, and so on. Specifically in setting up IPSec tunnel on Cisco router, PIX, or ASA in hub and spoke, partially mesh, or fully mesh setup that involve three or more sites; you need to use different sequence number of "crypto map" command for each remote VPN IP address and specific access list that regulate the encrypted traffic. The PIX-to-PIX sample configuration illustrates that. PIX to PIX Configuring PIX to PIX to PIX IPSec Fully Meshed Router to Router 1. Basic Configuration Configuring Router-to-Router IPSec Using AES Encryption Configuring IPSec Between Three Routers Using Split Tunneling Configuring IPSec Router-to-Router Hub and Spoke Configuring IPSec Router-to-Router Hub and Spoke with Communication Between the Spokes Configuring IPSec Router-to-Router Fully Meshed 2. Extended Configuration Configuring an IPSec Tunnel through a Firewall with NAT Configuring a Router IPsec Tunnel Private-to-Private Network with NAT and a Static Configuring an IPSec Tunnel Between Routers with Duplicate LAN Subnets Configuring IPSec Router-to-Router, Pre-shared, NAT Overload Between a Private and a Public Network Configuring a Router-to-Router LAN-to-LAN Tunnel with a Router Initiating IKE Aggressive Mode Configuring an IPsec Router Dynamic LAN-to-LAN Peer and VPN Clients Router to VPN 3000 Concentrator Configuring the Cisco VPN 3000 Concentrator to a Cisco Router EZ VPN PIX to Router http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a0080094498.shtml PIX to VPN 3000 Concentrator http://www.cisco.com/en/US/products/hw/vpndevc/ps2284/products_configuration_example09186a00800949d2.shtml PIX to Checkpoint 4.1 Firewall http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a008009420f.shtml PIX to Checkpoint NG Firewall http://www.cisco.com/en/US/tech/tk583/tk372/technologies_configuration_example09186a00800ef796.shtml PIX to Juniper Netscreen Firewall http://www.cisco.com/en/US/tech/tk583/tk372/technologies_configuration_example09186a00801c4445.shtml PIX to Sonicwall http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a008052c9d4.shtml PIX to Zywall »Cisco Forum FAQ »How do I configure a Zywall/Pix ipsec VPN Various Cisco Devices to Microsoft Windows server http://www.cisco.com/en/US/tech/tk583/tk372/technologies_configuration_example09186a00800b12b5.shtml Some discussions »[Config] Configuring More Than 1 VPN Tunnel (871w) Basic Troubleshooting 1. Phase 2 (IPSec - the actual data passing) * Make sure the data source and destination IP addresses or subnets match the regulating access list * Check the data passing process between the two sites. In Cisco equipment, you can issue the show crypto ipsec sa command or feature which will show the SA (Security Association) between encrypted traffic (outgoing data) and decrypted traffic (incoming data) 2. Phase 1 (ISAKMP - the key) * Assuming you use preshared key, make sure the remote VPN peer IP address and key match between two VPN device configuration * Check the Phase 1 VPN tunnel up/down status between two sites. In Cisco equipment, you can issue the show crypto isakmp sa command or feature which will show the up/down tunnel status between local VPN peer IP address and remote VPN peer IP address. * Issue simple connection test to the remote site (the remote VPN peer IP address) such as ICMP ping and traceroute (whenever possible) * Reboot one or both VPN devices sometime might solve VPN connectivity issue Further Reading: VPN Tunnel To Support Non-IP traffic and/or Dynamic Routing Protocols: GRE over IPSec »Cisco Forum FAQ »Private Routing over VPN: GRE over IP Sec by aryoba | ||
| The network layout that this configuration works for is 192.168.0.0 /24 -> Zywall 2x -> Speedstream 5100(PPOE)->internet ->Cisco 1720 -> x.x.x.192 /26 public ip pool -> Pix 501 -> 192.168.1.0 /24 The outside interface of the Pix is x.x.x.194 Pix config MYCOFW# write t PIX Version 6.1(2) nameif ethernet0 outside security0 nameif ethernet1 inside security100 hostname MYCOFW domain-name MYCOMPANY.com access-list To-Internet permit ip 192.168.1.0 255.255.255.0 any access-list To-Internet permit ip 192.168.2.0 255.255.255.0 any access-list To-Internet permit icmp any any access-list From-Internet permit tcp any host x.x.x.196 eq smtp access-list From-Internet permit icmp any x.x.x.192 255.255.255.192 echo access-list From-Internet permit icmp any x.x.x.192 255.255.255.192 echo-reply access-list From-Internet permit icmp any x.x.x.192 255.255.255.192 unreachable access-list From-Internet permit icmp any x.x.x.192 255.255.255.192 time-exceeded access-list NoNAT permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0 access-list NoNAT permit ip 192.168.1.0 255.255.255.0 192.168.0.0 255.255.255.0 access-list to-internet permit icmp any any interface ethernet0 10baset interface ethernet1 10full mtu outside 1500 mtu inside 1500 ip address outside x.x.x.194 255.255.255.192 ip address inside 192.168.1.25 255.255.255.0 ip local pool MYCOippool 192.168.2.1-192.168.2.254 global (outside) 1 x.x.x.200-x.x.x.250 netmask 255.255.255.192 global (outside) 1 x.x.x.251 nat (inside) 0 access-list NoNAT nat (inside) 1 192.168.1.0 255.255.255.0 0 0 access-group From-Internet in interface outside access-group To-Internet in interface inside route outside 0.0.0.0 0.0.0.0 x.x.x.193 1 http 192.168.1.0 255.255.255.0 inside sysopt connection permit-ipsec sysopt connection permit-pptp no sysopt route dnat crypto ipsec transform-set MyCOTransf esp-3des esp-md5-hmac crypto dynamic-map MYCOdynmap 10 set transform-set MYCOTransf crypto map MYCOmap 10 ipsec-isakmp dynamic MYCOdynmap crypto map MYCOmap client configuration address initiate crypto map MYCOmap client configuration address respond crypto map MYCOmap interface outside isakmp enable outside isakmp key ******** address 0.0.0.0 netmask 0.0.0.0 no-xauth no-config-mode isakmp identity address isakmp client configuration address-pool local MYCOippool outside isakmp policy 10 authentication pre-share isakmp policy 10 encryption 3des isakmp policy 10 hash md5 isakmp policy 10 group 2 isakmp policy 10 lifetime 28800 vpngroup MYCOvpn address-pool NONATippool vpngroup MYCOvpn dns-server 205.171.3.65 vpngroup MYCOvpn wins-server 192.168.1.1 vpngroup MYCOvpn default-domain MYCOMPANY.com vpngroup MYCOvpn idle-time 1800 vpngroup MYCOvpn password ******** vpngroup MYCO address-pool NONATippool vpngroup MYCO dns-server 192.168.1.1 205.171.3.65 vpngroup MYCO wins-server 192.168.1.1 vpngroup MYCO default-domain MYCO.com vpngroup MYCO idle-time 1800 vpngroup MYCO password ******** vpdn group 1 accept dialin pptp vpdn group 1 ppp authentication pap vpdn group 1 ppp authentication chap vpdn group 1 ppp authentication mschap vpdn group 1 client configuration address local NONATippool vpdn group 1 pptp echo 60 vpdn group 1 client authentication local vpdn username xxxx password xxxx vpdn username yyyy password yyyyy vpdn username zzzz password zzzzz vpdn enable outside Zywall Config: Menu 27.1.1 - IPSec Setup Index #= 1 Name= Work Active= Yes Keep Alive= Yes Nat Traversal= No Local ID type= IP Content= My IP Addr= 0.0.0.0 Peer ID type= IP Content= x.x.x.194 Secure Gateway Address= x.x.x.194 Protocol= 17 Local: Addr Type= SUBNET IP Addr Start= 192.168.0.0 End/Subnet Mask= 255.255.255.0 Port Start= 0 End= N/A Remote: Addr Type= SUBNET IP Addr Start= 192.168.1.0 End/Subnet Mask= 255.255.255.0 Port Start= 0 End= N/A Enable Replay Detection= Yes Key Management= IKE Menu 27.1.1.1 - IKE Setup Phase 1 Negotiation Mode= Main PSK= ******** Encryption Algorithm= 3DES Authentication Algorithm= MD5 SA Life Time (Seconds)= 28800 Key Group= DH2 Phase 2 Active Protocol= ESP Encryption Algorithm= 3DES Authentication Algorithm= MD5 SA Life Time (Seconds)= 28800 Encapsulation= Tunnel Perfect Forward Secrecy (PFS)= None In addition I had to enable 2 firewall rules on the Zywall Wan/WanZywall interface. 1) Source address (x.x.x.192 255.255.255.192) Destination (Any) forward Any Tcp Any Udp 2) source address (Any) Destination (Any) forward (ike,gre,ah,esp) I also include icmp & auth, though I don't think these are necessary for the vpn, they help with dslr line monitoring & my mail server. ![]() by TerryMiller edited by aryoba | ||
| PIX passing IPSec tunnel Configuring an IPSec Tunnel through a PIX Firewall with NAT GRE passing over PIX-to-PIX IPSec tunnel to support OSPF Configuring a GRE Tunnel over IPSec with OSPF IPSec tunnel passthrough on NAT/PAT Device and Utilize Single Public IP Address For Both Internet and IPSec Tunnel 1. Router as the NAT/PAT Device IOS Router to Pass a LAN-to-LAN IPSec Tunnel via PAT 2. PIX Firewall as the NAT/PAT Device »www.cisco.com/en/US/tech/tk583/t···6e.shtml by aryoba | ||
| Suggested prerequisite reading: »Cisco Forum FAQ »Setting Up Private Site-To-Site Connections »Cisco Forum FAQ »Between GRE/IPSEC and IPSEC VPN tunnels When you need to broadcast private routing (dynamic routing protocols) over VPN, then in general you need to run GRE over IP Sec. Followings are the sample configurations. Running OSPF Configuring a GRE Tunnel over IPSec with OSPF Running EIGRP GRE over IPSec with EIGRP to Route Through a Hub and Multiple Remote Sites IPX Routing over GRE/IPSec Configuring GRE and IPSec with IPX Routing Configuring IPSec with EIGRP and IPX Using GRE Tunneling Note: The previous sample configurations assume both the GRE and IPSec VPN terminate at a router. When somehow the router IOS image feature only supports GRE tunnel and there will be a PIX Firewall in front of the router to establish the IPSec tunnel, then you can check out the following FAQ for illustrations. »Cisco Forum FAQ »PAT/NAT Router/PIX passing through VPN tunnel For full mesh site-to-site VPN with the above GRE over IPSec approach involving three sites or more, it is basically similar setup as the single site-to-site VPN between two sites. You just need to setup the tunnel one by one; between 1st and 2nd sites, between 1st and 3rd sites, between 2nd and 3rd sites, and so on. DMVPN When Cisco routers act as the VPN device at all sites, it is simpler and scalable to run DMVPN between routers instead the previous GRE over IPSec approach. With DMVPN, there will be no need to manually setup each tunnel for each connection between two sites. DMVPN will be "dynamically" setting up necessary tunnels. Should you decide to run DMVPN, verify your router IOS image version support it. IOS image version with Advanced Enterprise (or probably Advanced IP Services) feature should support DMVPN. Check out following links for more info on DMVPN. Dynamic Multipoint IPsec VPNs (Using Multipoint GRE/NHRP to Scale IPsec VPNs) Configuring DMVPN Spoke Router in Full Mesh IPsec VPN Using SDM Configuring Dynamic Multipoint VPN Using GRE Over IPsec With OSPF, NAT, and Cisco IOS Firewall New Feature on ASA or PIX Firewall running OS version 7.x or later With new OS version, it is no longer requirement to encapsulate OSPF into GRE tunnel in order to pass it through IPSec VPN tunnel. By running OS version 7.x or later, ASA or PIX Firewall is now able to pass OSPF through IPSec VPN tunnel just like pass through GRE or any IP traffic. Check out the following link for sample configuration. PIX/ASA 7.x and later: VPN/IPsec with OSPF Configuration Example by aryoba | ||