篇一:H3C路由器限制IP上下行流量
1、时段限制
①建立一个时间段。名为work。时间定义为工作时间8:00~18:00
[MSR2021] time-range work 08:00 to 18:00 working-day
②静止上班时间所有IP访问优酷网(202.102.81.119)
[MSR20_21]acl number 3001 //高级ACL
[MSR20_21-acl-adv-3001]rule 10 deny ip source any destination 202.102.81.119 0.0.0.0 time-range work
2、限速配置
①对整个网段限速
[MSR20_21] qos carl 10 destination-ip-address subnet 192.168.1.1 24 ②对整个网段中的每个IP限速
[MSR20_21] qos carl 10 destination-ip-address subnet 192.168.1.1 24 per-address
③对某一段IP限速
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100
④对某一段内的每个IP
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100 per-address
【实例】
每个网段对应路由器(MSR2021)接口以及ADSL端口(每条ADSL均为3M)情况如下:(限制为下行80K,上行30K)
interface Ethernet0/0 ----- dial-bundle-number 1 192.168.2.0
interface Ethernet1/0 ----- dial-bundle-number 2 192.168.1.0/192.168.3.0
interface Ethernet0/2 ----- dial-bundle-number 3 192.168.5.0 配置如下:
<MSR20_21>sys
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100 per-address
qos carl 11 destination-ip-address range 192.168.1.125 to 192.168.1.200 per-address
qos carl 12 destination-ip-address range 192.168.1.206 to 192.168.1.253 per-address
qos carl 20 destination-ip-address range 192.168.2.2 to 192.168.2.253 per-address
qos carl 30 destination-ip-address range 192.168.3.2 to 192.168.3.253 per-address
//对所选网段内的每个IP地址限速
[MSR20_21]interface Ethernet 1/0
qos car inbound carl 10 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 11 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 12 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 30 cir 640 cbs 6400 ebs 0 green pass red discard //访问外网流量最大80K
[MSR20_21-Ethernet1/0]interface dialer2
qos car inbound carl 10 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 11 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 12 cir 640 cbs 6400 ebs 0 green pass red discard qos car inbound carl 30 cir 640 cbs 6400 ebs 0 green pass red discard quit
//在对应端口应用
[MSR20_21]interface Ethernet 0/0
qos car inbound carl 20 cir 640 cbs 6400 ebs 0 green pass red discard
[MSR20_21-Ethernet0/0]interface dialer1
qos car inbound carl 20 cir 640 cbs 6400 ebs 0 green pass red discard quit
//上传限制在30K
qos carl 15 source-ip-address range 192.168.1.2 to 192.168.1.100 per-address
interface Ethernet 1/0
qos car outbound carl 15 cir 240 cbs 2400 ebs 0 green pass red discard quit
定义192.168.0.2 to 192.168.0.200内每台主机上传的流量
[Quidway] qos carl 1 source-ip-address range 192.168.0.2 to 192.168.0.200 per-address 定义192.168.0.2 to 192.168.0.200内每台主机下载的流量
[Quidway] qos carl 2 destination-ip-address range 192.168.0.2 to 192.168.0.200 per-address [Quidway] interface ethernet 1/0
-------限制上行速率
[Qudiway-Ethernet1/0] qos car inbound carl 1 cir 200000 cbs 200000 ebs 200000 green pass red discard
------限制下行速率
[Qudiway-Ethernet1/0] qos car outbound carl 2 cir 300000 cbs 300000 ebs 300000 green pass red discard
篇二:路由器控制流量的方法
路由器控制流量的方法
我家是4M的电信宽带,刚装的时候送了个猫(带路由的那种)现在家里有2台电脑,就买了个无线路由装在了楼上我的电脑是直接插在送的这个猫上的,在4端口,楼上的是在1端口接了根线上去然后再接到无线路由上,再从无线路由上接到第2台电脑的!因为楼上的老看电影,楼下基本玩不了,所以想把2台电脑都控制在2M。但打开宽带控制器设置里面出现了8个接口,地址段也不知道怎么填写!麻烦大家帮帮忙
!
首先路由里面的那个不是8个接口,是可以让你设置8个不同网段的流量控制。其实你只用设置你楼上的流量为2M就好了,方法如下:
1、先弄清楚楼上路由器在你的宽带猫上面获取的IP地址,然后设置一个包括了楼上IP的地址段填进1号ID里面。例如楼上路由在你的宽带猫上面获取的IP地址是:192.168.1.100,你就设置IP地址段为:192.168.100-192.168.101,模式选为现职最大宽带,宽带大小填200KB,备注可以写个楼上注明,勾选启用就OK了,重启路由器吧。
2、设置你自己电脑的IP为固定IP,设置在限制的IP段外(例如:192.168.1.105)不然自动获取的时候可以会在你限制的IP段内。(注:如果你电脑是自动获取IP的,路由会根据现在连上的终端数量由DHCP自动分派连续的IP,你的楼上只有一个机子,首先会分配了192.168.1.100,那你的就会分配在192.168.1.101,这样你也会被限制在内了)
重点是你要懂得查看楼上路由在你的宽带猫上面获取的IP地址了,告诉你个方法:在路由里面有个DHCP服务器选项,你点查看客户端列表,里面除了你自己的外的就是楼上的IP了
篇三:案例十五 利用IP标准访问列表进行网络流量控制
案例十五 利用IP标准访问列表进行网络流
量控制
【背景描述】
你是一个公司的网络管理员,公司的经理部、财务部门和销售部门分属不同的3个网段,三部门之间用路由器进行信息传递,为了安全起见,公司领导要求销售部门不能对财务部门进行访问,但经理部可以对财务部进行访问。
PC1代表经理部的主机,PC2代表销售部门的主机,PC3代表财务部门的主机。
【实现功能】
实现网段间互相访问的安全权限。
【技术原理】
IP ACL(IP访问控制列表或IP访问列表)是实现对流经路由器或交换机的数据包根据一定的规则进行过滤,从而提高网络可管理性和安全性。IP ACL分为两种:标准IP 访问列表和扩展IP访问列表。
标准IP访问列表可以根据数据包的源IP地址定义规则,进行数据包的过滤。扩展IP访问列表可以根据数据包的源IP、目的IP、源端口、目的端口、协议来定义规则,进行数据包的过滤。
IP ACL基于接口进行规则的应用,分为:入栈应用和出栈应用。入栈应用是指由外部经该接口进行路由器的数据包进行过滤。出栈应用是指路由器从该接口向外转发数据时进行数据包的过滤。
IP ACL的配置有两种方式:按照编号的访问列表,按照命名的访问列表。标准IP访问列表编号范围是1~99、1300~1999,扩展IP访问列表编号范围是100~199、2000~2699。
【使用设备】
【案例拓扑】
【实现过程】
步骤1 基本配置
router1的配置
Red-Giant#configure terminal Red-Giant(config)#hostname Router1 Router1(config)#interface fastEthernet 0
Router1(config-if)#ip address 172.16.1.1 255.255.255.0 Router1(config-if)#no shutdown Router1(config)#interface fastEthernet 1
Router1(config-if)#ip address 172.16.2.1 255.255.255.0 Router1(config-if)#no shutdown Router1(config)#interface serial 1 Router1(config-if)#ip add
Router1(config-if)#ip address 172.16.3.1 255.255.255.0 Router1(config-if)#clock rate 64000 Router1(config-if)#no shutdown Router1(config-if)#end
测试命令
Router1#show ip int brief
Interface IP-AddressOK? Method Status Protocol
FastEthernet0 172.16.1.1YES manual up up
FastEthernet1 172.16.2.1YES manual up up
FastEthernet2 unassignedYES unset administratively down down
FastEthernet3 unassignedYES unset administratively down down
Serial0 unassignedYES unset administratively down down
Serial1 172.16.3.1YES manual up up
router2的配置
Red-Giant>enable Red-Giant#
Red-Giant#configure terminal Red-Giant(config)#hostname Router2 Router2(config)#in Router2(config)#interface fa
Router2(config)#interface fastEthernet 0
Router2(config-if)#ip add 172.16.4.1 255.255.255.0 Router2(config-if)#no shutdown Router2(config-if)#exi
Router2(config)#interface serial 1 Router2(config-if)#ip add
Router2(config-if)#ip address 172.16.3.2 255.255.255.0 Router2(config-if)#no shutdown Router2(config-if)#end
测试命令
Router2#show ip int brief
Interface IP-AddressOK? Method Status Protocol FastEthernet0 172.16.4.1 YES manual up up FastEthernet1 unassignedYES unset administratively down down FastEthernet2 unassignedYES unset administratively down down FastEthernet3 unassignedYES unset administratively down down Serial0 unassignedYES unset administratively down down Serial1 172.16.3.2 YES manual up up
配置静态路由
Router1(config)#ip route 172.16.4.0 255.255.255.0 serial 1 Router2(config)#ip route 172.16.1.0 255.255.255.0 serial 1 Router2(config)#ip route 172.16.2.0 255.255.255.0 serial 1
测试命令
Router1#show ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 4 subnets
S 172.16.4.0 is directly connected, Serial1
C 172.16.1.0 is directly connected, FastEthernet0 C 172.16.2.0 is directly connected, FastEthernet1 C 172.16.3.0 is directly connected, Serial1
Router2#show ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2
Gateway of last resort is not set
C 172.16.3.0/24 is directly connected, Serial1
C 172.16.4.0/24 is directly connected, FastEthernet0172.16.0.0/24 is subnetted, 2 subnets
S 172.16.1.0 is directly connected, Serial1 S 172.16.2.0 is directly connected, Serial1
步骤2 配置标准IP访问控制列表
Router2(config)#access-list 1 deny 172.16.2.0 0.0.0.255
!拒绝来自172.16.2.0网段的流量通过
Router2(config)#access-list 1 permit 172.16.1.0 0.0.0.255
!允许来自172.16.1.0 网段的流量通过
验证测试
Router2#show access-lists 1
Standard IP access list 1
deny172.16.2.0, wildcard bits 0.0.0.255 permit 172.16.1.0, wildcard bits 0.0.0.255
步骤3 把访问控制列表在接口下应用
Router2(config)#interface fastEthernet 0
Router2(config-if)#ip access-group 1 out !在接口下访问控制列表出栈流量调用
验证测试
Router2#show ip interface fastEthernet 0
FastEthernet0 is up, line protocol is upInternet address is 172.16.4.1/24
Broadcast address is 255.255.255.255Address determined by setup commandMTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is 1 !查看访问控制列表在接口上的应用Inbound access list is not setProxy ARP is enabledSecurity level is defaultSplit horizon is enabled
ICMP redirects are always sentICMP ueachables are always sentICMP mask replies are never sentIP fast switching is enabled
IP fast switching on the same interface is disabledIP multicast fast switching is enabledRouter Discovery is disabled
IP output packet accounting is disabledIP access violation accounting is disabledTCP/IP header compression is disabledPolicy routing is disabled
步骤4 验证测试
ping(172.16.2.0网段的主机不能ping通172.16.4.0网段的主机;172.16.1.0网段的主机能ping通172.16.4.0网段的主机)。 参考配置
Router1#show running-config!查看路由器1的全部配置