配置IP 过滤表
IP过滤表能够帮助控制网上包的传输.主要用在以下几个方面:
控制一个端口的包传输
控制虚拟终端访问数量
限制路由更新的内容
软件支持下面几种形式的IP过滤表:
标准IP过滤表用源地址过滤
扩展IP过滤表用源地址和目的地址过滤,并且可以过滤高层协议如Telnet,FTP等等
.
在Global配置模式下,定义标准的IP过滤表:
定义标准的IP过滤表
access-list access-list-number {deny | permit } source [source-wildcar
d]
用any来定义标准的IP过滤表
access-list access-list-number {deny | permit } any
标准的IP过滤表的表号 1-99.
在Global配置模式下,定义扩展的IP过滤表:
功 能 命 令
定义扩展的IP过滤表
access-list access-list-number {deny | permit } {protocol | protocol-k
eyword } {source source-wildcard | any } {destination destination-wild
card | any } [precedence precedence ] [tos tos]
扩展的IP过滤表的表号 100-199.
协议关键字有icmp,igmp,tcp,udp.
在端口配置模式下,把某个IP过滤表加到端口上:
把某个IP过滤表加到端口上
ip access-list access-list-number {in | out }
有关IP过滤表配置,请看"IP Access List Configuration Example" 的举例说明
.
----------------------------------------------------------------------
----------
配置IP通过广域网
你可以配置IP通过X.25,SMDS,Frame Relay和DDR网络.详细内容请参阅广域网配置
向导.
----------------------------------------------------------------------
----------
监控和维护IP 网络
监控和维护你的网络,请完成以下工作:
清除缓存,表单和数据库
在 EXEC模式下:
清除IP ARP缓存和快速交换缓存 clear arp-cache
在主机和地址缓存中去掉一个或所有实体 clear host {name | * }
清除一个活动端口累计通过的包数 clear ip accouting [checkpoint]
在路由表中去掉一个或多个路由信息 clear ip route {network [mask] | * }
显示系统和网络的状态
在 EXEC模式下:
显示ARP表 show arp
显示名字缓存 show hosts
显示当前IP过滤表的内容 show ip access-list [access-list-number | name
]
显示当前活动端口累计通过的包数 show ip accouting [checkpoint]
显示IP ARP表 show ip arp
显示某一个端口状态 show ip interface [type number ]
显示目前的路由表 show ip route [address [mask]|protocol ]
测试网络是否通 ping [protocol]{host |address}
IP 配置实例
Creat a Network from Separates Subnets Example
Serial Interface Configuration Example
IP Access List Configuration Example
标准IP过滤表配置实例
限定虚拟终端访问实例
扩展IP过滤表配置实例
Ping Command Example
Creat a Network from Separates Subnets Example
在下面例子中,subnet 1和subnet 2被主干网分开.
Configuration for Router B
interface ethernet 2
ip address 192.5.10.1 255.255.255.0
ip address 131.108.3.1 255.255.255.0 secondary
Configuration for Router C
interface ethernet 1
ip address 192.5.10.2 255.255.255.0
ip address 131.108.3.2 255.255.255.0 secondary
Serial Interface Configuration Example
在下面的例子中,把Ethernet 0的地址赋予Serial 1. Serial 1是unnumbered.
interface ethernet 0
ip address 145.22.4.67 255.255.255.0
interface serial 1
ip unnumbered ethernet 0
IP Access List Configuration Example
标准IP过滤表配置实例:
该例表明在36.48.0.0这个网段上只允许B机(36.48.0.3)与A机通信,其它的36.0.
0.0的网段如36.51.0.0可以与A机通信,而其它的如Internet用户均被过滤掉了.
Configuration for Router A
access-list 2 permit 36.48.0.3
access-list 2 deny 36.48.0.0 0.0.255.255
access-list 2 permit 36.0.0.0 0.255.255.255
!(Note:all other access denied)
interface ethernet 0
ip access-group 2 in
限定虚拟终端访问实例:
该例只允许在192.89.55.0这个网段上的主机访问路由器.
Configuration for Router
access-list12 permit 192.89.55.0 0.0.0.255
!
line vty 0 4
access-class 12 in
扩展IP过滤表配置实例:
该例允许内部网的所有主机都能登录上Internet,并且A机作smtp-server,B机作W
eb Server,C机作域名服务器,FTP服务器和邮件服务器.
Configuration for Router
!Allow existing TCP connection
access-list 105 permit tcp any any established
!Allow ICMP messages
access-list 105 permit icmp any any
!Allow SMTP to one host
access-list 105 permit tcp any host 201.236.15.14 eq smtp
!Allow WWW to server (other services may be required)
access-list 105 permit tcp any host 201.222.11.5 eq www
!Allow DNS,FTP command and data,and smtpto another host
access-list 105 permit any host 201.222.11.7 eq domain
access-list 105 permit any host 201.222.11.7 eq 42
access-list 105 permit any host 201.222.11.7 eq ftp
access-list 105 permit any host 201.222.11.7 eq ftp-data
access-list 105 permit any host 201.222.11.7 eq smtp
!
interface serial 0
ip access-group 105 in
Ping Command Example
在例子中,目的地址是131.108.1.111.源地址是131.108.105.62.
Sandbox# ping
Protocol [ip]:
Target IP address: 131.108.1.111
Repeat count [5]:10
Datagram size [100]:64
Timeout in seconds [2]:
Extended commands [n]:
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 131.10
8.1.111, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent, round-trip min/avg/max = 4/4/4 ms
(图形无法贴出)
--
※ 修改:.suncisco 于 Apr 16 17:40:37 修改本文.[FROM: 202.96.238.25]
※ 来源:.网易虚拟社区
http://club.netease.com.[FROM: 202.96.238.25]
--------------------------------------------------------------------------------
cisco中文配置文档连载(5)
网络协议配置向导
================
配置IP路由协议
这一章我们主要介绍怎样配置各种各样的IP(Internet IP)路由协议.IP路由协议
分成两大类:
内部网关协议IGPs (Interior Gateway Protocols)和外部网关协议EGPs(Exteri
or Gateway Protocols).
选择路由协议的原则
配置IGRP
Cisco's IGRP 的实现
IGRP的路由交换
IGRP的配置
配置Enhanced IGRP
Cisco's Enhanced IGRP的实现
EIGRP的配置
IGRP到EIGRP的迁移
配置RIP
RIP的配置
RIP与IGRP,EIGRP的迁移
配置静态路由
IP路由协议的配置实例
Cisco IOS支持的协议有:
内部网关协议(它是在一个自治系统内部交换路由信息的路由协议)----- IGRP,
EIGRP, OSPF, RIP 和 IS-IS等等.
外部网关协议(它是为连接两个或多个自治系统的路由协议)----- BGP 和 EGP等
等.
----------------------------------------------------------------------
----------
选择路由协议的原则
选择一个路由协议是一个非常复杂的工作.当选择路由协议,参考以下几点:
网络的大小和复杂性
支持可变长掩码(VLSM).Enhanced IGRP,IS-IS,OSPF和静态路由支持可变长掩码
网络流量大小
安全需要
网络延迟特性
下面就分别介绍各种路由协议的特点和配置.
----------------------------------------------------------------------
----------
配置IGRP
内部网关路由协议(Interior Gateway Routing Protocol---- IGRP)是一个动态
的,长跨度的路由协议,它是Cisco公司八十年代中期设计实现的,在一个自治系统
内具有高跨度,适合复杂网络的特点.
Cisco's IGRP的实现
IGRP的网络延迟,带宽,可靠性和负载都是可由用户配置决定的.
IGRP广播三种类型的路由:内部的,系统的和外部的.如图所示.内部的路由是在一
台路由器的端口上连接子网的路由.如果一台路由器连接的网络是非子网的,IGRP
就不广播内部路由.
图 1 :内部,系统和外部路由
系统路由是一个自治系统内的路由.Cisco IOS 软件从直连的网络接口上获得系统
路由,并把它提供给其它的支持IGRP协议的路由器或访问服务器.系统路由不包括
子网信息.
外部路由是自治系统之间的路由.
IGRP的路由交换
默认的,一个运行IGRP路由协议的路由器每90秒广播一次路由信息.如果在270秒内
未收到某路由器的回应,它则认为目前该路由器不可到达;若在630秒后仍未有应答
,则把有关它的路由信息从路由表中删掉.
IGRP的配置
指定路由器IGRP协议:
功能 命令
激活IGRP路由,进入路由配置模式 router igrp process number
加入网络直连的网段 nework network-number
请参阅"Configure IGRP Example",更加详细的资料请看 Cisco CD 或 Cisco的主
页.
----------------------------------------------------------------------
----------
配置Enhanced IGRP
Enhanced IGRP是Cisco公司开发的IGRP的增强的版本.它使用与IGRP相同的路由算
法,但它在许多方面对IGRP作了较大的改进.
Cisco's Enhanced IGRP的实现
Cisco's Enhanced IGRP提供了以下特性:
自动重新分配-----IP IGRP路由可以自动的重新分配到EIGRP中,IP EIGRP也可以
自动的重新分配到IGRP中.如果愿意,也可以关掉重新分配.
可扩展的网络-----对于IP RIP,你的网络最大只有15个hops,而当使用EIGRP时,最
大可以有224个hops.
触发的路由表-----EIGRP并不象IGRP那样经过一定的时间间隔后交换路由信息的
,而是只有当路由表有变化时才把路由表广播出去的,叫做触发式的(triggered).
支持可变长掩码(VLSM)
配置Enhanced IGRP
指定EIGRP路由协议:
功能 命令
激活EIGRP路由,进入路由配置模式 router eigrp process number
加入网络直连的网段 nework network-number
更加详细的资料请看 Cisco CD 或 Cisco的主页.
IGRP到EIGRP的迁移
在同一个自治系统的IGRP和EIGRP是自动能够重新分配的,而在不同两个自治系统
之间,作如下配置:
功能 命令
在路由配置模式下,指定路由重新分配 redistribute protocol [option]
在所有的非IGRP环境下使用相同的metric值 default-metric bandwidth delay
reliability loading mtu
请参阅"IGRP and EIGRP Redistribution Example",更加详细的资料请看 Cisco
CD 或 Cisco的主页.
----------------------------------------------------------------------
----------
配置RIP
路由信息协议(Routing Information Protocol ---RIP)是一个相对比较老的,但
仍被广泛使用的路由协议.
RIP广播一个UDP数据包更换路由信息,每个路由器间隔30秒更换一次路由信息,在
180秒内未收到某路由器的回应,它则认为目前该路由器不可到达;若在270秒后仍
未有应答,则把有关它的路由信息从路由表中删掉.
RIP的配置
指定IP RIP路由协议:
功能 命令
激活RIP路由,进入路由配置模式 router rip
加入网络直连的网段 nework network-number
RIP到IGRP,EIGRP的迁移
功能 命令
在路由配置模式下,指定路由重新分配 redistribute protocol [option]
在所有的非IGRP环境下使用相同的metric值 default-metric number
请参阅"RIP and EIGRP Redistribution Example",更加详细的资料请看 Cisco
CD 或 Cisco的主页.
----------------------------------------------------------------------
----------
配置静态路由
在某些环境下,我们需要尽量小的路由交换和其它一些特殊环境下会用到静态路由
.
功能 命令
在Global配置模式下,指定网关静态路由 ip route network [mask] address [d
istance]
在Global配置模式下,用串口指定静态路由 ip route network [mask] interfac
e [distance]
请参阅"Static Routing Redistribution Configure Example".
----------------------------------------------------------------------
----------
IP路由协议实例配置
Configure IGRP Example
IGRP and EIGRP Redistribution Example
RIP and EIGRP Redistribution Example
Static Routing Redistribution Configure Example
Route Filtering Example
Redistribution Filtering
Configure IGRP Example
假设RouterA连接到130.108.0.0和10.0.0.0这两个直连网段上.
RouterA#config terminal (在"#"提示符下)
RouterA(config)#router igrp 15 (进入配置模式)
RouterA(config-router)#network 130.108.0.0 (进入路由配置子模式)
RouterA(config-router)#network 10.0.0.0
IGRP and EIGRP Redistribution Example
在AS 200和AS 100两个自治系统内,分别跑EIGRP和IGRP协议,要想互相通信:
Configuration for RouterA
router eigrp 200
network 201.222.5.0
redistribute igrp 100
default-mertic 56 2000 255 1 1500
router igrp 100
network 131.108.0.0
redistribute eigrp 200
default-metric 56 2000 255 1 1500
RIP and EIGRP Redistribution Example
Configuration for RouterA
router rip
network 201.222.5.0
redistribute eigrp 100
default-mertic 3
router eigrp 100
network 131.108.0.0
redistribute rip
default-metric 56 2000 255 1 1500
Static Routing Redistribution Configure Example
Configuration for RouterA
ip route 131.108.1.0 255.255.255.0 131.108.2.1
!
router eigrp 1
network 192.31.7.0
default-metric 10000 100 255 1 1500
redistribute static
distribute-list 3 out static
!
access-list 3 permit 131.108.0.0 0.0.255.255
Route Filtering Example
在路由器B上,过滤掉由10.0.0.0发送过来的路由信息,那么在201.222.5.0这个网
段上是不能与10.0.0.0这个网通信的.换句话说,在201.222.5.0一端隐藏了10.0.
0.0这个网.
Configuration for Router
router eigrp 1
network 131.108.0.0
network 201.222.5.0
distribute-list 7 out s0
!
access-list 7 permit 131.108.0.0 0.0.255.255
access-list 7 deny 10.0.0.0 0.255.255.255
Redistribution Filtering
效果同上,但是在两个不同的路由协议下的.
Configuration for Router
router rip
network 201.222.5.0
redistribute eigrp 100
default-mertic 3
!
router eigrp 100
network 131.108.0.0
redistribute rip
default-metric 56 2000 255 1 1500
distribute-list 7 out rip
!
access-list 7 deny 10.0.0.0 0.255.255.255
access-lsit 7 permit 0.0.0.0 255.255.255.255
----------------------------------------------------------------------
----------
选择路由协议的原则
选择一个路由协议是一个非常复杂的工作.当选择路由协议,参考以下几点:
网络的大小和复杂性
支持可变长掩码(VLSM).Enhanced IGRP,IS-IS,OSPF和静态路由支持可变长掩码
网络流量大小
安全需要
网络延迟特性
下面就分别介绍各种路由协议的特点和配置.
----------------------------------------------------------------------
----------
配置IGRP
内部网关路由协议(Interior Gateway Routing Protocol---- IGRP)是一个动态
的,长跨度的路由协议,它是Cisco公司八十年代中期设计实现的,在一个自治系统
内具有高跨度,适合复杂网络的特点.
Cisco's IGRP的实现
IGRP的网络延迟,带宽,可靠性和负载都是可由用户配置决定的.
IGRP广播三种类型的路由:内部的,系统的和外部的.如图所示.内部的路由是在一
台路由器的端口上连接子网的路由.如果一台路由器连接的网络是非子网的,IGRP
就不广播内部路由.
图 1 :内部,系统和外部路由
系统路由是一个自治系统内的路由.Cisco IOS 软件从直连的网络接口上获得系统
路由,并把它提供给其它的支持IGRP协议的路由器或访问服务器.系统路由不包括
子网信息.
外部路由是自治系统之间的路由.
IGRP的路由交换
默认的,一个运行IGRP路由协议的路由器每90秒广播一次路由信息.如果在270秒内
未收到某路由器的回应,它则认为目前该路由器不可到达;若在630秒后仍未有应答
,则把有关它的路由信息从路由表中删掉.
IGRP的配置
指定路由器IGRP协议:
功能 命令
激活IGRP路由,进入路由配置模式 router igrp process number
加入网络直连的网段 nework network-number
请参阅"Configure IGRP Example",更加详细的资料请看 Cisco CD 或 Cisco的主
页.