Chinaunix首页 | 论坛 | 博客
  • 博客访问: 680289
  • 博文数量: 740
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 4910
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-17 15:16
文章分类

全部博文(740)

文章存档

2011年(1)

2008年(739)

我的朋友

分类:

2008-10-17 15:24:14

  Posted by 虎子 2006-3-20 12:33:00双出口+NAT的实现

  环境描述:使用设备为2621XM + NE-1E模块,该配置拥有两个FastEthernet以及一个Ethernet端口。

  现使用Ethernet 1/0 端口连接内部局域网,模拟内部拥有100.100.23.0 255.255.0.0 与100.100.24.0 255.255.0.0 两组客户机情况下基于原地址的策略。

  Fastethernet 0/0 模拟第一个ISP接入端口,Fastethernet 0/1模拟第二个ISP接入端口,地址分别为 Fastethernet 0/0 的ip地址192.168.1.2 255.255.255.0 对端ISP地址192.168.1.1 255.255.255.0

  Fastethernet 0/1 的ip地址192.168.2.2 255.255.255.0 对端ISP地址192.168.2.1 255.255.255.0

  通过策略路由后对不同原地址数据流量进行分流,使得不同原地址主机通过不同ISP接口访问Internet,并为不同原地址主机同不同NAT地址进行转换。

  具体配置:

version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!!
ip subnet-zero
!!
call rsvp-sync

!
interface FastEthernet0/0 --------------------假设该端口为ISP 1接入端口
ip address 192.168.1.2 255.255.255.0 --------分配地址
ip nat outside --------指定为NAT Outside端口
duplex auto
speed auto
!
interface FastEthernet0/1 --------------------假设该端口为ISP 2接入端口
ip address 192.168.2.2 255.255.255.0 --------分配地址
ip nat outside --------指定为NAT Outside端口
duplex auto
speed auto
!
interface Ethernet1/0 --------------------假设该端口为内部网络端口
ip address 100.100.255.254 255.255.0.0 --------分配地址
ip nat inside --------指定为NAT Inside端口
ip policy route-map t0 --------在该端口上使用route-map t0进行策略控制
half-duplex
!
ip nat inside source list 1 interface FastEthernet0/0 overload ------Nat转换,指定原地址为100.100.23.0的主机使用Fastethernet 0/0的地址进行转换
ip nat inside source list 2 interface FastEthernet0/1 overload ------Nat转换,指定原地址为100.100.24.0的主机使用Fastethernet 0/1的地址进行转换
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.2.1 ------静态路由,对Internet的访问通过192.168.2.1(ISP2)链路
ip route 0.0.0.0 0.0.0.0 192.168.1.1 ------静态路由,对Internet的访问通过192.168.1.1(ISP1)链路
ip http server
静太路由不起很大的作用,因为存在策略路由,主要是set int 要求有显示的去往目的的路由
!
access-list 1 permit 100.100.23.0 0.0.0.255 ----访问控制列表1,用于过滤原地址,允许100.100.23.0网段主机流量通过
access-list 2 permit 100.100.24.0 0.0.0.255 ----访问控制列表2,用于过滤原地址,允许100.100.23.0网段主机流量通过
如果做set int 备份,则acl1,acl2应该允许所有的,进行nat
route-map t0 permit 10 ----定义route-map t0,permit序列为10
match ip address 1 ----检查原地址,允许100.100.23.0 网段地址
set interface FastEthernet0/0 ----指定出口为Fastethetnet 0/0
(set interface FastEthernet0/1) 我认为可以做备份
!
route-map t0 permit 20 ----定义route-map t0,permit序列为20
match ip address 2 ----检查原地址,允许100.100.24.0 网段地址
set interface FastEthernet0/1 ----指定出口为Fastethetnet 0/1
!
(set interface FastEthernet0/1) 我认为可做备份 !
dial-peer cor custom

!
line con 0
line aux 0
line vty 0 4
!
end

[1]  

【责编:Kittoy】

--------------------next---------------------

阅读(368) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~