以前单位同事一次DHCP snooping排错经历

非常有意义的排错经历,关于option82请在本站中查找以前的文章,有专门的解释。

 

环境

PC—cisco 2960 —cisco 6506(dhcp server)

这两天一直在测试,在cisco 2960开启 ip dhcp snooping 功能,下面的PC就获取不到地址

在cisco 2960上抓包,发现dhcp_snooping工作正常,可以收到PC的dhcpdiscovery包,dhcp giaddr字段 0.0.0.0。
在 cisco 6506 上抓包 ,cisco 2960 送上来的dhcp请求包 被 丢弃了。

原因是:

由于默认情况下cisco 2960 ip dhcp snooping information option 是打开的,此时交换机会在PC来的DHCP请求报文中插入option82内容,又由于cisco 6506 DHCP服务器与PC处于同一个VLAN中,所以请求没有经过中继代理

对于cisco 6506 DHCP服务器来说,如果它收到的DHCP请求被插入了option82,那么它会认为这是一个从中继代理过来的请求报文,但是它检查了该报文的giaddr字段却又发现是0.0.0.0,而不是一个有效的IP地址,因此该报文被认为“非法”,所以将被丢弃。

解决方法 1
在cisco 6506 上开启 中继代理 信任Received DHCP packet may contain relay info option with zero giaddr
在全局下
ip dhcp relay information

解决方法 2
在cisco 2960 上关闭option82功能,因为我们这里接入交换机和dhcp server不用跨网段中继 dhcp 报文。
在全局下
no ip dhcp snooping information option

IPSEC VPN上跑组播

2、GRE隧道:  
IPSEC的问题:只支持单播流量,组播和广播流量是不会穿过数据SA的。
GRE原理:将一个完整的组播和广播数据包封装在一个单播数据包(IPSEC)里,以处理如OSPF的组播或
RIP的广播数据流,以完成对端的动态路由学习。
cisco对GRE的应用,本质是:GRE处理广播、组播、非IP数据流,而IPSEC提供单播框架保护 ,以便在IP
骨干网上传输。

拓扑图:
192.168.1.0/24/R1/192.1.1.1——WAN——193.1.1.1/R2/192.168.2.0/24  
                                     |————————————————|
                                      192.168.3.1/GRE隧道/192.168.3.2               

回顾:IPSEC需要使用的协议,被ACL放行              
管理连接使用的是UDP端口500
AH和ESP不使用端口,使用协议51和50
NAT-T使用的是UDP端口4500
IPSEC-OVER-UDP使用的是UDP端口10000
IPSEC-OVER-TCP使用的是TCP端口10000
在后三者中,被用来处理NAT、PAT对IPSEC造成的影响,如果同时被配置,IPSEC-OVER-TCP优先于NAT-T,

NAT-T优先于IPSEC-OVER-UDP ,NAT-T由cisco开发,已成为开放标准,默认在高IOS版本的cisco路由器上

是开启的
因此应当始终遵循的是:在IPSEC架构中,这些流量必须被ACL放行。
ACL语句示例如:
per udp host 1.1.1.1 host 2.2.2.2 eq 500
per esp host 1.1.1.1 host 2.2.2.2
per gre host 1.1.1.1 host 2.2.2.2
在路由器上如果NAT-T被关闭,使用cry ipsec nat-tans udp-encaps命令开启

在此例中,有三个问题需要处理:
1、WAN是IP骨干网,GRE使用IPX300
2、两端运行动态路由协议,需要相互学习
3、端点之间流量需要被保护

配置要点:
1、两端配置GRE隧道,很简单,使用tunnel虚拟接口,指定源和目的端,以处理IP和IPX的问题。
2、将虚拟接口IP地址通告到动态路由协议中,动态路由协议将通过TUNNEL网络学习到对端的路由。
3、配置IPSEC,这里很简单,cry acl只需要保护TUNNRL流量即可。在一个点到点的连接中,        IPSEC使用传输模式
4、记得在外部接口允许IPSEC和GRE的流量

基本配置:提示,上面是一个标准拓扑,在实验中我做了简化,这里密钥WAN中的设备存在,两端的WAN接口是处在同一网段的。
R1:
crypto isakmp policy 10
authentication pre-share
group 2
crypto isakmp key cisco123 address 192.1.1.2
!
!
crypto ipsec transform-set cisco esp-des esp-sha-hmac
!
crypto map mymap 10 ipsec-isakmp
set peer 192.1.1.2
set transform-set cisco
match address 101

!interface Loopback0
ip address 192.168.1.1 255.255.255.0
!
interface Tunnel0
ip address 193.1.1.1 255.255.255.0
tunnel source 192.1.1.1
tunnel destination 192.1.1.2
配置TUNNEL
!
interface FastEthernet0/0
ip address 192.1.1.1 255.255.255.0
duplex half
crypto map mymap

router ospf 1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
network 193.1.1.0 0.0.0.255 area 1
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

access-list 101 permit gre host 192.1.1.1 host 192.1.1.2
注意:这里的ACL既不是私有网络,也不是GRE通告的网络,而是WAN接口!
!

R2:
crypto isakmp policy 10
authentication pre-share
group 2
crypto isakmp key cisco123 address 192.1.1.1

crypto ipsec transform-set cisco esp-des esp-sha-hmac
!
crypto map mymap 10 ipsec-isakmp
set peer 192.1.1.1
set transform-set cisco
match address 101

interface Tunnel0
ip address 193.1.1.2 255.255.255.0
tunnel source 192.1.1.2
tunnel destination 192.1.1.1

!
interface FastEthernet0/0
ip address 192.1.1.2 255.255.255.0
duplex half
crypto map mymap

interface FastEthernet2/0
ip address 10.1.1.2 255.255.255.0
duplex half
!
router ospf 1
no log-adjacency-changes
network 10.1.1.0 0.0.0.255 area 1
network 193.1.1.0 0.0.0.255 area 1
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

access-list 101 permit gre host 192.1.1.2 host 192.1.1.1

R2#sh ip rou
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

             10.0.0.0/24 is subnetted, 1 subnets
C               10.1.1.0 is directly connected, FastEthernet2/0
C            193.1.1.0/24 is directly connected, Tunnel0
C            192.1.1.0/24 is directly connected, FastEthernet0/0
             192.168.1.0/32 is subnetted, 1 subnets
O IA            192.168.1.1 [110/11112] via 193.1.1.1, 00:48:05, Tunnel0
S*           0.0.0.0/0 is directly connected, FastEthernet0/0
检查R2路由表,得到R1的内部网络路由,通过TUNNEL学习到。但是并不学习到WAN的路由,因为在OSPF中不需要通告WAN接口的路由条目。

这里有个关键的地方:
CRY ACL的解析:为什么不像普通的IPSEC,目标网络和源网络都设置成为私有网络呢?它是怎么来保护私有网络?这里的ACL设置为WAN的端点,WAN也需要保护吗?难道GRE想和WAN去私底下约会?
当CRY ACL被触发的时候,它调用TUNNEL(因为TUNNEL的源和目标设置的是WAN端点),TUNNEL接下来调用OSPF进程里面的私有网络,最终私有网络得到保护,GRE同样保护OSPF的组播流如HELL包,也就是说,不像普通的单播的IPSEC,当有单播数据流(如两端私有用户通话使用单播)的时候才触发VPN,这里的VPN总是被触发的,因为它要处理多播流量如OSPF每10S一次的HELLO包

NAT-WITH ACL OR ROUTE-MAP

When NAT uses a route map to decide to create a translation entry, it will always create a "fully extended" translation entry. This translation entry will contain both the inside and outside (local and global) address entries and any TCP or UDP port information. Refer to NAT: Local and Global Definitions for more information on inside and outside (local and global) addresses.

 

Access Lists (no overload)

When NAT uses an access list to decide to create a translation entry, it will create a "simple" translation entry. This "simple" entry will only contain local and global IP address entries for just the inside or outside depending on whether the ip nat inside or ip nat outside command is configured. Also, it will not include any TCP or UDP port information.

Access Lists (with overload)

When NAT uses an access list, and overload has also been specified, NAT will create a "fully extended" translation entry. (Refer to Note1 ). The operation is similar to the route-map case except that route-map has some additional features. Refer to Note 2 for more details. You can see an example of a simple NAT translation entry and a fully extended NAT translation entry by selecting one of the links below:

ICMP TYPE CODE 对应表

ICMP类型

TYPE CODE Description Query Error
0 0 Echo Reply——回显应答(Ping应答) x  
3 0 Network Unreachable——网络不可达   x
3 1 Host Unreachable——主机不可达   x
3 2 Protocol Unreachable——协议不可达   x
3 3 Port Unreachable——端口不可达   x
3 4 Fragmentation needed but no frag. bit set——需要进行分片但设置不分片比特   x
3 5 Source routing failed——源站选路失败   x
3 6 Destination network unknown——目的网络未知   x
3 7 Destination host unknown——目的主机未知   x
3 8 Source host isolated (obsolete)——源主机被隔离(作废不用)   x
3 9 Destination network administratively prohibited——目的网络被强制禁止   x
3 10 Destination host administratively prohibited——目的主机被强制禁止   x
3 11 Network unreachable for TOS——由于服务类型TOS,网络不可达   x
3 12 Host unreachable for TOS——由于服务类型TOS,主机不可达   x
3 13 Communication administratively prohibited by filtering——由于过滤,通信被强制禁止   x
3 14 Host precedence violation——主机越权   x
3 15 Precedence cutoff in effect——优先中止生效   x
4 0 Source quench——源端被关闭(基本流控制)    
5 0 Redirect for network——对网络重定向    
5 1 Redirect for host——对主机重定向    
5 2 Redirect for TOS and network——对服务类型和网络重定向    
5 3 Redirect for TOS and host——对服务类型和主机重定向    
8 0 Echo request——回显请求(Ping请求) x  
9 0 Router advertisement——路由器通告    
10 0 Route solicitation——路由器请求    
11 0 TTL equals 0 during transit——传输期间生存时间为0   x
11 1 TTL equals 0 during reassembly——在数据报组装期间生存时间为0   x
12 0 IP header bad (catchall error)——坏的IP首部(包括各种差错)   x
12 1 Required options missing——缺少必需的选项   x
13 0 Timestamp request (obsolete)——时间戳请求(作废不用) x  
14   Timestamp reply (obsolete)——时间戳应答(作废不用) x  
15 0 Information request (obsolete)——信息请求(作废不用) x  
16 0 Information reply (obsolete)——信息应答(作废不用) x  
17 0 Address mask request——地址掩码请求 x  
18 0 Address mask reply——地址掩码应答 x

Configuring Unicast Reverse Path Forwarding

Table Of Contents

Configuring Unicast Reverse Path Forwarding

In This Chapter

About Unicast Reverse Path Forwarding

How Unicast RPF Works

Implementing Unicast RPF

Restrictions

Related Features and Technologies

Prerequisites to Configuring Unicast RPF

Unicast RPF Configuration Task List

Configuring Unicast RPF

Verifying Unicast RPF

Troubleshooting Tips

HSRP Failure

Dropped Boot Requests

Monitoring and Maintaining Unicast RPF

Unicast RPF Configuration Examples

Unicast RPF on a Leased-Line Aggregation Router Example

Unicast RPF on the Cisco AS5800 Using Dialup Ports Example

Unicast RPF with Inbound and Outbound Filters Example

Unicast RPF with ACLs and Logging Example


Configuring Unicast Reverse Path Forwarding


This chapter describes the Unicast Reverse Path Forwarding (Unicast RPF) feature. The Unicast RPF feature helps to mitigate problems that are caused by malformed or forged IP source addresses that are passing through a router.

For a complete description of the Unicast RPF commands in this chapter, refer to the chapter "Unicast Reverse Path Forwarding Commands" of the Cisco IOS Security Command Reference. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online.

To identify the hardware platform or software image information associated with a feature, use the Feature Navigator on Cisco.com to search for information about the feature or refer to the software release notes for a specific release. For more information, see the "Identifying Supported Platforms" section in the chapter "Using Cisco IOS Software."


In This Chapter

This chapter has the following sections:

About Unicast Reverse Path Forwarding

Unicast RPF Configuration Task List

Troubleshooting Tips

Monitoring and Maintaining Unicast RPF

Unicast RPF Configuration Examples


About Unicast Reverse Path Forwarding

The Unicast RPF feature helps to mitigate problems that are caused by the introduction of malformed or forged (spoofed) IP source addresses into a network by discarding IP packets that lack a verifiable IP source address. For example, a number of common types of denial-of-service (DoS) attacks, including Smurf and Tribal Flood Network (TFN), can take advantage of forged or rapidly changing source IP addresses to allow attackers to thwart efforts to locate or filter the attacks. For Internet service providers (ISPs) that provide public
access, Unicast RPF deflec
ts such attacks by forwarding only packets that have source addresses that are valid and consistent with the IP routing table. This action protects the network of the ISP, its customer, and the rest of the Internet.

This section covers the following information:

How Unicast RPF Works

Implementing Unicast RPF

Restrictions

Related Features and Technologies

Prerequisites to Configuring Unicast RPF


How Unicast RPF Works

When Unicast RPF is enabled on an interface, the router examines all packets received as input on that interface to make sure that the source address and source interface appear in the routing table and match the interface on which the packet was received. This "look backwards" ability is available only when Cisco express forwarding (CEF) is enabled on the router, because the lookup relies on the presence of the Forwarding Information Base (FIB). CEF generates the FIB as part of its operation.


Note Unicast RPF is an input function and is applied only on the input interface of a router at the upstream end of a connection.


Unicast RPF checks to see if any packet received at a router interface arrives on the best return path (return route) to the source of the packet. Unicast RPF does this by doing a reverse lookup in the CEF table. If the packet was received from one of the best reverse path routes, the packet is forwarded as normal. If there is no reverse path route on the same interface from which the packet was received, it might mean that the source address was modified. If Unicast RPF does not find a reverse path for the packet, the packet is dropped or forwarded, depending on whether an access control list (ACL) is specified in the ip verify unicast reverse-path interface configuration command.


Note With Unicast RPF, all equal-cost "best" return paths are considered valid. This means that Unicast RPF works in cases where multiple return paths exist, provided that each path is equal to the others in terms of the routing cost (number of hops, weights, and so on) and as long as the route is in the FIB. Unicast RPF also functions where EIGRP variants are being used and unequal candidate paths back to the source IP address exist.


When a packet is received at the interface where Unicast RPF and ACLs have been configured, the following actions occur:

两种技术同时存在时,先执行入向的ACL检查,在检查U RPF,RPF通过的,再被出向ACL检查


Step 1 Input ACLs configured on the inbound interface are checked.

Step 2 Unicast RPF checks to see if the packet has arrived on the best return path to the source, which it does by doing a reverse lookup in the FIB table.

Step 3 CEF table (FIB) lookup is carried out for packet forwarding.

Step 4 Output ACLs are checked on the outbound interface.

Step 5 The packet is forwarded.


This section provides information about Unicast RPF enhancements:

Access Control Lists and Logging

Per-Interface Statistics


Access Control Lists and Logging

If an ACL is specified in the command, then when (and only when) a packet fails the Unicast RPF check, the ACL is checked to see if the packet should be dropped (using a deny statement in the ACL) or forwarded (using a permit statement in the ACL). Whether a packet is dropped or forwarded, the packet is counted in the global IP traffic statistics for Unicast RPF drops and in the interface statistics for Unicast RPF.

如果URPF命令中带了ACL,则RPF检查是非法的包后再由ACL决定是转发还是丢弃

If no ACL is specified in the Unicast RPF command, the router drops the forged or malformed packet immediately and no ACL logging occurs. The router and interface Unicast RPF counters are updated.

Unicast RPF events can be logged by specifying the logging option for the

ACL entries used by the Unicast RPF command. Using the log information, administrators can see what source addresses are being used in the attack, the time the packets arrived at the interface, and so on.


Caution Logging requires CPU and memory resources. Logging Unicast RPF events for attacks having a high rate of forged packets can degrade the performance of the router.


Per-Interface Statistics

Each time a packet is dropped or forwarded at an interface, that information is counted two ways: globally on the router and at each interface where you have applied Unicast RPF. Global statistics on dropped packets provide information about potential attacks on the network; however, these global statistics do not help to specify which interface is the source of the attack.

Per-interface statistics allow network administrators to track two types of information about malformed packets: Unicast RPF drops and Unicast RPF suppressed drops. Statistics on the number of packets that Unicast RPF drops help to identify the interface that is the entry point of the attack. The Unicast RPF drop count tracks the number of drops at the interface. The Unicast RPF suppressed drop count tracks the number of packets that failed the Unicast RPF check but were forwarded because of the permit permission set up in the ACL. Using the drop count and suppressed drop count statistics, a network administrator can takes steps to isolate the attack at a specific interface.


Note Judicious use of ACL logging can further identify the address or addresses that are being dropped by Unicast RPF.


Figure 107 illustrates how Unicast RPF and CEF work together to validate IP source addresses by verifying packet return paths. In this example, a customer has sent a packet having a source address of 192.168.1.1 from interface FDDI 2/0/0. Unicast RPF checks the FIB to see if 192.168.1.1 has a path to FDDI 2/0/0. If there is a matching path, the packet is forwarded. If there is no matching path, the packet is dropped.

Figure 107 Unicast RPF Validating IP Source Addresses

 

 

Figure 108 illustrates how Unicast RPF drops packets that fail validation. In this example, a customer has sent a packet having a source address of 209.165.200.225, which is received at interface FDDI 2/0/0. Unicast RPF checks the FIB to see if 209.165.200.225 has a return path to FDDI 2/0/0. If there is a matching path, the packet is forwarded. In this case, there is no reverse entry in the routing table that routes the customer packet back to source address 209.165.200.225 on interface FDDI 2/0/0, and so the packet is dropped.

Figure 108 Unicast RPF Dropping Packets That Fail Verification

 

 


Implementing Unicast RPF

Unicast RPF has several key implementation principles:

The packet must be received at an interface that has the best return path (route) to the packet source (a process called symmetric routing). There must be a route in the FIB matching the route to the receiving interface. Adding a route in the FIB can be done via static route, network statement, or dynamic routing. (ACLs permit Unicast RPF to be used when packets are known to be arriving by specific, less optimal asymmetric input paths.)

IP source addresses at the receiving interface must match the routing entry for the interface.

Unicast RPF is an input function and is applied only on the input interface of a router at the upstream end of a connection.

Given these implementation principles, Unicast RPF becomes a tool that network administrators can use not only for their customers but also for their downstream network or ISP, even if the downstream network or ISP has other connections to the Internet.


Caution Using optional BGP attributes such as weight and local preference, the best path back to the source address can be modified. Modification would affect the operation of Unicast RPF.

This section provides information about the implementation of Unicast RPF:

Security Policy and Unicast RPF

Where to Use Unicast RPF

Routing Table Requirements

Where Not to Use Unicast RPF

rder="0" src="http://www.cisco.com/univercd/illus/images/blank.gif" /> Unicast RPF with BOOTP and DHCP


Security Policy and Unicast RPF

Consider the following points in determining your policy for deploying Unicast RPF:

Unicast RPF must be applied at the interface downstream from the larger portion of the network, preferably at the edges of your network.

The further downstream you apply Unicast RPF, the finer the granularity you have in mitigating address spoofing and in identifying the sources of spoofed addresses. For example, applying Unicast RPF on an aggregation router helps mitigate attacks from many downstream networks or clients and is simple to administer, but it does not help identify the source of the attack. Applying Unicast RPF at the network access server helps limit the scope of the attack and trace the source of the attack; however, deploying Unicast RPF across many sites does add to the administration cost of operating the network.

The more entities that deploy Unicast RPF across Internet, intranet, and extranet resources, the better the chances of mitigating large-scale network disruptions throughout the Internet community, and the better the chances of tracing the source of an attack.

Unicast RPF will not inspect IP packets encapsulated in tunnels, such as GRE, LT2P, or PPTP. Unicast RPF must be configured at a home gateway so that Unicast RPF processes network traffic only after the tunneling and encryption layers have been stripped off the packets.


Where to Use Unicast RPF

Unicast RPF can be used in any "single-homed" environment where there is essentially only one access point out of the network; that is, one upstream connection. Networks having one access point offer the best example of symmetric routing, which means that the interface where a packet enters the network is also the best return path to the source of the IP packet. Unicast RPF is best used at the network perimeter for Internet, intranet, or extranet environments, or in ISP environments for customer network terminations.

The following sections provide a look at implementing Unicast RPF in two network environments:

Enterprise Networks with a Single Connection to an ISP

Network Access Server Application (Applying Unicast RPF in PSTN/ISDN PoP Aggregation Routers)


Enterprise Networks with a Single Connection to an ISP

In enterprise networks, one objective of using Unicast RPF for filtering traffic at the input interface (a process called ingress filtering) is for protection from malformed packets arriving from the Internet. Traditionally, local networks that have one connection to the Internet would use ACLs at the receiving interface to prevent spoofed packets from the Internet from entering their local network.

ACLs work well for many single-homed customers; however, there are trade-offs when ACLs are used as ingress filters, including two commonly referenced limitations:

Packet per second (PPS) performance at very high packet rates

Maintenance of the ACL (whenever there are new addresses added to the network)

Unicast RPF is one tool that addresses both of these limitations. With Unicast RPF, ingress filtering is done at CEF PPS rates. This processing speed makes a difference when the link is more than 1 Mbps. Additionally, since Unicast RPF uses the FIB, no ACL maintenance is necessary, and thus the administration overhead of traditional ACLs is reduced. The following figure and example demonstrate how Unicast RPF is configured for ingress filtering.

Figure 109 illustrates an enterprise network that has a single link to an upstream ISP. In this example, Unicast RPF is applied at interface S0 on the enterprise router for protection from malformed packets arriving from the Internet. Unicast RPF is also applied at interface S5/0 on the ISP router for protection from malformed packets arriving from the enterprise network.

Figure 109 Enterprise Network Using Unicast RPF for Ingress Filtering

 

 

Using the topography in Figure 109, a typical configuration (assuming that CEF is turned on) on the ISP router would be as follows:

ip cef

interface loopback 0

  description Loopback interface on Gateway Router 2

  ip address 192.168.3.1 255.255.255.255

  no ip redirects

  no ip directed-broadcast

  no ip proxy-arp

interface Serial 5/0

  description 128K HDLC link to ExampleCorp WT50314E  R5-0

  bandwidth 128

  ip unnumbered loopback 0

  ip verify unicast rever

se-path

  no ip redirects

  no ip directed-broadcast

  no ip proxy-arp

ip route 192.168.10.0 255.255.252.0 Serial 5/0

The gateway router configuration of the enterprise network (assuming that CEF is turned on) would look similar to the following:

ip cef

interface Ethernet 0

 description ExampleCorp LAN

 ip address 192.168.10.1 255.255.252.0

 no ip redirects

 no ip directed-broadcast

 no ip proxy-arp

interface Serial 0

 description 128K HDLC link to ExampleCorp Internet Inc WT50314E  C0

 bandwidth 128

 ip unnumbered ethernet 0

 ip verify unicast reverse-path

 no ip redirects

 no ip directed-broadcast

 no ip proxy-arp

ip route 0.0.0.0 0.0.0.0 Serial 0

Notice that Unicast RPF works with a single default route. There are no additional routes or routing protocols. Network 192.168.10.0/22 is a connected network. Hence, packets coming from the Internet with a source address in the range 192.168.10.0/22 will be dropped by Unicast RPF.

缺省路由下的URPF还是需要配合ACL才能有效果,否则能检测的网络比较少


Network Access Server Application (Applying Unicast RPF in PSTN/ISDN PoP Aggregation Routers)

Aggregation routers are ideal places to use Unicast RPF with single-homed clients. Unicast RPF works equally well on leased-line or PSTN/ISDN/xDSL customer connections into the Internet. In fact, dialup connections are reputed to be the greatest source of DoS attacks using forged IP addresses. As long as the network access server supports CEF, Unicast RPF will work. In this topology, the customer aggregation routers need not have the full Internet routing table. Aggregation routers need the routing prefixes information (IP address block); hence, information configured or redistributed in the Interior Gateway Protocol (IGP) or Internal Border Gateway Protocol (IBGP) (depending on the way that you add customer routes into your network) would be enough for Unicast RPF to do its job.

Figure 110 illustrates the application of Unicast RPF to the aggregation and access routers for an Internet service provider (ISP) point of presence (POP), with the ISP routers providing dialup customer connections. In this example, Unicast RPF is applied upstream from the customer dialup connection router on the receiving (input) interfaces of the ISP aggregation routers.

Figure 110 Unicast RPF Applied to PSTN/ISDN Customer Connections

 

 


Routing Table Requirements

To work correctly, Unicast RPF needs proper information in the CEF tables. This requirement does not mean that the router must have the entire Internet routing table. The amount of routing information needed in the CEF tables depends on where Unicast RPF is configured and what functions the router performs in the network. For example, in an ISP environment, a router that is a leased-line aggregation router for customers needs only the information based on the static routes redistributed into the IGP or IBGP (depending on which technique is used in the network). Unicast RPF would be configured on the customer interfaces—hence the requirement for minimal routing information. In another scenario, a single-homed ISP could place Unicast RPF on the gateway link to the Internet. The full Internet routing table would be required. Requiring the full routing table would help protect the ISP from external DoS attacks that use addresses that are not in the Internet routing table.


Where Not to Use Unicast RPF

Unicast RPF should not be used on interfaces that are internal to the network. Internal interfaces are likely to have routing asymmetry (see Figure 111), meaning multiple routes to the source of a packet. Unicast RPF should be applied only where there is natural or configured symmetry. As long as administrators carefully plan which interfaces they activate Unicast RPF on, routing asymmetry is not a serious problem.

For example, routers at the edge of the network of an ISP are more likely to have symmetrical reverse paths than routers that are in the core of the ISP network. Routers that are in the core of the ISP network have no guarantee that the best forwarding path out of the router will be the path selected for packets returning to the router. Hence, it is not recommended that you apply Unicast RPF where there is a chance of asymmetric routing, unless you use ACLs to allow the router to accept incoming packets. ACLs permit Unicast RPF to be used when packets are known to be arriving by specific, less optimal asymmetric input paths. However, it is simplest to place Unicast RPF only at the edge of a network or, for an ISP, at the customer edge of the network.

Figure 111 illustrates how Unicast RPF can block legitimate traffic in an asymmetrical routing environment.

Figure 111 Unicast RPF Blocking Traffic in an Asymmetrical Routing Environment

 

 


Unicast RPF with BOOTP and DHCP

Unicast RPF will allow packets with 0.0.0.0 source and 255.255.255.255 destination to pass so that Bootstrap Protocol (BOOTP) and Dynamic Host Co

nfiguration Protocol (DHCP) functions work properly. This enhancement was added in Cisco IOS Release 12.0 and later, but it is not in Cisco IOS Release 11.1CC.


Restrictions

There are some basic restrictions to applying Unicast RPF to multihomed clients:

Clients should not be multihomed to the same router because multihoming defeats the purpose of building a redundant service for the client.

Customers must ensure that the packets flowing up the link (out to the Internet) match the route advertised out the link. Otherwise, Unicast RPF filters those packets as malformed packets.

Unicast RPF is available only for platform images that support CEF. Unicast RPF is supported in Cisco IOS Releases 11.1(17)CC and 12.0 and later. It is not available in Cisco IOS Release 11.2 or 11.3.


Related Features and Technologies

For more information about Unicast RPF-related features and technologies, review the following:

Unicast RPF requires Cisco express forwarding (CEF) to function properly on the router. For more information about CEF, refer to the Cisco IOS Switching Services Configuration Guide.

Unicast RPF can be more effective at mitigating spoofing attacks when combined with a policy of ingress and egress filtering using Cisco IOS access control lists (ACLs).

Ingress filtering applies filters to traffic received at a network interface from either internal or external networks. With ingress filtering, packets that arrive from other networks or the Internet and that have a source address that matches a local network, private, or broadcast address are dropped. In ISP environments, for example, ingress filtering can apply to traffic received at the router from either the client (customer) or the Internet.

Egress filtering applies filters to traffic exiting a network interface (the sending interface). By filtering packets on routers that connect your network to the Internet or to other networks, you can permit only packets with valid source IP addresses to leave your network.

For more information on network filtering, refer to RFC 2267 and to the Cisco IOS IP Configuration Guide.

Cisco IOS software provides additional features that can help mitigate DoS attacks:

Committed Access Rate (CAR). CAR allows you to enforce a bandwidth policy against network traffic that matches an access list. For example, CAR allows you to rate-limit what should be low-volume traffic, such as ICMP traffic. To find out more about CAR, refer to the Cisco IOS Quality of Service Solutions Configuration Guide.

Context-based Access Control (CBAC). CBAC selectively blocks any network traffic not originated by a protected network. CBAC uses timeout and threshold values to manage session state information, helping to determine when to drop sessions that do not become fully established. Setting timeout values for network sessions helps mitigate DoS attacks by freeing up system resources, dropping sessions after a specified amount of time. For more information on CBAC, refer to the Cisco IOS Security Configuration Guide.

TCP Intercept. The TCP Intercept feature implements software to protect TCP servers from TCP SYN-flooding attacks, which are a type of DoS attack. A SYN-flooding attack occurs when a hacker floods a server with a barrage of requests for connection. Like CBAC, the TCP Intercept feature also uses timeout and threshold values to manage session state information, helping to determine when to drop sessions that do not become fully established. For more information on TCP Intercept, refer to the Cisco IOS Security Configuration Guide.


Prerequisites to Configuring Unicast RPF

Prior to configuring Unicast RPF, configure ACLs:

Configure standard or extended ACLs to mitigate transmission of invalid IP addresses (perform egress filtering). Permit only valid source addresses to leave your network and get onto the Internet. Prevent all other source addresses from leaving your network for the Internet.

Configure standard or extended ACLs entries to drop (deny) packets that have invalid source IP addresses (perform ingress filtering). Invalid source IP addresses include the following types:

Reserved addresses

Loopback addresses

Private addresses (RFC 1918, Address Allocation for Private Internets)

Broadcast addresses (including multicast addresses)

Source addresses that fall outside the range of valid addresses associated with the protected network

Configure standard or extended ACL entries to forward (permit) packets that fail the Unicast RPF checks to allow specific traffic from known asymmetric routed sources.

Configure ACLs to track Unicast RPF events by adding the logging option into the ACL command. During network attacks, judicious logging of dropped or forwarded packets (suppressed drops) can provide additional information about network attacks.


Unicast RPF Configuration Task List

The following sections describe the configuration tasks for Unicast RPF. Each task in the list is identified as either optional or required.

Configuring Unicast RPF (Required)

Verifying Unicast RPF (Optional)

See the section " Unicast RPF Configuration Examples" at the end of this chapter.


Configuring Unicast RPF

To use Unicast RPF, you must configure the router for CEF switching or CEF distributed switching. There is no need to configure the input interface for CEF switching because Unicast RPF has been implemented as a search through the FIB using the source IP address. As long as CEF is running on the router, individual interfaces can be configured with other switching modes. Unicast RPF is an input-side function that is enabled on an interface or subinterface that supports any type of encapsulation and operates on IP packets received by the router. It is very important that CEF be turned on globally in the router—Unicast RPF will not work without CEF.

To configure Unicast RPF, use the following commands beginning in global configuration mode:

 

 
Command
Purpose

Step 1 

Router(config)# ip cef


or

Router(config)# ip cef distributed

Enables CEF or distributed CEF on the router. Distributed CEF is required for routers that use a Route Switch Processor (RSP) and Versatile Interface Processor (VIP), which includes Unicast RPF.

You might want to disable CEF or distributed CEF (dCEF) on a particular interface if that interface is configured with a feature that CEF or dCEF does not support. In this case, you would enable CEF globally, but disable CEF on a specific interface using the no ip route-cache cef interface command, which enables all but that specific interface to use express forwarding. If you have disabled CEF or dCEF operation on an interface and want to reenable it, you can do so by using the ip route-cache cef command in interface configuration mode.

Step 2 

Router(config-if)# interface type

Selects the input interface on which you want to apply Unicast RPF. This is the receiving interface, which allows Unicast RPF to verify the best return path before forwarding the packet on to the next destination.

The interface type is specific to your router and the types of interface cards installed on the router. To display a list of available interface types, enter the interface ? command.

Step 3 

Router(config-if)# ip verify unicast reverse-path list

Enables Unicast RPF on the interface. Use the list option to identify an access list. If the access list denies network access, spoofed packets are dropped at the interface. If the access list permits network access, spoofed packets are forwarded to the destination address. Forwarded packets are counted in the interface statistics. If the access list includes the logging option, information about the spoofed packets is logged to the log server.

Repeat this step for each access list that you want specify.

Step 4 

Router(config-if)# exit

Exits interface configuration mode. Repeat Steps 2 and 3 for each interface on which you want to apply Unicast RPF.

 


Verifying Unicast RPF

To verify that Unicast RPF is operational, use the show cef interface command. The following example shows that Unicast RPF is enabled at interface serial2/0/0.

Router-3# show cef interface serial 2/0/0

Serial2/0/0 is up (if_number 8) 

 Internet address is 192.168.10.2/30

 ICMP redirects are never sent

 Per packet loadbalancing is disabled

!The next line displays Unicast RPF packet dropping information.

 IP unicast RPF check is enabled

 Inbound access list is not set

 Outbound access list is not set

 Interface is marked as point to point interface

 Packets switched to this interface on linecard are dropped to next slow path

 Hardware idb is Serial2/0/0

 Fast switching type 4, interface type 6

!The next line displays Unicast RPF packet dropping information.

 IP Distributed CEF switching enabled

 IP LES Feature Fast switching turbo vector

 IP Feature CEF switching turbo vector

 Input fast flags 0x40, Output fast flags 0x0, ifindex 7(7)

 Slot 2 Slot unit 0 VC -1

 Transmit limit accumulator 0x48001A02 (0x48001A02)

 IP MTU 1500


Troubleshooting Tips

If you experience problems while using Unicast RPF, check the following items.


HSRP Failure

Failure to disable Unicast RPF before disabling CEF can cause Hot Standby Router Protocol (HSRP) failure. If you want to disable CEF on the router, you must first disable Unicast RPF. To disable Unicast RPF, see the section " Monitoring and Maintaining Unicast RPF."


Dropped Boot Requests

In Cisco IOS Release 11.1(17)CC, Unicast RPF can drop BOOTP request packets that have a source address of 0.0.0.0 due to source address verification at the interface. To enable boot requests to work on the interface, you must use ACLs instead of Unicast RPF.


Monitoring and Maintaining Unicast RPF

This section describes commands used to monitor and maintain Unicast RPF.

 

Command
Purpose

Router# show ip traffic

Displays global router statistics about Unicast RPF drops and suppressed drops.

Router# show ip interface type

Displays per-interface statistics about Unicast RPF drops and suppressed drops.

Router# show access-lists

Displays the number of matches to a specific ACL.

Router(config-if)# no ip verify unicast reverse-path list

Disables Unicast RPF at the interface. Use the list option to disable Unicast RPF for a specific ACL at the interface.

 


Caution To disable CEF, you must first disable Unicast RPF. Failure to disable Unicast RPF before disabling CEF can cause HSRP failure. If you want to disable CEF on the router, you must first disable Unicast RPF.

Unicast RPF counts the number of packets dropped or suppressed because of malformed or forged source addresses. Unicast RPF counts dropped or forwarded packets that include the following global and per-interface information:

Global Unicast RPF drops

Per-interface Unicast RPF drops

Per-interface Unicast RPF suppressed drops

The show ip traffic command shows the total number (global count) of dropped or suppressed packets for all interfaces on the router. The Unicast RPF drop count is included in the IP statistics section.

Router# show ip traffic

<

a name="wp1001272">

IP statistics:

  Rcvd:  1471590 total, 887368 local destination

         0 format errors, 0 checksum errors, 301274 bad hop count

         0 unknown protocol, 0 not a gateway

         0 security failures, 0 bad options, 0 with options

  Opts:  0 end, 0 nop, 0 basic security, 0 loose source route

         0 timestamp, 0 extended security, 0 record route

         0 stream ID, 0 strict source route, 0 alert, 0 other

  Frags: 0 reassembled, 0 timeouts, 0 couldn't reassemble

         0 fragmented, 0 couldn't fragment

  Bcast: 205233 received, 0 sent

  Mcast: 463292 received, 462118 sent

  Sent:  990158 generated, 282938 forwarded

  ! The second line below ("0 unicast RPF") displays Unicast RPF packet dropping   information.

  Drop:  3 encapsulation failed, 0 unresolved, 0 no adjacency

         0 no route, 0 unicast RPF, 0 forced drop

A nonzero value for the count of dropped or suppressed packets can mean one of two things:

Unicast RPF is dropping or suppressing packets that have a bad source address (normal operation).

Unicast RPF is dropping or suppressing legitimate packets because the route is misconfigured to use Unicast RPF in environments where asymmetric routing exists; that is, where multiple paths can exist as the best return path for a source address.

The show ip interface command shows the total of dropped or suppressed packets at a specific interface. If Unicast RPF is configured to use a specific ACL, that ACL information is displayed along with the drop statistics.

Router> show ip interface ethernet0/1/1

   Unicast RPF ACL 197

   1 unicast RPF drop

   1 unicast RPF suppressed drop

The show access-lists command displays the number of matches found for a specific entry in a specific access list.

Router> show access-lists

Extended IP access list 197

     deny ip 192.168.201.0 0.0.0.63 any log-input (1 match)

     permit ip 192.168.201.64 0.0.0.63 any log-input (1 match)

     deny ip 192.168.201.128 0.0.0.63 any log-input

     permit ip 192.168.201.192 0.0.0.63 any log-input


Unicast RPF Configuration Examples

This section provides the following configuration examples:

Unicast RPF on a Leased-Line Aggregation Router Example

Unicast RPF on the Cisco AS5800 Using Dialup Ports Example

Unicast RPF with Inbound and Outbound Filters Example

Unicast RPF with ACLs and Logging Example


Unicast RPF on a Leased-Line Aggregation Router Example

The following commands enable Unicast RPF on a serial interface:

ip cef

! or "ip cef distributed" for RSP+VIP based routers

!

interface serial 5/0/0

 ip verify unicast reverse-path


Unicast RPF on the Cisco AS5800 Using Dialup Ports Example

The following example enables Unicast RPF on a Cisco AS5800. The interface Group-Async command makes it easy to apply Unicast RPF on all the dialup ports.

ip cef

!

interface Group-Async1

 ip verify unicast reverse-path


Unicast RPF with Inbound and Outbound Filters Example

The following example uses a very simple single-homed ISP to demonstrate the concepts of ingress and egress filters used in conjunction with Unicast RPF. The example illustrates an ISP-allocated classless interdomain routing (CIDR) block 209.165.202.128/28 that has both inbound and outbound filters on the upstream interface. Be aware that ISPs

are usually not single-homed. Hence, provisions for asymmetrical flows (when outbound traffic goes out one link and returns via a different link) need to be designed into the filters on the border routers of the ISP.

ip cef distributed 

!

interface Serial 5/0/0

 description Connection to Upstream ISP

 ip address 209.165.200.225 255.255.255.252

 no ip redirects

 no ip directed-broadcast

 no ip proxy-arp

 ip verify unicast reverse-path

 ip access-group 111 in

 ip access-group 110 out

!

access-list 110 permit ip 209.165.202.128 0.0.0.31 any

access-list 110 deny ip any any log 

access-list 111 deny ip host 0.0.0.0 any log

access-list 111 deny ip 127.0.0.0 0.255.255.255 any log

access-list 111 deny ip 10.0.0.0 0.255.255.255 any log

access-list 111 deny ip 172.16.0.0 0.15.255.255 any log

access-list 111 deny ip 192.168.0.0 0.0.255.255 any log

access-list 111 deny ip 209.165.202.128 0.0.0.31 any log

access-list 111 permit ip any any


Unicast RPF with ACLs and Logging Example

The following example demonstrates the use of ACLs and logging with Unicast RPF. In this example, extended ACL 197 provides entries that deny or permit network traffic for specific address ranges. Unicast RPF is configured on interface Ethernet0 to check packets arriving at that interface.

For example, packets with a source address of 192.168.201.10 arriving at interface Ethernet0 are dropped because of the deny statement in ACL 197. In this case, the ACL information is logged (the logging option is turned on for the ACL entry) and dropped packets are counted per interface and globally. Packets with a source address of 192.168.201.100 arriving at interface Ethernet0 are forwarded because of the permit statement in ACL 197. ACL information about dropped or suppressed packets is logged (logging option turned on for the ACL entry) to the log server.

ip cef distributed

!

int eth0/1/1

 ip address 192.168.200.1 255.255.255.0

 ip verify unicast reverse-path 197

!

int eth0/1/2

 ip address 192.168.201.1 255.255.255.0

!

access-list 197 deny   ip 192.168.201.0 0.0.0.63 any log-input

access-list 197 permit ip 192.168.201.64 0.0.0.63 any log-input

access-list 197 deny   ip 192.168.201.128 0.0.0.63 any log-input

access-list 197 permit ip 192.168.201.192 0.0.0.63 any log-input

access-list 197 deny ip host 0.0.0.0 any log

路由器安全保护基本方法[转]

在互联网的世界里,路由器是不可或缺的重要部件,没有它我们将没有办法和五彩斑斓的外部世界建立联系。因此,路由器的管理一直是网络管理员最重要的日常工作之一。

        路由器是网络系统的主要设备,也是网络安全的前沿关口。如果路由器连自身的安全都没有保障,整个网络也就毫无安全可言。因此在网络安全管理上,必须对路由器进行合理规划、配置,采取必要的安全保护措施,避免因路由器自身的安全问题而给整个网络系统带来漏洞和风险。 下面是一些加强路由器安全的具体措施,用以阻止对路由器本身的攻击,并防范网络信息被窃取。

  1. 为路由器间的协议交换增加认证功能,提高网络安全性。

  路由器的一个重要功能是路由的管理和维护,目前具有一定规模的网络都采用动态的路由协议,常用的有:RIP、EIGRP、OSPF、IS-IS、BGP等。当一台设置了相同路由协议和相同区域标示符的路由器加入网络后,会学习网络上的路由信息表。但此种方法可能导致网络拓扑信息泄漏,也可能由于向网络发送自己的路由信息表,扰乱网络上正常工作的路由信息表,严重时可以使整个网络瘫痪。这个问题的解决办法是对网络内的路由器之间相互交流的路由信息进行认证。当路由器配置了认证方式,就会鉴别路由信息的收发方。有两种鉴别方式,其中“纯文本方式”安全性低,建议使用“MD5方式”。

  2. 路由器的物理安全防范。

  路由器控制端口是具有特殊权限的端口,如果攻击者物理接触路由器后,断电重启,实施“密码修复流程”,进而登录路由器,就可以完全控制路由器。

  3. 保护路由器口令。

  在备份的路由器配置文件中,密码即使是用加密的形式存放,密码明文仍存在被破解的可能。一旦密码泄漏,网络也就毫无安全可言。

  4. 阻止察看路由器诊断信息。

  关闭命令如下: no service tcp-small-servers no service udp-small-servers

  5. 阻止查看到路由器当前的用户列表。

  关闭命令为:no service finger。

  6. 关闭CDP服务。

  在OSI二层协议即链路层的基础上可发现对端路由器的部分配置信息: 设备平台、操作系统版本、端口、IP地址等重要信息。可以用命令: no cdp running或no cdp enable关闭这个服务。

  7. 阻止路由器接收带源路由标记的包,将带有源路由选项的数据流丢弃。

  “IP source-route”是一个全局配置命令,允许路由器处理带源路由选项标记的数据流。启用源路由选项后,源路由信息指定的路由使数据流能够越过默认的路由,这种包就可能绕过防火墙。关闭命令如下: no ip source-route。

  8. 关闭路由器广播包的转发。

  Sumrf D.o.S攻击以有广播转发配置的路由器作为反射板,占用网络资源,甚至造成网络的瘫痪。应在每个端口应用“no ip directed-broadcast”关闭路由器广播包。

  9. 管理HTTP服务。

  HTTP服务提供Web管理接口。“no ip http server”可以停止HTTP服务。如果必须使用HTTP,一定要使用访问列表“ip http access-class”命令,严格过滤允许的IP地址,同时用“ip http authentication ”命令设定授权限制。

  10. 抵御spoofing(欺骗) 类攻击。

  使用访问控制列表,过滤掉所有目标地址为网络广播地址和宣称来自内部网络,实际却来自外部的包。 在路由器端口配置: ip access-group list in number 访问控制列表如下: access-list number deny icmp any any redirect access-list number deny ip 127.0.0.0 0.255.255.255 any access-list number deny ip 224.0.0.0 31.255.255.255 any access-list number deny ip host 0.0.0.0 any 注: 上述四行命令将过滤BOOTP/DHCP 应用中的部分数据包,在类似环境中使用时要有充分的认识。
  11. 防止包嗅探。

  黑客经常将嗅探软件安装在已经侵入的网络上的计算机内,监视网络数据流,从而盗窃密码,包括SNMP 通信密码,也包括路由器的登录和特权密码,这样网络管理员难以保证网络的安全性。在不可信任的网络上不要用非加密协议登录路由器。如果路由器支持加密协议,请使用SSH 或 Kerberized Telnet,或使用IPSec加密路由器所有的管理流。

  12.校验数据流路径的合法性。

  使用RPF (reverse path forwarding)反相路径转发,由于攻击者地址是违法的,所以攻击包被丢弃,从而达到抵御spoofing 攻击的目的。RPF反相路径转发的配置命令为: ip verify unicast rpf。 注意: 首先要支持 CEF(Cisco Express Forwarding) 快速转发。

  13. 防止SYN 攻击。

  目前,一些路由器的软件平台可以开启TCP 拦截功能,防止SYN 攻击,工作模式分拦截和监视两种,默认情况是拦截模式。(拦截模式: 路由器响应到达的SYN请求,并且代替服务器发送一个SYN-ACK报文,然后等待客户机ACK。如果收到ACK,再将原来的SYN报文发送到服务器; 监视模式:路由器允许SYN请求直接到达服务器,如果这个会话在30秒内没有建立起来,路由器就会发送一个RST,以清除这个连接。) 首先,配置访问列表,以备开启需要保护的IP地址: access list [1-199] [deny|permit] tcp any destination destination-wildcard 然后,开启TCP拦截: Ip tcp intercept mode intercept Ip tcp intercept list access list-number Ip tcp intercept mode watch

  14. 使用安全的SNMP管理方案。

  SNMP广泛应用在路由器的监控、配置方面。SNMP Version 1在穿越公网的管理应用方面,安全性低,不适合使用。利用访问列表仅仅允许来自特定工作站的SNMP访问通过这一功能可以来提升SNMP服务的安全性能。配置命令: snmp-server community xxxxx RW xx ;xx是访问控制列表号 SNMP Version 2使用MD5数字身份鉴别方式。不同的路由器设备配置不同的数字签名密码,这是提高整体安全性能的有效手段。

  总之,路由器的安全防范是网络安全的一个重要组成部分,还必须配合其他的安全防范措施,这样才能共同构筑起安全防范的整体工程。

转自ciscors

再整理VPN,vpn client to IOS

2811#sh run
Building configuration…

Current configuration : 2771 bytes
!

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname 2811
!
boot-start-marker
boot-end-marker
!
no logging buffered
enable secret 5 $1$8fbN$RM6FsYh4Oc345345eEeDZs60
!
aaa new-model
!
!
aaa authentication login userauthen local
aaa authorization network groupauthor local

!
aaa session-id common
!
resource policy
!
clock timezone GMT 8
ip subnet-zero
!
!
ip cef
!
!
ip domain name domain.com
!        
!
password encryption aes
!
!
username user1 password 7 03135A05245324324hh0116204342413414123249010C
username user2 secret 5 $1$IT1c$.RUNhgzi3o342teryh46urnh34525gecBA26.
!
!
!
crypto isakmp policy 10
 encr 3des
 authentication pre-share
 group 2

!
crypto isakmp client configuration group  group_policy
 key cisco123
 pool vpnpool
 acl splittunnel
 save-password
 netmask 255.255.255.0

!
!
crypto ipsec transform-set myset esp-3des esp-sha-hmac
!
crypto dynamic-map dynamimap 10
 set transform-set myset

!
!
crypto map clientmap client authentication list userauthen  
上面的语句实现客户端验证使用 扩展 验证,这样就启用了XAUTHEN,不配则不会产生XAUTHEN,而且这里只是启用而已,如果将userauthen换成随便一个名字,客户端一样正常拨入,
crypto map clientmap isakmp authorization list groupauthor
上面这个语句必配,否则路由器和客户端的IKE策略不匹配,该语句才是实际校验用户用。
crypto map clientmap client configuration address respond
响应客户端的之请求
crypto map clientmap 10 ipsec-isakmp dynamic dynamimap

!
!
!
interface FastEthernet0/0
 description LAN
 ip address 10.10.70.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description WAN
 ip address 222.188.155.177 255.255.255.0
 ip access-group internet in
 duplex auto
 speed auto
 crypto map clientmap
!
interface Serial0/0/0
 no ip address
 shutdown
 clock rate 2000000
!
interface Serial0/0/1
 no ip address
 shutdown
 clock rate 2000000
!
ip local pool vpnpool 10.70.71.3 10.70.71.100
ip classless
ip route 0.0.0.0 0.0.0.0 222.188.155.2
!
no ip http server
ip http authentication local
no ip http secure-server
ip http timeout-policy idle 5 life 86400 requests 10000
!
ip access-list extended internet
 deny   tcp any host 222.188.155.177 eq 161
 deny   tcp any host 222.188.155.177 eq 162
 deny   tcp any host 222.188.155.177 eq telnet
 permit ip any any
ip access-list extended splittunnel
 permit ip 10.10.70.0 0.0.0.255 10.70.71.0 0.0.0.255

!
logging trap warnings
logging 172.20.20.100
!
!
control-plane
!
!
!
line con 0
line aux 0
line vty 0 4
 transport input telnet ssh
line vty 5 1180
 transport input telnet ssh
!
scheduler allocate 20000 1000
ntp clock-period 17207854
ntp server 192.168.1.253
!
end

 附:客户端组策略参数

 2811(config)#crypto isakmp client configuration group group_policy
2811(config-isakmp-group)#?
ISAKMP group policy config commands:
  access-restrict    Restrict clients in this group to an interface
  acl                Specify split tunneling inclusion access-list number,启用分割隧道,在客户机中插入路由
  backup-gateway     Specify backup gateway
  dns                Specify DNS Addresses
  domain             Set default domain name to send to client
  exit               Exit from ISAKMP client group policy configuration mode
  firewall           Enforce group firewall feature
  group-lock         Enforce group lock feature
  include-local-lan  Enable Local LAN Access with no split tunnel ,容许客户机在没有分割隧道时也能访问本地局域网
  key                pre-shared key/IKE password,client软件建立一个链接时要预配置的KEY
  max-logins         Set maximum simultaneous logins for users in this group,同一用户能同时登录的最大数
  max-users          Set maximum number of users for this group
  netmask            netmask used by the client for local connectivity,指定地址池中的掩码,否则自动按主类分配给客户端
  no                 Negate a command or set its defaults
  pfs                The client should propose PFS,要求客户端提议完美转发secrecy,(Perfect Forward Secrecy) 
  pool               Set name of address pool
  save-password      Allows remote client to save XAUTH password,容许客户端软件出现保存密码选项。
  split-dns          DNS name to append for resolution,详细见:http://www.cisco.com/en/US/products/ps6441/products_feature_guide09186a00806bd780.html
  wins               Specify WINS Addresses

IOS Software Releases 12.4 Mainline Configuration Guides

  • IP
  • Security and VPN
  • QoS
  • LAN Switching
  • Multiprotocol Label Switching (MPLS)
  • Network Management
  • Voice
  • Wireless/Mobility
  • Long Reach Ethernet (LRE) and Digital Subscriber Line (xDSL)
  • Dial–Access
  • Asynchronous Transfer Mode (ATM)
  • WAN
  • System Management
  • IBM Technologies
  • Additional and Legacy Protocols
  • IKE Aggressive Mode Behavior

    IKE Aggressive Mode Behavior

    This section describes IKE aggressive mode behavior occurring when Cisco IOS software is used.

    IKE has two phases of key negotiation: phase 1 and phase 2. Phase 1 negotiates a security association (a key) between two IKE peers. The key negotiated in phase 1 enables IKE peers to communicate securely in phase 2. During phase 2 negotiation, IKE establishes keys (security associations) for other applications, such as IPSec.

    Phase 1 negotiation can occur using one of two modes: main mode and aggressive mode. Main mode tries to protect all information during the negotiation, meaning that no information is available to a potential attacker. When main mode is used, the identities of the two sides are hidden. Although this mode of operation is very secure, it is relatively costly in terms of the time it takes to complete the negotiation. Aggressive mode takes less time to negotiate keys between peers; however, it gives up some of the security provided by main mode negotiation. For example, the identities of the two parties trying to establish a security association are exposed to an eavesdropper.

    The two modes serve different purposes and have different strengths. Main mode is slower than aggressive mode, but main mode is more secure and more flexible because it can offer an IKE peer more security proposals than aggressive mode. Aggressive mode is less flexible and not as secure, but much faster.

    In Cisco IOS software, the two modes are not configurable. The default action for IKE authentication (rsa-sig, rsa-encr, or preshared) is to initiate main mode; however, in cases where there is no corresponding information to initiate authentication, and there is a preshared key associated with the host name of the peer, Cisco IOS software can initiate aggressive mode. Cisco IOS software will respond in aggressive mode to an IKE peer that initiates aggressive mode.

    Whether Cisco IOS software initiates main mode or aggressive mode, the following restrictions are applicable:

    The initiating router must not have a certificate associated with the remote peer.

    The preshared key must be by fully qualified domain name (FQDN) on both peers.; thus, you have to enter the crypto isakmp key keystring hostname peer-address command in configuration mode.

    The communicating routers must have a FQDN host entry for each other in their configurations.

    The communicating routers must be configured to authenticate by hostname, not by IP address; thus, you should use the crypto isakmp identity hostname command.