免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2252 | 回复: 0
打印 上一主题 下一主题

(Cisco 1841)通过策略路由实现ADSL双出口接入互联网 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-07 10:48 |只看该作者 |倒序浏览
环境:
内部网络:192.168.1.0/24
出口:铁通2M(ADSL)×2
要求:
192.168.1.0/25为临时地址段
192.168.1.128/26为固定地址段1
192.168.1.192/26为固定地址段2
固定地址段1使用出口1(Dialer 1)接入互联网
固定地址段2使用出口2(Dialer 2)接入互联网
临时地址段使用出口2(Dialer 2)接入互联网
备注:
由于路由器不需要和外部通信,因此没有加缺省路由,经过NAT的数据包通过策略路由选路,故不受影响。
Current configuration : 4227 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
logging buffered 51200 warnings
!
no aaa new-model
!
resource policy
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip subnet-zero
ip cef
!
!
no ip dhcp use vrf connected
!
!
no ip domain lookup
ip domain name yourdomain.com
vpdn enable
vpdn ip udp ignore checksum
!
vpdn-group pppoe
request-dialin
  protocol pppoe

!
!
username cisco privilege 15 secret 5 $1$FP5m$UcDfr996RzQ/xmupbW/qJ.
!
!
!
interface FastEthernet0/0 /*出口1的物理接口
description For 60360001
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1

!
interface FastEthernet0/1 /*出口2的物理接口
description For 60360002
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 2

!
interface FastEthernet0/0/0
duplex full
speed 100
!
interface FastEthernet0/0/1
!
interface FastEthernet0/0/2
!
interface FastEthernet0/0/3
!
interface Vlan1 /*内部网络的三层接口
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip policy route-map default /*对此接口的数据包应用名为"default"的策略(路由映射)

!
interface Dialer1 /*出口1的虚拟接口
ip address negotiated
ip mtu 1492
ip nat outside
encapsulation ppp
dialer pool 1
dialer-group 1
no cdp enable
ppp authentication chap callin
ppp chap hostname 60360001
ppp chap password 0 60360001

!
interface Dialer2 /*出口2的虚拟接口
ip address negotiated
ip mtu 1492
ip nat outside
encapsulation ppp
dialer pool 2
dialer-group 1
no cdp enable
ppp authentication chap callin
ppp chap hostname 60360002
ppp chap password 0 60360002

!
ip classless
!
no ip http server
ip http access-class 23
ip http authentication local
ip http timeout-policy idle 60 life 86400 requests 10000
ip nat inside source list 3 interface Dialer1 overload
ip nat inside source list 4 interface Dialer2 overload
ip nat inside source list temp interface Dialer2 overload

!
ip access-list standard temp
permit 192.168.1.0 0.0.0.127

!
access-list 3 permit 192.168.1.128 0.0.0.63
access-list 4 permit 192.168.1.192 0.0.0.63
dialer-list 1 protocol ip permit

!
route-map default permit 10 /*策略路由
match ip address 3 /*匹配符合访问列表3的数据包
set interface Dialer1 /*设置被上述条件匹配的数据包出口为Dialer1

!
route-map default permit 20 /*策略路由
match ip address 4 /*匹配符合访问列表4的数据包
set interface Dialer2 /*设置被上述条件匹配的数据包出口为Dialer2

!
route-map default permit 30 /*策略路由
match ip address temp /*匹配符合访问列表temp的数据包
set interface Dialer2 /*设置被上述条件匹配的数据包出口为Dialer2

!
!
control-plane
!
banner exec ^C
% Password expiration warning.
-----------------------------------------------------------------------
Cisco Router and Security Device Manager (SDM) is installed on this device and
it provides the default username "cisco" for  one-time use. If you have already
used the username "cisco" to login to the router and your IOS image supports the
able to login to the router with this username after you exit this session.
It is strongly suggested that you create a new username with a privilege level
of 15 using the following command.
username  privilege 15 secret 0
Replace  and  with the username and password you want to
use.
-----------------------------------------------------------------------
^C
banner login ^C
-----------------------------------------------------------------------
Cisco Router and Security Device Manager (SDM) is installed on this device.
This feature requires the one-time use of the username "cisco"
with the password "cisco". The default username and password have a privilege le
vel of 15.
Please change these publicly known initial credentials using SDM or the IOS CLI.
Here are the Cisco IOS commands.
username   privilege 15 secret 0
no username cisco
Replace  and  with the username and password you want to use
.
For more information about SDM please follow the instructions in the QUICK START
GUIDE for your router or go to
http://www.cisco.com/go/sdm
-----------------------------------------------------------------------
^C
!
line con 0
login local
line aux 0
line vty 0 4
access-class 23 in
privilege level 15
password cisco
login local
transport input telnet
line vty 5 15
access-class 23 in
privilege level 15
login local
transport input telnet
!
end
Router#


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/74872/showart_1274404.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP