您的位置:首页 > 职场人生

Cisco技术区常用配置实例整理----2010.11.1更新ing....

2010-11-01 08:11 1156 查看
网络地址转换(NAT)

互联网如火如荼的应用,加剧了IP地址匮乏的问题,为了缓解这一问题,一个重要的应用:NAT(Network Address Translation―网络地址转换),日益广泛地应用起来。NAT通过地址转换的方式,使企业可以仅使用较少的互联网有效IP地址,就能获得互联网接入的能力,有效地缓解了地址不足的问题,同时提供了一定的安全性。

 NAT的实现方案多种多样,本文以思科2611路由器为平台,通过一个实例描述了NAT的应用。

思科路由器上NAT通常有3种应用方式,分别适用于不同的需求:

1. 静态地址转换:适用于企业内部服务器向企业网外部提供服务(如WEB,FTP等),需要建立服务器内部地址到固定合法地址的静态映射。

2. 动态地址转换:建立一种内外部地址的动态转换机制,常适用于租用的地址数量较多的情况;企业可以根据访问需求,建立多个地址池,绑定到不同的部门。这样既增强了管理的粒度,又简化了排错的过程。

3. 端口地址复用:适用于地址数很少,多个用户需要同时访问互联网的情况。



如上图所示,企业从ISP获得6个有效IP地址(202.103.100.128~202.103.100.135,掩码为255.255.255.248,128和135为网络地址和广播地址,不可用),通过一台2611路由器接入互联网。内部网络根据职能分成若干子网,并期望服务器子网对外提供WEB服务,财务部门使用独立的地址池接入互联网,其它部门共用剩余的地址池。

具体配置步骤如下:

1. 选择E0作为内部接口,S0作为外部接口

interface e0

ip address 192.168.100.1 255.255.255.0

ip nat inside /*配置e0为内部接口*/

interface s0

ip address 202.103.100.129 255.255.255.248

ip nat outside /*配置s0为外部接口*/

2. 为各部门配置地址池(finance-财务部门;other-其它部门):

ip nat pool finance 202.103.100.131 202.103.100.131 netmask 255.255.255.248

ip nat pool other 202.103.100.132 202.103.100.134 netmask 255.255.255.248

3. 用访问控制列表检查数据包的源地址并映射到不同的地址池

ip nat inside source list 1 pool finance overload /*overload-启用端口复用*/

ip nat inside source list 2 pool other / *动态地址转换*/

4. 定义访问控制列表

access-list 1 permit 192.168.20.0 0.0.0.255

access-list 2 permit 192.168.30.0 0.0.0.255

5. 建立静态地址转换,并开放WEB端口(TCP 80)

ip nat inside source static tcp 192.168.10.2 80 202.103.100.130 80

6. 设置缺省路由

ip route 0.0.0.0 0.0.0.0 s0

经过上述配置后,互联网上的主机可以通过202.103.100.130:80访问到企业内部WEB服务器192.168.10.2;财务部门的接入请求将映射到202.103.100.131;其它部门的接入请求被映射到202.103.100.131~134地址段。

至此,一个企业NAT互联网接入方案就完成了。

典型以太网络建立多个VLAN

实例:典型以太网络建立多个VLAN

所谓典型局域网就是指由一台具备三层交换功能的核心交换机接几台分支交换机(不一定具备三层交换能力)。我们假设核心交换机名称为:com;分支交换机分别为:par1、par2、par3,分别通过port 1的光线模块与核心交换机相连;并且假设vlan名称分别为counter、market、managing……   需要做的工作:   

1、设置vtp domain(核心、分支交换机上都设置)   

2、配置中继(核心、分支交换机上都设置)   

3、创建vlan(在server上设置)   

4、将交换机端口划入vlan   

5、配置三层交换   

1、设置vtp domain。 vtp domain 称为管理域。   交换vtp更新信息的所有交换机必须配置为相同的管理域。如果所有的交换机都以中继线相连,那么只要在核心交换机上设置一个管理域,网络上所有的交换机都加入该域,这样管理域里所有的交换机就能够了解彼此的vlan列表。   

com#vlan database 进入vlan配置模式   

com(vlan)#vtp domain com 设置vtp管理域名称 com   

com(vlan)#vtp server 设置交换机为服务器模式   

par1#vlan database 进入vlan配置模式   

par1(vlan)#vtp domain com 设置vtp管理域名称com   

par1(vlan)#vtp client 设置交换机为客户端模式   

par2#vlan database 进入vlan配置模式   

par2(vlan)#vtp domain com 设置vtp管理域名称com   

par2(vlan)#vtp client 设置交换机为客户端模式   

par3#vlan database 进入vlan配置模式   

par3(vlan)#vtp domain com 设置vtp管理域名称com   

par3(vlan)#vtp client 设置交换机为客户端模式   注意:这里设置核心交换机为server模式是指允许在该交换机上创建、修改、删除vlan及其他一些对整个vtp域的配置参数,同步本vtp域中其他交换机传递来的最新的vlan信息;client模式是指本交换机不能创建、删除、修改vlan配置,也不能在nvram中存储vlan配置,但可同步由本vtp域中其他交换机传递来的vlan信息。

2、配置中继为了保证管理域能够覆盖所有的分支交换机,必须配置中继。   cisco交换机能够支持任何介质作为中继线,为了实现中继可使用其特有的isl标签。isl(inter-switch link)是一个在交换机之间、交换机与路由器之间及交换机与服务器之间传递多个vlan信息及vlan数据流的协议,通过在交换机直接相连的端口配置isl封装,即可跨越交换机进行整个网络的vlan分配和进行配置。   

在核心交换机端配置如下:   

com(config)#interface gigabitethernet 2/1   

com(config-if)#switchport   

com(config-if)#switchport trunk encapsulation isl 配置中继协议   

com(config-if)#switchport mode trunk   

com(config)#interface gigabitethernet 2/2   

com(config-if)#switchport   

com(config-if)#switchport trunk encapsulation isl 配置中继协议   

com(config-if)#switchport mode trunk   

com(config)#interface gigabitethernet 2/3   

com(config-if)#switchport   

com(config-if)#switchport trunk encapsulation isl 配置中继协议   

com(config-if)#switchport mode trunk   

在分支交换机端配置如下:   

par1(config)#interface gigabitethernet 0/1   

par1(config-if)#switchport mode trunk   

par2(config)#interface gigabitethernet 0/1   

par2(config-if)#switchport mode trunk   

par3(config)#interface gigabitethernet 0/1   

par3(config-if)#switchport mode trunk   ……   此时,管理域算是设置完毕了。

3、创建vlan一旦建立了管理域,就可以创建vlan了。

  com(vlan)#vlan 10 name counter 创建了一个编号为10 名字为counter的 vlan

  com(vlan)#vlan 11 name market 创建了一个编号为11 名字为market的 vlan

  com(vlan)#vlan 12 name managing 创建了一个编号为12 名字为managing的 vlan

  注意,这里的vlan是在核心交换机上建立的,其实,只要是在管理域中的任何一台vtp 属性为server的交换机上建立vlan,它就会通过vtp通告整个管理域中的所有的交换机。但如果要将具体的交换机端口划入某个vlan,就必须在该端口所属的交换机上进行设置。

  4、将交换机端口划入vlan

  例如,要将par1、par2、par3……分支交换机的端口1划入counter vlan,端口2划入market vlan,端口3划入managing vlan……

  par1(config)#interface fastethernet 0/1 配置端口1

  par1(config-if)#switchport access vlan 10 归属counter vlan

  par1(config)#interface fastethernet 0/2 配置端口2

  par1(config-if)#switchport access vlan 11 归属market vlan

  par1(config)#interface fastethernet 0/3 配置端口3

  par1(config-if)#switchport access vlan 12 归属managing vlan

  par2(config)#interface fastethernet 0/1 配置端口1

  par2(config-if)#switchport access vlan 10 归属counter vlan

  par2(config)#interface fastethernet 0/2 配置端口2

  par2(config-if)#switchport access vlan 11 归属market vlan

  par2(config)#interface fastethernet 0/3 配置端口3

  par2(config-if)#switchport access vlan 12 归属managing vlan

  par3(config)#interface fastethernet 0/1 配置端口1

  par3(config-if)#switchport access vlan 10 归属counter vlan

  par3(config)#interface fastethernet 0/2 配置端口2

  par3(config-if)#switchport access vlan 11 归属market vlan

  par3(config)#interface fastethernet 0/3 配置端口3

  par3(config-if)#switchport access vlan 12 归属managing vlan

  ……

5、配置三层交换

  到这里,vlan已经基本划分完毕。但是,vlan间如何实现三层(网络层)交换呢?这时就要给各vlan分配网络(ip)地址了。给vlan分配ip地址分两种情况,其一,给vlan所有的节点分配静态ip地址;其二,给vlan所有的节点分配动态ip地址。下面就这两种情况分别介绍。

  假设给vlan counter分配的接口ip地址为172.16.58.1/24,网络地址为:172.16.58.0,

  vlan market 分配的接口ip地址为172.16.59.1/24,网络地址为:172.16.59.0,

  vlan managing分配接口ip地址为172.16.60.1/24, 网络地址为172.16.60.0

  ……

  如果动态分配ip地址,则设网络上的dhcp服务器ip地址为172.16.1.11。

  (1)给vlan所有的节点分配静态ip地址。

  首先在核心交换机上分别设置各vlan的接口ip地址。核心交换机将vlan做为一种接口对待,就象路由器上的一样,如下所示:

  com(config)#interface vlan 10

  com(config-if)#ip address 172.16.58.1 255.255.255.0 vlan10接口ip

  com(config)#interface vlan 11

  com(config-if)#ip address 172.16.59.1 255.255.255.0 vlan11接口ip

  com(config)#interface vlan 12

  com(config-if)#ip address 172.16.60.1 255.255.255.0 vlan12接口ip

  ……

  再在各接入vlan的计算机上设置与所属vlan的网络地址一致的ip地址,并且把默认网关设置为该vlan的接口地址。这样,所有的vlan也可以互访了。

  (2)给vlan所有的节点分配动态ip地址。

  首先在核心交换机上分别设置各vlan的接口ip地址和同样的dhcp服务器的ip地址,如下所示:

  com(config)#interface vlan 10

  com(config-if)#ip address 172.16.58.1 255.255.255.0 vlan10接口ip

  com(config-if)#ip helper-address 172.16.1.11 dhcp server ip

  com(config)#interface vlan 11

  com(config-if)#ip address 172.16.59.1 255.255.255.0 vlan11接口ip

  com(config-if)#ip helper-address 172.16.1.11 dhcp server ip

  com(config)#interface vlan 12

  com(config-if)#ip address 172.16.60.1 255.255.255.0 vlan12接口ip

  com(config-if)#ip helper-address 172.16.1.11 dhcp server ip

  ……

  再在dhcp服务器上设置网络地址分别为172.16.58.0,172.16.59.0,172.16.60.0的作用域,并将这些作用域的“路由器”选项设置为对应vlan的接口ip地址。这样,可以保证所有的vlan也可以互访了。

  最后在各接入vlan的计算机进行网络设置,将ip地址选项设置为自动获得ip地址即可。

***实例配置方案-中文注解

Router:sam-i-am(*** Server)

Current configuration:

!

version 12.2

service timestamps debug uptime

service timestamps log up time

no service password-encryption

!

hostname sam-i-am

!

ip subnet-zero

!--- IKE配置

sam-i-am(config)#crypto isakmp policy 1 //定义策略为1

sam-i-am(isakmp)#hash md5 //定义MD5散列算法

sam-i-am(isakmp)#authentication pre-share //定义为预共享密钥认证方式

sam-i-am(config)#crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0

!--- 配置预共享密钥为cisco123,对等端为所有IP

!--- IPSec协议配置

sam-i-am(config)#crypto ipsec transform-set rtpset esp-des esp-md5-hmac

!--- 创建变换集 esp-des esp-md5-hmac

sam-i-am(config)#crypto dynamic-map rtpmap 10 //创建动态保密图rtpmap 10

san-i-am(crypto-map)#set transform-set rtpset //使用上面的定义的变换集rtpset

san-i-am(crypto-map)#match address 115 //援引访问列表确定受保护的流量

sam-i-am(config)#crypto map rtptrans 10 ipsec-isakmp dynamic rtpmap

!--- 将动态保密图集加入到正规的图集中

!

interface Ethernet0

ip address 10.2.2.3 255.255.255.0

no ip directed-broadcast

ip nat inside

no mop enabled

!

interface Serial0

ip address 99.99.99.1 255.255.255.0

no ip directed-broadcast

ip nat outside

crypto map rtptrans //将保密映射应用到S0接口上

!

ip nat inside source route-map nonat interface Serial0 overload

!--- 这个NAT配置启用了路由策略,内容为10.2.2.0到10.1.1.0的访问不进行地址翻译

!--- 到其他网络的访问都翻译成SO接口的IP地址

ip classless

ip route 0.0.0.0 0.0.0.0 Serial0 //配置静态路由协议

no ip http server

!

access-list 115 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255

access-list 115 deny ip 10.2.2.0 0.0.0.255 any

!

access-list 120 deny ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255

access-list 120 permit ip 10.2.2.0 0.0.0.255 any

!

sam-i-am(config)#route-map nonat permit 10 //使用路由策略

sam-i-am(router-map)#match ip address 120

!

line con 0

transport input none

line aux 0

line vty 0 4

password ww

login

!

end

Router:dr_whoovie(*** Client)

Current configuration:

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname dr_whoovie

!

ip subnet-zero

!

dr_whoovie(config)#crypto isakmp policy 1 //定义策略为1

dr_whoovie(isakmp)#hash md5 //定义MD5散列算法

dr_whoovie(isakmp)#authentication pre-share //定义为预共享密钥认证方式

dr_whoovie(config)#crypto isakmp key cisco123 address 99.99.99.1

!--- 配置预共享密钥为cisco123,对等端为服务器端IP99.99.99.1

!--- IPSec协议配置

dr_whoovie(config)#crypto ipsec transform-set rtpset esp-des esp-md5-hmac

!--- 创建变换集 esp-des esp-md5-hmac

dr_whoovie(config)#crypto map rtp 1 ipsec-isakmp

!--- 使用IKE创建保密图rtp 1

dr_whoovie(crypto-map)#set peer 99.99.99.1 //确定远程对等端

dr_whoovie(crypto-map)#set transform-set rtpset //使用上面的定义的变换集rtpset

dr_whoovie(crypto-map)#match address 115 //援引访问列表确定受保护的流量

!

interface Ethernet0

ip address 10.1.1.1 255.255.255.0

no ip directed-broadcast

ip nat inside

no mop enabled

!

interface Serial0

ip address negotiated //IP地址自动获取

no ip directed-broadcast

ip nat outside

encapsulation ppp //S0接口封装ppp协议

no ip mroute-cache

no ip route-cache

crypto map rtp //将保密映射应用到S0接口上

!

ip nat inside source route-map nonat interface Serial0 overload

!--- 这个NAT配置启用了路由策略,内容为10.1.1.0到10.2.2.0的访问不进行地址翻译

!--- 到其他网络的访问都翻译成SO接口的IP地址

ip classless

ip route 0.0.0.0 0.0.0.0 Serial0 //配置静态路由协议

no ip http server

!

access-list 115 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255

access-list 115 deny ip 10.1.1.0 0.0.0.255 any

access-list 120 deny ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255

access-list 120 permit ip 10.1.1.0 0.0.0.255 any

!

dialer-list 1 protocol ip permit

dialer-list 1 protocol ipx permit

route-map nonat permit 10 //使用路由策略

match ip address 120

!

line con 0

transport input none

line aux 0

line vty 0 4

password ww

login

!

end



-----------IKE配置----------------

IPSec ***对等端为了建立信任关系,必须交换某种形式的认证密钥。

Internet 密钥交换(Internet Key Exchange,IKE)是一种为IPSec管理和交换密钥的标准方法。

一旦两个对等端之间的IKE协商取得成功,那么IKE就创建到远程对等端的安全关联(security association,SA)。SA是单向的;在两个对等端之间存在两

个SA。

IKE使用UDP端口500进行协商,确保端口500不被阻塞。

配置

1、(可选)启用或者禁用IKE

(global)crypto isakmp enable

或者

(global)no crypto isakmp enable

默认在所有接口上启动IKE

2、创建IKE策略

(1)定义策略

(global)crypto isakmp policy priority

注释:policy 1表示策略1,假如想多配几个***,可以写成policy 2、policy3┅

(2)(可选)定义加密算法

(isakmp)encryption {des | 3des}

加密模式可以为56位的DES-CBC(des,默认值)或者168位的3DES(3des)

(3)(可选)定义散列算法

(isamkp)hash {sha | md5}

默认sha

(4)(可选)定义认证方式

(isamkp)authentication {rsa-sig | rsa-encr | pre-share}

rsa-sig 要求使用CA并且提供防止抵赖功能;默认值

rsa-encr 不需要CA,提供防止抵赖功能

pre-share 通过手工配置预共享密钥

(5)(可选)定义Diffie-Hellman标识符

(isakmp)group {1 | 2}

注释:除非购买高端路由器,或是***通信比较少,否则最好使用group 1长度的密钥,group命令有两个参数值:1和2。参数值1表示密钥使用768位密钥,

参数值2表示密钥使用1024位密钥,显然后一种密钥安全性高,但消耗更多的CPU时间。

(6)(可选)定义安全关联的生命期

(isakmp)lifetime seconds

注释:对生成新SA的周期进行调整。这个值以秒为单位,默认值为86400,也就是一天。值得注意的是两端的路由器都要设置相同的SA周期,否则***在正

常初始化之后,将会在较短的一个SA周期到达中断。

3、(rsa-sig)使用证书授权(CA)

(1)确保路由器有主机名和域名

(global)hostname hostname

(global)ip domain-name domain

(2)产生RSA密钥

(global)crypto key generate rsa

(3)使用向IPSec对等端发布证书的CA

--设定CA的主机名

(global)crypto ca identity name

--设定联络CA所使用的URL

(ca-identity)enrollment url url

URL应该采用http://ca-domain-nameort/cgi-bin-location的形式

--(可选)使用RA模式

(ca-identity)enrollment mode ra

(ca-identity)query url url

--(可选)设定注册重试参数

(ca-identity)enrollment retry period minutes

(ca-identity)enrollment retry count number

minutes(1到60;默认为1) number(1到100;默认为0,代表无穷次)

--(可选)可选的证书作废列表

(ca-identity)crl optional

(4)(可选)使用可信的根CA

--确定可信的根CA

(global)crypto ca trusted-root name

--(可选)从可信的根请求CRL

(ca-root)crl query url

--定义注册的方法

(ca-root)root {CEP url | TFTP server file | PROXY url}

(5)认证CA

(global)crypto ca authenticate name

(6)用CA注册路由器

(global)crypto ca enroll name

4、(rsa-encr)手工配置RSA密钥(不使用CA)

(1)产生RSA密钥

(global)crypto key generate rsa

(2)指定对等端的ISAKMP标识

(global)crypto isakmp identity {address | hostname}

(3)指定其他所有对等端的RSA密钥

--配置公共密钥链

(global)crypto key pubkey-chain rsa

--用名字或地址确定密钥

(pubkey-chain)named-key key-name [encryption | signature]

(pubkey-chain)addressed-key key-name [encryption | signature]

--(可选)手工配置远程对等端的IP地址

(pubkey-key)address ip-addr

--指定远程对等端的公开密钥

(pubkey-key)key-string key-string

5、(preshare)配置预共享密钥

(global)crypto isakmp key key-string {addrss | hostname} {peer-address | peer-hostname}

注释:返回到全局设置模式确定要使用的预先共享密钥和指归***另一端路由器IP地址,即目的路由器IP地址。相应地在另一端路由器配置也和以上命令类



6、(可选)使用IKE模式

(1)定义要分发的“内部”或者受保护IP地址库

(global)ip local pool pool-name start-address end-address

(2)启动IKE模式协商

(global)crypto isakmp client configuration address-pool local pool-name

--------------IPSec配置----------------

IPSec 使用加密、数据完整性、源发鉴别以及拒绝重演分组来保护和认证网络层对等端之间的IP分组

IPSec对于构建内因网、外因网以及远程用户接入***来说非常有用处

IPSec支持以下标准

--Internet协议的安全体系结构

--IKE(Internet密钥交换)

--DES(数据加密标准)

--MD5

--SHA

--AH(Authentication Header,认证首部)数据认证和反重演(anti-reply)服务

--ESP(Encapsulation Security Payload,封装安全净荷)数据隐私、数据验证以及反重演(anti-reply)服务

敏感流量由访问列表所定义,并且通过crypto map(保密图)集被应用到接口上。

配置

1、为密钥管理配置IKE

2、(可选)定义SA的全局生命期

(global)crypto ipsec security-association lifetime seconds seconds

(global)crypto ipsec security-association lifetime killobytes kilobytes

3、定义保密访问列表来定义受保护的流量

(global)access-list access-list-number ....

或者

(global)ip access-list extended name

扩展的访问列表必须定义由IPSec保护哪种IP流量。保密图(crypto map)援引这个访问列表来确定在接口上要保护的流量。

4、定义IPSec交换集

(1)创建变换集

(global)crypto ipsec transform-set name [transform1 | transform2 | transform3]

可以在一个保密图(crypto map)中定义多个变换集。如果没有使用IKE,那么只能定义一种变换集。用户能够选择多达三种变换。

(可选)选择一种AH变换

--ah-md5-hmac

--ah-sha-hmac

--ah-rfc-1828

(可选)选择一种ESP加密编号

--esp-des

--esp-3des

--esp-rfc-1829

--esp-null

以及这些验证方法之一

--esp-md5-hmac

--esp-sha-hmac

(可选)选择IP压缩变换

--comp-lzs

(2)(可选)选择变换集的模式

(crypto-transform)mode {tunnel | transport}

5、使用IPSec策略定义保密映射

保密图(crypto map)连接了保密访问列表,确定了远程对等端、本地地址、变换集和协商方法。

(1)(可选)使用手工的安全关联(没有IKE协商)

--创建保密图

(global)crypto map map-name sequence ipsec-manual

--援引保密访问列表来确定受保护的流量

(crypto-map)match address access-list

--确定远程的IPSec对等端

(crypto-map)set peer {hostname | ip_addr}

--指定要使用的变换集

(crypto-map)set transform-set name

变换集必须和远程对等端上使用的相同

--(仅适用于AH验证)手工设定AH密钥

(crypto-map)set session-key inbound ah spi hex-key-data

(crypto-map)set session-key outbound ah spi hex-key-data

--(仅适用于ESP验证)手工设定ESP SPI和密钥

(crypto-map)set session-key inbound ah spi hex-key-data [authenticator hex-key-data]

(crypto-map)set session-key outbound ah spi hex-key-data [authenticator hex-key-data]

(2)(可选)使用IKE建立的安全关联

--创建保密图

(global)crypto map map-name sequence ipsec-isakmp

--援引保密访问列表来确定受保护的流量

(crypto-map)match address access-list

--确定远程的IPSec对等端

(crypto-map)set peer {hostname | ip_addr}

--指定要使用的变换集

(crypto-map)set transform-set name

变换集必须和远程对等端上使用的相同

--(可选)如果SA生命期和全局默认不同,那么定义它:

(crypto-map)set security-association lifetime seconds seconds

(crypto-map)set security-association lifetime kilobytes kilobytes

--(可选)为每个源/目的主机对使用一个独立的SA

(crypto-map)set security-association level per-host

--(可选)对每个新的SA使用完整转发安全性

(crypto-map)set pfs [group1 | group2]

(3)(可选)使用动态安全关联

--创建动态的保密图

(global)crypto dynamic-map dyn-map-name dyn-seq-num

--(可选)援引保密访问列表确定受保护的流量

(crypto-map)match address access-list

--(可选)确定远程的IPSec对等端

(crypto-map)set peer {hostname | ip_addr}

--(可选)指定要使用的变换集

(crypto-map)set transform-set tranform-set-name

--(可选)如果SA生命期和全局默认不同,那么定义它:

(crypto-map)set security-association lifetime seconds seconds

(crypto-map)set security-association lifetime kilobytes kilobytes

--(可选)对每个新的SA使用完整转发安全性

(crypto-map)set pfs [group1 | group2]

--将动态保密图集加入到正规的图集中

(global)crypto map map-name sequence ipsec-isakmp dynamic dyn-map-name [discover]

--(可选)使用IKE模式的客户机配置

(global)crypto map map-name client configuration address [initiate | respond]

--(可选)使用来自AAA服务器的预共享IKE密钥

(global)crypto map map-name isakmp authorization list list-name

6、将保密映射应用到接口上

(1)指定要使用的保密映射

(interface)crypto map map-name

(2)(可选)和其他接口共享保密映射

(global)crypto map map-name local-address interface-id

pix虚拟防火墙配置实例

PIXFW(config)# sh run

: Saved

:

PIX Version 7.0(2) <system>

!

interface Ethernet0

speed 1920

duplex full

!

interface Ethernet0.1

vlan 5

!

interface Ethernet0.2

vlan 6

!

interface Ethernet1

!

interface Ethernet2

!

interface Ethernet3

shutdown

!

interface Ethernet4

shutdown

!

interface Ethernet5

shutdown

!

enable password 8Ry2YjIyt7RRXU24 encrypted

hostname PIXFW

ftp mode passive

pager lines 24

no failover

no asdm history enable

arp timeout 14400

console timeout 0

admin-context OA

context OA

allocate-interface Ethernet0.1

allocate-interface Ethernet1

config-url flash:/OA.cfg

!

context FMIS

allocate-interface Ethernet0.2

allocate-interface Ethernet2

config-url flash:/FMIS.cfg

!

Cryptochecksum:53517dcd4fe74fdcb51a1d24e90b1469

: end

PIXFW(config)# sh interface

Interface Ethernet0 "", is up, line protocol is up

Hardware is i82559, BW 1920 Mbps

Full-Duplex(Full-duplex), 1920 Mbps(1920 Mbps)

Available for allocation to a context

MAC address 0015.f9a9.02ea, MTU not set

IP address unassigned

525 packets input, 83359 bytes, 0 no buffer

Received 83 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

1935 packets output, 150750 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/1)

output queue (curr/max blocks): hardware (0/1) software (0/1)

Interface Ethernet0.1 "", is up, line protocol is up

VLAN identifier 5

Available for allocation to a context

Interface Ethernet0.2 "", is up, line protocol is up

VLAN identifier 6

Available for allocation to a context

Interface Ethernet1 "", is up, line protocol is up

Hardware is i82559, BW 1920 Mbps

Auto-Duplex(Full-duplex), Auto-Speed(1920 Mbps)

Available for allocation to a context

MAC address 0015.f9a9.02eb, MTU not set

IP address unassigned

2757 packets input, 225620 bytes, 0 no buffer

Received 1869 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

159 packets output, 12400 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/1)

output queue (curr/max blocks): hardware (0/1) software (0/1)

Interface Ethernet2 "", is up, line protocol is up

Hardware is i82559, BW 1920 Mbps

Auto-Duplex(Full-duplex), Auto-Speed(1920 Mbps)

Available for allocation to a context

MAC address 0005.5d18.3021, MTU not set

IP address unassigned

1672 packets input, 127807 bytes, 0 no buffer

Received 798 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

117 packets output, 9158 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/2)

output queue (curr/max blocks): hardware (0/1) software (0/1)

Interface Ethernet3 "", is administratively down, line protocol is down

Hardware is i82559, BW 1920 Mbps

Auto-Duplex, Auto-Speed

Available for allocation to a context

MAC address 0005.5d18.3023, MTU not set

IP address unassigned

1192 packets input, 14154 bytes, 0 no buffer

Received 1926 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

129 packets output, 8296 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/1)

output queue (curr/max blocks): hardware (0/1) software (0/1)

Interface Ethernet4 "", is administratively down, line protocol is down

Hardware is i82559, BW 1920 Mbps

Auto-Duplex, Auto-Speed

Available for allocation to a context

MAC address 0005.5d18.3020, MTU not set

IP address unassigned

0 packets input, 0 bytes, 0 no buffer

Received 0 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

0 packets output, 0 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/0)

output queue (curr/max blocks): hardware (0/0) software (0/0)

Interface Ethernet5 "", is administratively down, line protocol is down

Hardware is i82559, BW 1920 Mbps

Auto-Duplex, Auto-Speed

Available for allocation to a context

MAC address 0005.5d18.3022, MTU not set

IP address unassigned

0 packets input, 0 bytes, 0 no buffer

Received 0 broadcasts, 0 runts, 0 giants

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

0 packets output, 0 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred

0 lost carrier, 0 no carrier

input queue (curr/max blocks): hardware (128/12 software (0/0)

output queue (curr/max blocks): hardware (0/0) software (0/0)

PIXFW(config)# chang context OA

PIXFW/OA(config)# sh run

: Saved

:

PIX Version 7.0(2) <context>

names

!

interface Ethernet0.1

nameif outside

security-level 0

ip address 192.130.6.49 255.255.255.252

!

interface Ethernet1

nameif inside

security-level 1920

ip address 192.193.166.238 255.255.255.0

!

enable password 8Ry2YjIyt7RRXU24 encrypted

passwd 2KFQnbNIdI.2KYOU encrypted

hostname OA

access-list PING extended permit icmp any any

pager lines 24

mtu outside 1500

mtu inside 1500

monitor-interface inside

no asdm history enable

arp timeout 14400

nat (inside) 0 192.193.166.0 255.255.255.0

access-group PING in interface outside

route outside 0.0.0.0 0.0.0.0 192.130.6.50 1

timeout xlate 3:00:00

timeout conn 1:00:00 half-closed 0:192:00 udp 0:02:00 icmp 0:00:02

timeout sunrpc 0:192:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00

timeout mgcp-pat 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout uauth 0:05:00 absolute

no snmp-server location

no snmp-server contact

snmp-server enable traps snmp

telnet timeout 5

ssh timeout 5

!

class-map inspection_default

match default-inspection-traffic

!

!

policy-map global_policy

class inspection_default

inspect dns maximum-length 512

inspect ftp

inspect h323 h225

inspect h323 ras

inspect netbios

inspect rsh

inspect rtsp

inspect skinny

inspect esmtp

inspect sqlnet

inspect sunrpc

inspect tftp

inspect sip

inspect xdmcp

!

service-policy global_policy global

Cryptochecksum:46ffeba4d29c11a248523371c9666379

: end

PIXFW/OA(config)#

PIXFW/OA(config)# chang context FMIS

PIXFW/FMIS(config)# sh run

: Saved

:

PIX Version 7.0(2) <context>

names

!

interface Ethernet0.2

nameif outside

security-level 0

ip address 192.135.178.65 255.255.255.252

!

interface Ethernet2

nameif inside

security-level 1920

ip address 192.135.181.126 255.255.255.128

!

enable password 8Ry2YjIyt7RRXU24 encrypted

passwd 2KFQnbNIdI.2KYOU encrypted

hostname FMIS

access-list 1921 extended permit icmp any any

pager lines 24

mtu outside 1500

mtu inside 1500

monitor-interface inside

no asdm history enable

arp timeout 14400

nat (inside) 0 192.135.181.0 255.255.255.128

access-group 1921 in interface outside

route outside 0.0.0.0 0.0.0.0 192.135.178.66 1

timeout xlate 3:00:00

timeout conn 1:00:00 half-closed 0:192:00 udp 0:02:00 icmp 0:00:02

timeout sunrpc 0:192:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00

timeout mgcp-pat 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout uauth 0:05:00 absolute

no snmp-server location

no snmp-server contact

snmp-server enable traps snmp

telnet timeout 5

ssh timeout 5

!

class-map inspection_default

match default-inspection-traffic

!

!

policy-map global_policy

class inspection_default

inspect dns maximum-length 512

inspect ftp

inspect h323 h225

inspect h323 ras

inspect netbios

inspect rsh

inspect rtsp

inspect skinny

inspect esmtp

inspect sqlnet

inspect sunrpc

inspect tftp

inspect sip

inspect xdmcp

!

service-policy global_policy global

Cryptochecksum:5854ffa0a5401e033e1ce88731ebf452

: end

PIXFW/FMIS# chang context sys

PIXFW#

AAA配置实例

测试目的:通过AAA,实现用户级的授权

测试环境:TACACS+ ,1720路由器

测试过程:

实验一:用本地(LOCAL)方法进行验证和授权

配置文件:

version 12.1

!

hostname Router

!

aaa new-model

aaa authentication login myaaa group local !配置授权

aaa authorization exec myauth group local !配置认证

!

username user10 privilege 10 password 0 user10 !给用户分配级别

!

!

privilege exec level 10 ping !给命令分配级别

privilege exec level 10 show frame-relay

privilege exec level 10 traceroute

!

line con 0

transport input none

line aux 0

line vty 0 4

authorization exec myauth !选择TELNET的授权方式

login authentication myaaa !选择TELNET的认证方式

!

no scheduler allocate

end

实验结果:用户user10登录后级别是10,可以执行PING,SHOW FRAME-RELAY,TRACEROUTE命令。更高级别的用户才可执行其它的命令。另外通过仔细配置privilege命令,可以进一步细分命令权限。如:可以SHOW FRAME-RELAY不可以SHOW X25。

aaa的配制命令随IOS版本不同略有差异,在12.0.5以上的版本,用aaa authentication login myaaa group tacacs+ local命令,在12.0.5以下的版本用aaa authentication login myaaa tacacs+ local

可以用PRIVILEGE命令调整命令级别。不过容易出错。在测试过程中,发现如果将一条命令调级,其相应的子命令也自动调整到相映的级别。如:调整show ip route的级别后,show ip ,show的级别也自动调整,很容易出错。另外,可能是IOS BUG的原因,一些PRIVILEGE命令虽然起作用了,但在show run时却没有显示出来。

测试说明,用local的方法,可以实现用户级的命令权限的设定,优点是不用配置复杂的TACACS+服务器,成本低。缺点是需要在每一台设备上单独配置,工作量大,不易集中管理,而且在某些版本的IOS中有BUG,容易出错。

实验二:用TACSCS+进行验证和授权

version 12.1

!

hostname Router

!

aaa new-model

aaa authentication login myaaa group tacacs+

aaa authorization exec myauth group tacacs+

!

!

line con 0

transport input none

line aux 0

line vty 0 4

authorization exec myauth

login authentication myaaa

!

no scheduler allocate

end

实验结果:通过TACACS+可以非常灵活地对AAA进行设定,完成复杂的策略。除了在local实现功能外,还可以快速的对大量用户进行用户级或组一级的设置和管理。提供报表功能,时间策略等。TACACS+设置很容易掌握,WEB控制界面很友好。缺点是需要购买ACS服务器。

综上所述,在对小型网络管理,可以用本地授权的方式,在中心需要用TACACS+进行AAA管理。通过以上两种方式,都可以实现命令参数级的授权管理。

在中行一级网的管理中,可以结合这两种方式,可以配置路由器在进行认证时,先选择TACACS+的方式,同时配置几个本地的用户,作为TACACS+故障时的备份。

通过这样的方式,可实现对一级网的灵活管理策略。给省行一些查找错误,以及在升级软件时的相应权限,同时防止用户错误的配置及某些恶意***。

各种交换机端口安全总结(配置实例)

最常用的对端口安全的理解就是可根据MAC地址来做对网络流量的控制和管理,比如MAC地址与具体的端口绑定,限制具体端口通过的MAC地址的数量,或者在具体的端口不允许某些MAC地址的帧流量通过。稍微引申下端口安全,就是可以根据802.1X来控制网络的访问流量。

  

  首先谈一下MAC地址与端口绑定,以及根据MAC地址允许流量的配置。

  

  1.MAC地址与端口绑定,当发现主机的MAC地址与交换机上指定的MAC地址不同时,交换机相应的端口将down掉。当给端口指定MAC地址时,端口模式必须为access或者Trunk状态。

  

  3550-1#conf t

  

  3550-1(config)#int f0/1

  

  3550-1(config-if)#switchport mode access /指定端口模式。

  

  3550-1(config-if)#switchport port-security mac-address 00-90-F5-10-79-C1 /配置MAC地址。

  

  3550-1(config-if)#switchport port-security maximum 1 /限制此端口允许通过的MAC地址数为1。

  

  3550-1(config-if)#switchport port-security violation shutdown /当发现与上述配置不符时,端口down掉。

  

  2.通过MAC地址来限制端口流量,此配置允许一TRUNK口最多通过100个MAC地址,超过100时,但来自新的主机的数据帧将丢失。

  

  3550-1#conf t

  

  3550-1(config)#int f0/1

  

  3550-1(config-if)#switchport trunk encapsulation dot1q

  

  3550-1(config-if)#switchport mode trunk /配置端口模式为TRUNK。

  

  3550-1(config-if)#switchport port-security maximum 100 /允许此端口通过的最大MAC地址数目为100。

  

  3550-1(config-if)#switchport port-security violation protect /当主机MAC地址数目超过100时,交换机继续工作,但来自新的主机的数据帧将丢失。

  

  上面的配置根据MAC地址来允许流量,下面的配置则是根据MAC地址来拒绝流量。

  

  1.此配置在Catalyst交换机中只能对单播流量进行过滤,对于多播流量则无效。

  

  3550-1#conf t

  

  3550-1(config)#mac-address-table static 00-90-F5-10-79-C1 vlan 2 drop /在相应的Vlan丢弃流量。

  

  3550-1#conf t

  

  3550-1(config)#mac-address-table static 00-90-F5-10-79-C1 vlan 2 int f0/1 /在相应的接口丢弃流量。

  

  最后说一下802.1X的相关概念和配置。

  

  802.1X身份验证协议最初使用于无线网络,后来才在普通交换机和路由器等网络设备上使用。它可基于端口来对用户身份进行认证,即当用户的数据流量企图通过配置过802.1X协议的端口时,必须进行身份的验证,合法则允许其访问网络。这样的做的好处就是可以对内网的用户进行认证,并且简化配置,在一定的程度上可以取代Windows 的AD。

  

  配置802.1X身份验证协议,首先得全局启用AAA认证,这个和在网络边界上使用AAA认证没有太多的区别,只不过认证的协议是802.1X;其次则需要在相应的接口上启用802.1X身份验证。(建议在所有的端口上启用802.1X身份验证,并且使用radius服务器来管理用户名和密码)

  

  下面的配置AAA认证所使用的为本地的用户名和密码。

  

  3550-1#conf t

  

  3550-1(config)#aaa new-model /启用AAA认证。

  

  3550-1(config)#aaa authentication dot1x default local /全局启用802.1X协议认证,并使用本地用户名与密码。

  

  3550-1(config)#int range f0/1 -24

  

  3550-1(config-if-range)#dot1x port-control auto /在所有的接口上启用802.1X身份验证。

  

  后记

  

  通过MAC地址来控制网络的流量既可以通过上面的配置来实现,也可以通过访问控制列表来实现,比如在Cata3550上可通过700-799号的访问控制列表可实现MAC地址过滤。但是利用访问控制列表来控制流量比较麻烦,似乎用的也比较少,这里就不多介绍了。

  

  通过MAC地址绑定虽然在一定程度上可保证内网安全,但效果并不是很好,建议使用802.1X身份验证协议。在可控性,可管理性上802.1X都是不错的选择。

Cisco交换机Trunk配置实例

一台4506switch,通过trunk口和3550连接,在3550下再通过trunk接6台交换机!

  

  具体配置如下:

  

  4506:

  在int gi4/1上做trunk,encapsulation dot1q

         vtp domain cisco

         vtp mode server划分了10个vlan

  

  3550:

  做了6个trunk口和下面的6太交换机连接!

         int range fa0/1-6

         switchport trunk encapsulation dot1q

         switchport mode trunk

         vtp domain cisco

         vtp mode client

  

  其它6台交换机的fa0/1做为trunk口和上面的3550连接;

         int range fa0/1

         witchport trunk encapsulation dot1q

         switchport mode trunk

         vtp domain cisco

         vtp mode client

  

  交换机都做TRUNK是可以互相学习到vlan信息的;

  

  注:其他交换机中根本就没有vtp这个概念,只有Cisco的交换机可以。

PIX Failove配置实例

Failover的系统需求

  要配置pix failover需要两台PIX满足如下要求:

型号一致(PIX 515E不能和PIX 515进行failover)

软件版本相同

激活码类型一致(都是DES或3DES)

闪存大小一致

内存大小一致

  Failover中的两个设备中,至少需要一个是UR的版本,另一个可以是FO或者UR版本。R版本不能用于Failover,两台都是FO版版也不能用于同一个Failover环境。

  注意 Pix501、Pix506/506E均不支持Failover特性。

理解Failover

  Failover可以在主设备发生故障时保护网络,在配置了Stateful Failover的情况下,在从主Pix迁移到备PIX时可以不中断TCP连接。Failover发生时,两个设备都将改变状态,当前活动的PIX将自己的IP和MAC地址都改为已失效的PIX的相应的IP和MAC地址,并开始工作。而新的备用PIX则将自己的IP和MAC设置为原备份地址。对于其它网络设备来说,由于IP和MAC都没改变,在网络中的任何地方都不需要改变arp表,也不需要等待ARP超时。

  一旦正确配置了主Pix,并将电缆连接正确,主Pix将自动把配置发送到备份的PIX上面。Failover可以在所有的以太网接口上工作良好,但Stateful Failover所使用的接口只能是百兆或千兆口。

  在未配置Failover或处于Failover活动状态时,pix515/515E/525/535前面板上的ACT指示灯亮,处于备用状态时,该灯灭。

  将两台PIX连在一起做Fairover有两种方式:使用一条专用的高速Failover电缆做基于电缆的Failover,或者使用连接到单独的交换机/VLAN间的单独的接口的基于网络的的Failover。如果做stateful Failover或做基于网络的Failover时,推荐使用100兆全双工或千兆连接。

  警告 做Stateful Failover时所使用的Failover连接的速度不能低于正常工作的接口的速度。

  Failover特性使PIX每隔15秒(可以使用Failover poll命令设置)就对自己的接口进行一次ARP查询。只有禁用Failover这种查询才会停止。

  注意 使用static命令不当会造成Failover不能正常工作。

  没有定义特殊端口的static命令,转换一个接口上接收到的流量的地址,然而,备份的PIX必须能和主PIX的每一个启用了的接口通讯,以检查该接口是否处于活动状态。

  例如,下面的例子会打断正常的通讯,而不能使用:

   static (inside,outside) interface 192.168.1.1

  这个命令转换从outside接口来来的流量到inside接口,并转发到182.168.1.1,包括从备用PIX发过来的Failover信息。因为备用PIX无法收到响应信息,它就认为主PIX的该接口不活动,这样,备份PIX就将切换到活动状态。

  要创建一个不会对Failover造成影响的static语句,在Static命令中加入端口信息。例如上例可以改写为如下形式:

  static (inside, outside) tcp interface 80 192.168.1.1 80

  这样,就只会转换Http流量(80端口),而对Failover信息没有影响。如果还需要转换其它流量,可以为每个端口写一条Static语句

  在主PIX上配置Failover需要使用到如下命令:

failover 启用Failover

failover ip address 为备用PIX分配接口地址

failover link 启用Stateful Failover

failover lan 配置基于网络的Failover

配置基于Failover电缆的Failover

  注意 如果备用PIX处于开电状态,在进行下面的操作前先将它关掉。

  第一步 在活动的PIX上用clock set命令同步时钟

  第二步 将主、从PIX上配置了IP地址的所有接口的网线都接好。

  第三步 将Failover电缆上标有"Primary"的那头接到主PIX的Failover口上,标有"Secondary"的那头接到从PIX上面

  第四步 只配置主PIX.在主PIX上使用write mem命令时,配置会自动写到备用PIX的FLASH中。

注意 在系统提示可以打开备用Pix前,不要给备用PIX上电。

  第五步 使用conf t命令进入配置模式

  第六步 确认在配置的任何一个interface命令中都没有使用auto或1000auto选项,要查看interface命令,可以使用wr term。如果有使用auto选项的则需要重新输入。确认每条链路两端的。

注意 如果使用Stateful Failover,在使用一条交换线直接连接两台PIX时,一要要注意在interface命令中使用100full或1000sxfull选项,而且在Stateful Failover连接上的MTU一定要设置为1500或更大。

  Stateful Failover所使用的接口卡的速度和总线速度必须大于等于工作中的其它接口的接口速度和总线速度,例如,inside和outside使用的安装在总线0上的PIX-1GE-66卡,则Failover连接必须也使用PIX-1GE-66卡,并安装在总线1上,在这种情况不,不能使用Pix-1GE或PIX-1FE的卡,也不能在总线2或使用一个更慢的卡共享总线1的。

  第七步 在interface配置正确后使用clear xlate命令.

  第八步 正确配置接口的IP地址。配置完后可以使用show ip address命令查看:

show ip address

System IP Addresses:

ip address outside 192.168.1.1 255.255.255.0

ip address inside 10.1.1.1 255.255.255.0

ip address intf2 192.168.2.1 255.255.255.0

ip address intf3 192.168.3.1 255.255.255.0

ip address 4th 172.16.1.1 255.255.255.0

Current IP Addresses:

ip address outside 192.168.1.1 255.255.255.0

ip address inside 10.1.1.1 255.255.255.0

ip address intf2 192.168.2.1 255.255.255.0

ip address intf3 192.168.3.1 255.255.255.0

ip address 4th 172.16.1.1 255.255.255.0

  当主PIX处于活动状态时,Current IP Addresses和System IP Addresses相同,当主PIX得失效状态时,Current IP Addresses会变成备用PIX的IP地址.

  第九步 在主PIX上使用failover命令启用Failover。

  第十步 使用show failover验证状态,输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 225 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf3 (192.168.3.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (0.0.0.0): Unknown (Waiting)

Interface intf3 (0.0.0.0): Unknown (Waiting)

Interface intf2 (0.0.0.0): Unknown (Waiting)

Interface outside (0.0.0.0): Unknown (Waiting)

Interface inside (0.0.0.0): Unknown (Waiting)

show failover命令输出的cable状态可能有如下值:

My side not connected—标志着在使用show failover命令时failover电缆未正确连接。

Normal—标志主从pix都操作正常.

Other side is not connected—标志对端未正确连接failover电缆。

Other side powered off—标志对端没开电。

  在接口IP地址右边的标志有如下类型:

Failed—接口失效.

Link Down—接口链路层协议

Normal—正常

Shut Down—该接口被手工停用了(在interfac命令中使用了shutown参数)

Unknown—该接口未配置IP地

Waiting—还没有开始监视对端的接口状态。

  第十一步 使用failover ip address命令声明备用PIX的每一个接口的地址,只需要在主pix上配置,该地址不能和主PIX的地址相当,但每一个接口的地址都可以在同一个子网内。如下例年示:

failover ip address inside 10.1.1.2

failover ip address outside 192.168.1.2

failover ip address intf2 192.168.2.2

failover ip address intf3 192.168.3.2

failover ip address 4th 172.16.1.2

  配置后,再show failover的输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 510 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf3 (192.168.3.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (172.16.1.2): Unknown (Waiting)

Interface intf3 (192.168.3.2): Unknown (Waiting)

Interface intf2 (192.168.2.2): Unknown (Waiting)

Interface outside (192.168.1.2): Unknown (Waiting)

Interface inside (10.1.1.2): Unknown (Waiting)

  第十二步 如果要配置Stateful Failover,使用failover link命令来定义要使用哪一个接口来传输状态信息,在本例中使用4th,命令如下:

  failover link 4th

  第十三步 启用Stateful Failover,show failover命令的输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 510 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf3 (192.168.3.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (172.16.1.2): Unknown (Waiting)

Interface intf3 (192.168.3.2): Unknown (Waiting)

Interface intf2 (192.168.2.2): Unknown (Waiting)

Interface outside (192.168.1.2): Unknown (Waiting)

Interface inside (10.1.1.2): Unknown (Waiting)

Stateful Failover Logical Update Statistics

Link : 4th

Stateful Obj xmit xerr rcv rerr

General 0 0 0 0

sys cmd 0 0 0 0

up time 0 0 0 0

xlate 0 0 0 0

tcp conn 0 0 0 0

udp conn 0 0 0 0

ARP tbl 0 0 0 0

RIP Tbl 0 0 0 0

Logical Update Queue Information

Cur Max Total

Recv Q: 0 0 0

Xmit Q: 0 0 0

  在"Stateful Failover Logical Update Statistics"一段中的各部分的意义如下:

Stateful Obj—PIX stateful对象

xmit—传送到另一台设备的包数量

xerr—在传送过程中出现的错误包的数量

rcv—收以的包数量

rerr—收到的错误包的数量

  每一行的状态对象定义如下:

General—所有的状态对象汇总

sys cmd—系统命令,例LOGIN和Stay Alive

up time—启用时间

xlate—转换信息

tcp conn—CTCP连接信息

udp conn—动态UDP连接信息

ARP tbl—动态ARP表信息

RIF Tbl—动态路由表信息

  第十四步 如果需要将轮询时间改得小于15秒,以保证正常工作,可以使用Failover poll seconds命令,缺省值为15秒,最小3秒,最大15秒。将轮询时间改小,会更快的检测到失效,但也也由于临时的拥塞和导致不必要的切换。

  第十五步 打开备用pix的电源,一上电,主pix就会将配置同步到备用PIX上面,会出现 "Sync Started"和"Sync Completed"两条信息.

  第十六步 在备用的pix启用后,show failover命令的输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 510 (sec)

Interface 4th (172.16.1.1): Normal

Interface intf3 (192.168.3.1): Normal

Interface intf2 (192.168.2.1): Normal

Interface outside (192.168.1.1): Normal

Interface inside (10.1.1.1): Normal

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (172.16.1.2): Normal

Interface intf3 (192.168.3.2): Normal

Interface intf2 (192.168.2.2): Normal

Interface outside (192.168.1.2): Normal

Interface inside (10.1.1.2): Normal

Stateful Failover Logical Update Statistics

Link : 4th

Stateful Obj xmit xerr rcv rerr

General 0 0 0 0

sys cmd 0 0 0 0

up time 0 0 0 0

xlate 0 0 0 0

tcp conn 0 0 0 0

udp conn 0 0 0 0

ARP tbl 0 0 0 0

RIP Tbl 0 0 0 0

Logical Update Queue Information

Cur Max Total

Recv Q: 0 0 0

Xmit Q: 0 0 0

  第十七步 使用wr mem命令将配置同时写入主从pix.

配置基于LAN的Failover

  从PixOS 6.2开始支持基于LAN的Failover,这样,就不再需要Fairover电缆了。基于LAN的Fairover突破了Failover的6英尺的距离限制。

  注意 要配置基于LAN的Failover,每台PIX需要一个单独的以太接口,并且必须接在一台交换的交换机或一个单独的VLAN上。不能使用交叉线将两台PIX直接连接起来。

  在基于LAN的Failover中,Fairover消息通过LAN进行传输,所有相关的安全性要低于基于Failover电缆的做法,在PIX os 6.2中提供了一种使用手工预先设置共享密码的加密与认证机制。

配置步骤:

  第一步 在活动的PIX上面用Clock set命令设置时钟

  第二步 将主、从PIX上除用于LAN Fairover以外的所有配置了IP地址的所有接口的网线都接好。

  第三步 如果连接了Fairover电缆,把它给拨掉。

  第四步 只配置主PIX.在主PIX上使用write mem命令时,配置会自动写到备用PIX的FLASH中。

注意 在系统提示可以打开备用Pix前,不要给备用PIX上电。

  第五步 使用conf t命令进入配置模式

  第六步 确认在配置的任何一个interface命令中都没有使用auto或1000auto选项,要查看interface命令,可以使用wr term。如果有使用auto选项的则需要重新输入。确认每条链路两端的。

注意 如果使用Stateful Failover,在使用一条交换线直接连接两台PIX时,一要要注意在interface命令中使用100full或1000sxfull选项,而且在Stateful Failover连接上的MTU一定要设置为1500或更大。

  Stateful Failover所使用的接口卡的速度和总线速度必须大于等于工作中的其它接口的接口速度和总线速度,例如,inside和outside使用的安装在总线0上的PIX-1GE-66卡,则Failover连接必须也使用PIX-1GE-66卡,并安装在总线1上,在这种情况不,不能使用Pix-1GE或PIX-1FE的卡,也不能在总线2或使用一个更慢的卡共享总线1的。

  第七步 在interface配置正确后使用clear xlate命令.

  第八步 正确配置接口的IP地址。配置完后可以使用show ip address命令查看:

show ip address

System IP Addresses:

ip address outside 192.168.1.1 255.255.255.0

ip address inside 10.1.1.1 255.255.255.0

ip address intf2 192.168.2.1 255.255.255.0

ip address intf3 192.168.3.1 255.255.255.0

ip address 4th 172.16.1.1 255.255.255.0

Current IP Addresses:

ip address outside 192.168.1.1 255.255.255.0

ip address inside 10.1.1.1 255.255.255.0

ip address intf2 192.168.2.1 255.255.255.0

ip address intf3 192.168.3.1 255.255.255.0

ip address 4th 172.16.1.1 255.255.255.0

  当主PIX处于活动状态时,Current IP Addresses和System IP Addresses相同,当主PIX得失效状态时,Current IP Addresses会变成备用PIX的IP地址.

  

  第九步 在主PIX上使用failover命令启用Failover。

  第十步 使用show failover验证状态,输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 225 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf3 (192.168.3.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (0.0.0.0): Unknown (Waiting)

Interface intf3 (0.0.0.0): Unknown (Waiting)

Interface intf2 (0.0.0.0): Unknown (Waiting)

Interface outside (0.0.0.0): Unknown (Waiting)

Interface inside (0.0.0.0): Unknown (Waiting)

show failover命令输出的cable状态可能有如下值:

My side not connected—标志着在使用show failover命令时failover电缆未正确连接。

Normal—标志主从pix都操作正常.

Other side is not connected—标志对端未正确连接failover电缆。

Other side powered off—标志对端没开电。

  在接口IP地址右边的标志有如下类型:

Failed—接口失效.

Link Down—接口链路层协议

Normal—正常

Shut Down—该接口被手工停用了(在interfac命令中使用了shutown参数)

Unknown—该接口未配置IP地

Waiting—还没有开始监视对端的接口状态。

  第十一步 使用failover ip address命令声明备用PIX的每一个接口的地址,只需要在主pix上配置,该地址不能和主PIX的地址相当,但每一个接口的地址都可以在同一个子网内。如下例年示:

failover ip address inside 10.1.1.2

failover ip address outside 192.168.1.2

failover ip address intf2 192.168.2.2

failover ip address intf3 192.168.3.2

failover ip address 4th 172.16.1.2

  配置后,再show failover的输出如下:

show failover

Failover On

Cable status: Other side powered off

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 510 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf3 (192.168.3.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (172.16.1.2): Unknown (Waiting)

Interface intf3 (192.168.3.2): Unknown (Waiting)

Interface intf2 (192.168.2.2): Unknown (Waiting)

Interface outside (192.168.1.2): Unknown (Waiting)

Interface inside (10.1.1.2): Unknown (Waiting)

  第十二步 将用于LAN Fairover的接口接入网络,然后在主PIX上配置:

no failover

failover lan unit primary

failover lan interface intf3

failover lan key 1234567

failover lan enable

failover

  第十三步 如果要配置Stateful Failover,使用failover link命令来定义要使用哪一个接口来传输状态信息,在本例中使用4th,命令如下:

  failover link 4th

  第十四步 启用Stateful Failover,show failover命令的输出如下:

show failover

Failover On

Cable status: Unknown

Reconnect timeout 0:00:00

Poll frequency 15 seconds

This host: primary - Active

Active time: 510 (sec)

Interface 4th (172.16.1.1): Normal (Waiting)

Interface intf2 (192.168.2.1): Normal (Waiting)

Interface outside (192.168.1.1): Normal (Waiting)

Interface inside (10.1.1.1): Normal (Waiting)

Other host: secondary - Standby

Active time: 0 (sec)

Interface 4th (172.16.1.2): Unknown (Waiting)

Interface intf2 (192.168.2.2): Unknown (Waiting)

Interface outside (192.168.1.2): Unknown (Waiting)

Interface inside (10.1.1.2): Unknown (Waiting)

Stateful Failover Logical Update Statistics

Link : 4th

Stateful Obj xmit xerr rcv rerr

General 0 0 0 0

sys cmd 0 0 0 0

up time 0 0 0 0

xlate 0 0 0 0

tcp conn 0 0 0 0

udp conn 0 0 0 0

ARP tbl 0 0 0 0

RIP Tbl 0 0 0 0

Logical Update Queue Information

Cur Max Total

Recv Q: 0 0 0

Xmit Q: 0 0 0

Lan Based Failover is Active

Interface intf3 (192.168.3.1): Normal, peer (192.168.3.2) Unknown

  在"Stateful Failover Logical Update Statistics"一段中的各部分的意义如下:

Stateful Obj—PIX stateful对象

xmit—传送到另一台设备的包数量

xerr—在传送过程中出现的错误包的数量

rcv—收以的包数量

rerr—收到的错误包的数量

  每一行的状态对象定义如下:

General—所有的状态对象汇总

sys cmd—系统命令,例LOGIN和Stay Alive

up time—启用时间

xlate—转换信息

tcp conn—CTCP连接信息

udp conn—动态UDP连接信息

ARP tbl—动态ARP表信息

RIF Tbl—动态路由表信息

  第十五步 如果需要将轮询时间改得小于15秒,以保证正常工作,可以使用Failover poll seconds命令,缺省值为15秒,最小3秒,最大15秒。将轮询时间改小,会更快的检测到失效,但也也由于临时的拥塞和导致不必要的切换。

  第十六步 在不接用于Fairover电缆的情况下打开备用pix电源,然后进行如下配置:

nameif ethernet3 intf3 security40

interface ethernet3 100full

ip address intf3 192.168.3.1 255.255.255.0

failover ip address intf3 192.168.3.2

failover lan unit secondary <--optional

failover lan interface intf3

failover lan key 1234567

failover lan enable

failover

wr mem

reload

Cisco基于策略路由的配置实例

Cisco基于策略路由的配置实例

问题描述

  您可以定义自己的规则来进行数据包的路由而不仅仅由目的地地址所决定。在这里

您可以学到怎么使用基于策略路由的办法来解决这一问题。

  在具体的应用中,基于策略的路由有:

  ☆ 基于源IP地址的策略路由

  ☆ 基于数据包大小的策略路由

  ☆ 基于应用的策略路由

  ☆ 通过缺省路由平衡负载

  这里,讲述了第一种情况的路由策略。

举例

  在这个例子中,防火墙的作用是:把10.0.0.0/8内部网地址翻译成可路由的172.16

.255.0/24子网地址。

         

  下面的防火墙配置是为了完整性而加进去的,它不是策略路由配置所必需的。在这

里的防火墙可以被其它类似的产品代替,如PIX或其它类似防火墙设备。这里的防火墙的

配置如下:

  !

  ip nat pool net-10 172.16.255.1 172.16.255.254 prefix-length 24

  ip nat inside source list 1 pool net-10

  !

  interface Ethernet0

   ip address 172.16.20.2 255.255.255.0

   ip nat outside

  !

  interface Ethernet1

   ip address 172.16.39.2 255.255.255.0

   ip nat inside

  !

  router eigrp 1

   redistribute static

   network 172.16.0.0

   default-metric 10000 100 255 1 1500

  !

  ip route 172.16.255.0 255.255.255.0 Null0

  access-list 1 permit 10.0.0.0 0.255.255.255

  !

  end

  在我们的例子中,Cisco WAN路由器上运行策略路由来保证从10.0.0.0/8网络来的IP数据包被发送到防火墙去。配置中定义了两条net-10策略规则。第一条策略就定义了从10.0.0.0/8网络来的IP数据包被发送到防火墙去(我们很快会看到这里的配置有问题)。而第二条规则允许所有的其它数据包能按正常路由。这里的Cisco WAN路由器的配置如下:

  !

  interface Ethernet0/0

   ip address 172.16.187.3 255.255.255.0

   no ip directed-broadcast

  !

  interface Ethernet0/1

   ip address 172.16.39.3 255.255.255.0

   no ip directed-broadcast

  !

  interface Ethernet3/0

   ip address 172.16.79.3 255.255.255.0

   no ip directed-broadcast

   ip policy route-map net-10

  !

  router eigrp 1

   network 172.16.0.0

  !

  access-list 110 permit ip 10.0.0.0 0.255.255.255 172.16.36.0 0.0.0.255

  access-list 111 permit ip 10.0.0.0 0.255.255.255 any

  !

  route-map net-10 permit 10

   match ip address 111

   set interface Ethernet0/1

  !

  route-map net-10 permit 20

  !

  end

  我们可以这样测试我们所做的配置。在名为Cisco-1的路由器10.1.1.1上发送ping命

令到Internet上的一个主机(这里就是192.1.1.1主机)。要查看名为Internet Router

的路由器上的情况,我们在特权命令模式下执行debug ip packet 101 detail命令。(

其中,在此路由器上有access-list 101 permit icmp any any配置命令)。下面是输出

结果:

  Results of ping from Cisco-1 to 192.1.1.1/internet taken from Internet_R

outer:

  Pakcet never makes it to Internet_Router

  正如您所看到的:数据包没有到达Internet_Router路由器。下面的在Cisco WAN路

由器上的debug命令给出了原因:

  Debug commands run from Cisco_WAN_Router:

  "debug ip policy"

  2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1, len 100, policy match

  2d15h: IP: route map net-10, item 10, permit

  2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1 (Ethernet0/1), len 100,

policy routed

  2d15h: IP: Ethernet3/0 to Ethernet0/1 192.1.1.1

  这里,数据包确实匹配了net-10策略图中的第一条规则。但为什么还是没有达到预

期的目的呢?用"debug arp"来看一下。

  "debug arp"

  2d15h: IP ARP: sent req src 172.16.39.3 0010.7bcf.5b02,

              dst 192.1.1.1 0000.0000.0000 Ethernet0/1

  2d15h: IP ARP rep filtered src 192.1.1.1 00e0.b064.243d, dst 172.16.39.3

0010.7bcf.5b02

       wrong cable, interface Ethernet0/1

  debug arp的输出给出了原因。路由器努力完成它被指示要做的动作,而且试图把数

据包发向Ethernet0/1接口,但失败了。这要求路由器为目的地址192.1.1.1执行地址解

析协议操作,当执行该任务时,路由器知道了目的地址不处于该接口。接下来,路由器

发生封装错误。所以,最后数据包不能到达192.1.1.1。

  我们怎样避免这个问题呢?修改路由图使防火墙地址为下一跳。

  Config changed on Cisco_WAN_Router:

  !

  route-map net-10 permit 10

   match ip address 111

   set ip next-hop 172.16.39.2

  !

修改后,在Internet Router上运行同样的命令:debug ip packet 101 detail。这时,

数据包可以按配置前进。我们也能看到数据包被防火墙翻译成了172.16.255.1。192.1.

1.1主机的回应:

  Results of ping from Cisco_1 to 192.1.1.1/internet taken from Internet_R

outer:

  2d15h: IP: s=172.16.255.1 (Ethernet1), d=192.1.1.1 (Serial0), g=192.1.1.

1, len 100, forward

  2d15h: ICMP type=8, code=0

  2d15h:

  2d15h: IP: s=192.1.1.1 (Serial0), d=172.16.255.1 (Ethernet1), g=172.16.2

0.2, len 100, forward

  2d15h: ICMP type=0, code=0

  2d15h:

  在Cisco WAN路由器上执行debug ip policy命令后,我们可以看到数据包被传递到

了防火墙,172.16.39.2:

  Debug commands run from Cisco_WAN_Router:

  "debug ip policy"

  2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1, len 100, policy match

  2d15h: IP: route map net-10, item 20, permit

  2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1 (Ethernet0/1), len 100,

policy routed

  2d15h: IP: Ethernet3/0 to Ethernet0/1 172.16.39.2

反向访问控制列表配置实例



我们采用如图所示的网络结构。路由器连接了二个网段,分别为172.16.4.0/24,172.16.3.0/24。在172.16.4.0/24网段中的计算机都是服务器,我们通过反向ACL设置保护这些服务器免受来自172.16.3.0这个网段的病毒***。

配置实例:禁止病毒从172.16.3.0/24这个网段传播到172.16.4.0/24这个服务器网段。

路由器配置命令:

access-list 101 permit tcp 172.16.3.0 0.0.0.255 172.16.4.0 0.0.0.255 established 定义ACL101,容许所有来自172.16.3.0网段的计算机访问172.16.4.0网段中的计算机,前提是TCP连接已经建立了的。当TCP连接没有建立的话是不容许172.16.3.0访问172.16.4.0的。

int e 1 进入E1端口

ip access-group 101 out 将ACL101宣告出去

设置完毕后病毒就不会轻易的从172.16.3.0传播到172.16.4.0的服务器区了。因为病毒要想传播都是主动进行TCP连接的,由于路由器上采用反向ACL禁止了172.16.3.0网段的TCP主动连接,因此病毒无法顺利传播。

小提示:检验反向ACL是否顺利配置的一个简单方法就是拿172.16.4.0里的一台服务器PING在172.16.3.0中的计算机,如果可以PING通的话再用172.16.3.0那台计算机PING172.16.4.0的服务器,PING不通则说明ACL配置成功。

通过上文配置的反向ACL会出现一个问题,那就是172.16.3.0的计算机不能访问服务器的服务了,假如图中172.16.4.13提供了WWW服务的话也不能正常访问。解决的方法是在ESTABLISHED那句前头再添加一个扩展ACL规则,例如:access-list 101 permit tcp 172.16.3.0 0.0.0.255 172.16.4.13 0.0.0.0 eq www

这样根据“最靠近受控对象原则”即在检查ACL规则时是采用自上而下在ACL中一条条检测的,只要发现符合条件了就立刻转发,而不继续检测下面的ACL语句。172.16.3.0的计算机就可以正常访问该服务器的WWW服务了,而下面的ESTABLISHED防病毒命令还可以正常生效。

笔者所在公司就使用的这种反向ACL的方式进行防病毒的,运行了一年多效果很不错,也非常稳定。

Cisco PIX515配置实例

Cisco PIX配置实例

想通过pix做snat使内网用户上网,再做dnat使访问本公网IP的http服务、ssh服务转换为192.168.4.2的http服务、ssh服务,对192.168.4.2开放本pix的telnet服务

  

  pix515防火墙配置策略实例

  

  #转换特权用户

  pixfirewall>ena

  pixfirewall#

  

  #进入全局配置模式

  pixfirewall# conf t

  

  #激活内外端口

  interface ethernet0 auto

  interface ethernet1 auto

  

  #下面两句配置内外端口的安全级别

  nameif ethernet0 outside security0

  nameif ethernet1 inside security100

  

  #配置防火墙的用户信息

  enable password pix515

  hostname pix515

  domain-name domain

  

  #下面几句配置内外网卡的IP地址

  ip address inside 192.168.4.1 255.255.255.0

  ip address outside 公网IP 公网IP子网掩码

  global (outside) 1 interface

  nat (inside) 1 192.168.4.0 255.255.255.0 0 0

  

  #下面两句将定义转发公网IP的ssh和www服务到192.168.4.2

  static (inside,outside) tcp 公网IP www 192.168.4.2 www netmask 255.255.255.255 0 0

  static (inside,outside) tcp 公网IP ssh 192.168.4.2 ssh netmask 255.255.255.255 0 0

  

  #下面两句将定义外部允许访问内部主机的服务

  conduit permit tcp host 公网IP eq www any

  conduit permit tcp host 公网IP eq ssh 信任IP 255.255.255.255

  

  #允许内部服务器telnet pix

  telnet 192.168.4.2 255.255.255.0 inside

  

  #下面这句允许ping

  conduit permit icmp any any

  

  #下面这句路由网关

  route outside 0.0.0.0 0.0.0.0 公网IP网关 1

  

  #保存配置

  write memory

Cisco SONET 配置实例

Cisco SONET 配置实例

controller SONET 6/0/0

framing sdh

clock source internal

!

au-4 1 tug-3 1

tug-2 1 e1 1 unframed

tug-2 1 e1 2 unframed

tug-2 1 e1 3 unframed

tug-2 2 e1 1 unframed

tug-2 2 e1 2 unframed

tug-2 2 e1 3 unframed

tug-2 3 e1 1 unframed

tug-2 3 e1 2 unframed

tug-2 3 e1 3 unframed

tug-2 4 e1 1 unframed

tug-2 4 e1 2 unframed

tug-2 4 e1 3 unframed

tug-2 5 e1 1 unframed

tug-2 5 e1 2 unframed

tug-2 5 e1 3 unframed

tug-2 6 e1 1 unframed

tug-2 6 e1 2 unframed

tug-2 6 e1 3 unframed

tug-2 7 e1 1 unframed

tug-2 7 e1 2 unframed

tug-2 7 e1 3 unframed

!

au-4 1 tug-3 2

idle pattern 0x0

tug-2 1 e1 1 unframed

tug-2 1 e1 2 unframed

tug-2 1 e1 3 unframed

tug-2 2 e1 1 unframed

tug-2 2 e1 2 unframed

!

au-4 1 tug-3 3

idle pattern 0x0

!

..........

...........

............

interface Serial6/0/0.1/1/1/1:0

no ip address

encapsulation ppp

tx-queue-limit 26

ppp multilink

multilink-group 1

!

interface Serial6/0/0.1/1/1/2:0

no ip address

encapsulation ppp

tx-queue-limit 26

ppp multilink

multilink-group 1

!

interface Serial6/0/0.1/1/1/3:0

no ip address

encapsulation ppp

no fair-queue

ppp multilink

multilink-group 1

!

interface Serial6/0/0.1/1/2/1:0

no ip address

encapsulation ppp

no fair-queue

ppp multilink

multilink-group 1

!

interface Serial6/0/0.1/1/2/2:0

no ip address

encapsulation ppp

tx-queue-limit 26

ppp multilink

multilink-group 2

!

interface Serial6/0/0.1/1/2/3:0

description To_

no ip address

encapsulation ppp

tx-queue-limit 26

ppp multilink

multilink-group 2

!

interface Serial6/0/0.1/1/3/1:0

description To

no ip address

encapsulation ppp

tx-queue-limit 26

ppp multilink

multilink-group 2

!

interface Serial6/0/0.1/1/3/2:0

no ip address

encapsulation ppp

no fair-queue

ppp multilink

multilink-group 2

!

interface Serial6/0/0.1/1/3/3:0

no ip address

encapsulation ppp

no fair-queue

ppp multilink

multilink-group 2

!

..........

...........

............

interface Multilink1

ip address X.X.X.X 255.255.255.252

mpls label protocol ldp

tag-switching ip

ppp multilink

multilink-group 1

!

interface Multilink2

ip address X.X.X.X 255.255.255.252

mpls label protocol ldp

tag-switching ip

ppp multilink

multilink-group 2

!

To configure a logical channel group on an E1 line, use the tug-2 <tug-2#> e1 <e1#> channel-group <channel-group#> timeslots

<list-of-timeslots> command where:

tug-2# is a value from 1 to 7

e1# is a value from 1 to 3

channel-group# is a value from 0 to 30

list-of-timeslots can be a value from 1 to 31 or a combination of subranges within the range 1 to 31 (each subrange is a list

of time slots that makes up the E1 line).

In the following example, logical channel group 15 on E1 line 1 is configured and channelized time slots 1 to 5 and 20 to 23

are assigned to the newly created logical channel group:

Router(config)# controller sonet 1/1/0

Router(config-controller)# framing sdh

Router(config-controller)# aug mapping au-4

Router(config-controller)# au-4 1 tug-3 2

Router(config-controller-tug3)# mode c-12

Router(config-controller-tug3)# tug-2 4 e1 1 channel-group 15 timeslots 1-5, 20-23

Router(config-controller-tug3)# exit

Router(config-controller)# exit

Cisco 路由器端口限速配置实例

2610(config)# access-list 2 permit 192.168.0.15 0.0.0.63

2610(config)# class-map acgroup2

2610(config-cmap)# match access-group 2

2610(config-cmap)# exit

2610(config)# policy-map police

2610(config-pmap)# class acgroup2

2610(config-pmap-c)# police 20000 2000 4000 conform-action transmit exceed-action drop

2610(config-pmap-c)# exit

2610(config-pmap)# exit

2610(config)# interface ethernet 0/0

2610(config-if)# service-policy input police

CISCO7114路由器配置实例

7114#sh run

Building configuration...

Current configuration : 2671 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

service password-encryption

!

hostname 7114

!

enable secret 5 xxxxxx

!

no cable qos permission create

no cable qos permission update

cable qos permission modems

cable time-server

clock timezone PDT -8

ip subnet-zero

no ip routing

no ip domain-lookup

!

ip ssh time-out 120

ip ssh authentication-retries 3

!

!

!

!

!

!

!

interface FastEthernet0/0

ip address 10.1.0.14 255.255.255.252

no ip route-cache

no ip mroute-cache

duplex full

speed 100

no cdp enable

!

interface FastEthernet0/1

no ip address

no ip route-cache

no ip mroute-cache

duplex full

speed 100

no cdp enable

bridge-group 2

bridge-group 2 spanning-disabled

!

interface Cable1/0

ip address 10.2.0.2 255.255.0.0

ip helper-address 10.2.0.6

no ip route-cache

no ip mroute-cache

no keepalive

cable downstream annex B

cable downstream modulation 256qam

cable downstream interleave-depth 32

cable downstream frequency 714000000

no cable upstream 0 shutdown

cable downstream rf-power 50

cable downstream channel-id 0

cable upstream 0 frequency 30000000

cable upstream 0 power-level 0

cable upstream 0 channel-width 3200000

cable upstream 0 minislot-size 4

no cable upstream 0 shutdown

cable upstream 1 frequency 30000000

cable upstream 1 power-level 0

cable upstream 1 channel-width 3200000

cable upstream 1 minislot-size 4

no cable upstream 1 shutdown

cable upstream 2 frequency 30000000

cable upstream 2 power-level 0

cable upstream 2 channel-width 3200000

cable upstream 2 minislot-size 4

no cable upstream 2 shutdown

cable upstream 3 frequency 30000000

cable upstream 3 power-level 0

cable upstream 3 channel-width 3200000

cable upstream 3 minislot-size 4

no cable upstream 3 shutdown

bridge-group 2

bridge-group 2 subscriber-loop-control

!

ip default-gateway 10.1.0.13

ip classless

no ip http server

!

!

no cdp run

snmp-server community xxxxxx RO

snmp-server community xxxxxx RO

snmp-server manager

banner motd ^C

Cisco 7114

Welcome

^C

alias exec scm show cable modem

alias exec sd show int cable1/0 downstream

alias exec su show int cable1/0 upstream

alias exec sr show cable modem remote-query

alias exec scf show cable flap

alias exec ccm clear cable modem

alias exec scc show controllers cable 1/0

!

line con 0

timeout login response 300

password 7 000000

logging synchronous

login

line aux 0

password 7 000000

logging synchronous

login

line vty 0 4

password 7 000000

logging synchronous

login

!

end

PIX-PPTP ***配置实例

pixfirewall(config)# sh run

: Saved

:

PIX Version 6.3(5)

interface ethernet0 auto

interface ethernet1 auto

nameif ethernet0 outside security0

nameif ethernet1 inside security100

enable password 8Ry2YjIyt7RRXU24 encrypted

passwd 2KFQnbNIdI.2KYOU encrypted

hostname pixfirewall

fixup protocol dns maximum-length 512

fixup protocol ftp 21

fixup protocol h323 h225 1720

fixup protocol h323 ras 1718-1719

fixup protocol http 80

fixup protocol rsh 514

fixup protocol rtsp 554

fixup protocol sip 5060

fixup protocol sip udp 5060

fixup protocol skinny 2000

fixup protocol smtp 25

fixup protocol sqlnet 1521

fixup protocol tftp 69

names

access-list acl_out permit ip any any

access-list acl_in permit ip any any

access-list nonat permit ip 192.168.0.0 255.255.255.0 192.168.0.0 255.255.255.0

pager lines 24

mtu outside 1500

mtu inside 1500

ip address outside 10.0.0.1 255.255.255.0

ip address inside 192.168.0.2 255.255.255.0

ip audit info action alarm

ip audit attack action alarm

ip local pool testpool 192.168.0.100-192.168.0.110

ip local pool cisco 192.168.0.120-192.168.0.130

no failover

failover timeout 0:00:00

failover poll 15

no failover ip address outside

no failover ip address inside

pdm history enable

arp timeout 14400

nat (inside) 0 access-list nonat

nat (inside) 0 0.0.0.0 0.0.0.0 0 0

access-group acl_out in interface outside

access-group acl_in in interface inside

route outside 0.0.0.0 0.0.0.0 192.168.0.1 1

timeout xlate 3:00:00

timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00

timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout sip-disconnect 0:02:00 sip-invite 0:03:00

timeout uauth 0:05:00 absolute

aaa-server TACACS+ protocol tacacs+

aaa-server TACACS+ max-failed-attempts 3

aaa-server TACACS+ deadtime 10

aaa-server RADIUS protocol radius

aaa-server RADIUS max-failed-attempts 3

aaa-server RADIUS deadtime 10

aaa-server LOCAL protocol local

no snmp-server location

no snmp-server contact

snmp-server community public

no snmp-server enable traps

floodguard enable

sysopt connection permit-ipsec

crypto ipsec transform-set aaades esp-des esp-md5-hmac

crypto dynamic-map dynomap 10 set transform-set aaades

crypto map mymap 20 ipsec-isakmp dynamic dynomap

crypto map mymap client configuration address initiate

crypto map mymap client configuration address respond

crypto map mymap client authentication LOCAL

crypto map mymap interface outside

isakmp enable outside

isakmp key ******** address 0.0.0.0 netmask 0.0.0.0

isakmp client configuration address-pool local testpool outside

isakmp policy 10 authentication pre-share

isakmp policy 10 encryption des

isakmp policy 10 hash md5

isakmp policy 10 group 2

isakmp policy 10 lifetime 86400

***group usergroup address-pool testpool

***group usergroup idle-time 1800

***group usergroup password ********

telnet timeout 5

ssh timeout 5

console timeout 0

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 ppp encryption mppe 40

vpdn group 1 client configuration address local cisco

vpdn group 1 pptp echo 60

vpdn group 1 client authentication local

vpdn username 123 password *********

vpdn enable outside

username user1 password tJsDL6po9m1UFs.h encrypted privilege 2

terminal width 80

Cryptochecksum:49fcf8e651150adf5ce5d8f749987ba2

: end

pixfirewall(config)#

PIX-***-Client配置实例

pixfirewall(config)# sh run

: Saved

:

PIX Version 6.3(5)

interface ethernet0 auto

interface ethernet1 auto

nameif ethernet0 outside security0

nameif ethernet1 inside security100

enable password 8Ry2YjIyt7RRXU24 encrypted

passwd 2KFQnbNIdI.2KYOU encrypted

hostname pixfirewall

fixup protocol dns maximum-length 512

fixup protocol ftp 21

fixup protocol h323 h225 1720

fixup protocol h323 ras 1718-1719

fixup protocol http 80

fixup protocol rsh 514

fixup protocol rtsp 554

fixup protocol sip 5060

fixup protocol sip udp 5060

fixup protocol skinny 2000

fixup protocol smtp 25

fixup protocol sqlnet 1521

fixup protocol tftp 69

names

access-list acl_out permit ip any any

access-list acl_in permit ip any any

access-list nonat permit ip 192.168.0.0 255.255.255.0 192.168.0.0 255.255.255.0

pager lines 24

mtu outside 1500

mtu inside 1500

ip address outside 10.0.0.1 255.255.255.0

ip address inside 192.168.0.2 255.255.255.0

ip audit info action alarm

ip audit attack action alarm

ip local pool testpool 192.168.0.100-192.168.0.110

ip local pool cisco 192.168.0.120-192.168.0.130

no failover

failover timeout 0:00:00

failover poll 15

no failover ip address outside

no failover ip address inside

pdm history enable

arp timeout 14400

nat (inside) 0 access-list nonat

nat (inside) 0 0.0.0.0 0.0.0.0 0 0

access-group acl_out in interface outside

access-group acl_in in interface inside

route outside 0.0.0.0 0.0.0.0 192.168.0.1 1

timeout xlate 3:00:00

timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00

timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout sip-disconnect 0:02:00 sip-invite 0:03:00

timeout uauth 0:05:00 absolute

aaa-server TACACS+ protocol tacacs+

aaa-server TACACS+ max-failed-attempts 3

aaa-server TACACS+ deadtime 10

aaa-server RADIUS protocol radius

aaa-server RADIUS max-failed-attempts 3

aaa-server RADIUS deadtime 10

aaa-server LOCAL protocol local

no snmp-server location

no snmp-server contact

snmp-server community public

no snmp-server enable traps

floodguard enable

sysopt connection permit-ipsec

crypto ipsec transform-set aaades esp-des esp-md5-hmac

crypto dynamic-map dynomap 10 set transform-set aaades

crypto map mymap 20 ipsec-isakmp dynamic dynomap

crypto map mymap client configuration address initiate

crypto map mymap client configuration address respond

crypto map mymap client authentication LOCAL

crypto map mymap interface outside

isakmp enable outside

isakmp key ******** address 0.0.0.0 netmask 0.0.0.0

isakmp client configuration address-pool local testpool outside

isakmp policy 10 authentication pre-share

isakmp policy 10 encryption des

isakmp policy 10 hash md5

isakmp policy 10 group 2

isakmp policy 10 lifetime 86400

***group usergroup address-pool testpool

***group usergroup idle-time 1800

***group usergroup password ********

telnet timeout 5

ssh timeout 5

console timeout 0

username user1 password tJsDL6po9m1UFs.h encrypted privilege 2

terminal width 80

Cryptochecksum:49fcf8e651150adf5ce5d8f749987ba2

: end

pixfirewall(config)#

简单的路由器DHCP配置实例

Router#sh run

Building configuration...

Current configuration:

!

version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Router

!

!

!

!

!

!

ip subnet-zero

!

ip dhcp pool test

network 192.168.0.0 255.255.255.0

dns-server 202.97.224.68

default-router 192.168.0.1

lease 3

!

ip dhcp pool tom

host 192.168.0.18 255.255.255.0

client-identifier 0100.c09f.9b1f.8b

!

lane client flush

cns event-service server

!

!

!

!

!

!

!

interface Ethernet2/0

ip address 192.168.0.1 255.255.255.0

!

ip classless

no ip http server

!

!

!

!

line con 0

transport input none

line aux 0

line vty 0 4

login

!

end

IPsec *** access 配置实例



总部:

crypto isakmp policy 1    //策略

encryption 3des       //加密方式

authentication pre-share  //认证

group 2            //加密组

crypto isakmp client configuration address-pool local poolxxx

//客户端IP地址池

crypto isakmp client configuration group groupxxx //组名称

key crackerxxx     //密钥,也就是客户端密码

dns 211.98.2.4      //客户端DNS

domain xxx.edu.cn    //域名

pool poolxxx       //客户端拨号地址池

netmask 255.255.255.0  //客户端掩码

crypto ipsec transformset setxxx esp-3des esp-sha-hmac //变换集

crypto dynamic-map mapxxx 1    //动态map

set transform-set setxxx //引用变换集setxxx

crypto map map isakmp authorization list groupxxx //验证方式

crypto map map client configuration address respond //客户端自动获取IP

crypto map map 1 ipsec-isakmp dynamic mapxxx //引用动态map

ip local pool poolxxx 211.89.1.1 211.89.1.254 //拨号地址池

int f0/1          //进入外网接口

crypto map map //激活crypto map

客户端:

必须采用思科的*** client软件

在group配置中填写groupxxx

密码选项填写crackerxxx

地址选项填写MAIN OFFICE的路由器外口地址即可

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息