您的位置:首页 > 其它

双线NAT下 如何利用路由器实现基于端口的流控

2012-06-13 10:20 337 查看
需求:

ISP2跑http

其他的跑ISP1

interface FastEthernet0/0 --------假设该端口为ISP 2接入端口

ip address 192.168.1.2 255.255.255.0 --------分配地址

ip nat outside --------指定为NAT Outside端口

!

interface FastEthernet0/1 ---------假设该端口为ISP 1接入端口

ip address 192.168.2.2 255.255.255.0 --------分配地址

ip nat outside --------指定为NAT Outside端口

!

interface FastEthernet1/0 -------假设该端口为内部网络端口

ip address 192.168.3.1 255.255.255.0 --------分配地址

ip nat inside --------指定为NAT Inside端口

ip policy route-map t0 --------在该端口上使用route-map t0进行策略控制

!

ip nat inside source list 101 interface FastEthernet0/0 overload http应用做PAT,匹配101acl

ip nat inside source list 102 interface FastEthernet0/1 overload 其他应用做PAT,匹配102acl

ip classless

ip route 0.0.0.0 0.0.0.0 192.168.2.1 ------静态路由,对Internet的访问通过192.168.2.1(ISP1)链路

ip route 0.0.0.0 0.0.0.0 192.168.1.1 ------静态路由,对Internet的访问通过192.168.1.1(ISP2)链路

no ip http server

静太路由不起很大的作用,因为存在策略路由,主要是set interface要求有显式的去往目的地的路由

!

access-list 101 permit tcp 192.168.3.0 0.0.0.255 any eq 80

access-list 102 deny tcp 192.168.3.0 0.0.0.255 any eq 80

access-list 102 permit ip any any

!

route-map t0 permit 10 ----定义route-map t0,permit序列为10

match ip address 101 ----匹配101ACL的数据

set interface FastEthernet0/0 ----指定出口为Fastethetnet 0/0

!

route-map t0 permit 20 ----定义route-map t0,permit序列为20

match ip address 102 ----匹配102ACL的数据

set interface FastEthernet0/1 ----指定出口为Fastethetnet 0/1

文章转载自网管之家:http://www.bitscn.com/network/cisco/201004/183947.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: