1
cisco 路由器共享企业网连接ADSL 配置实例(2009-02-11 02:01:42)
我们家庭普遍接入了adsl,费用采用包月制,随时都可以上网,如果有两台电脑以上或邻居的电脑要一起共享上网,那么就要采用
路由器的方式,通常自己家庭和小型的公司企业都是采用soho 宽带路由器,基本
在宽带路由器里设置了从ISP 申请得到的用户名和密码,就可以带其他机器一起上网了,设置非常简单,厂家附带的说明书都会有
说明。如果是大型的企业就不能够用这种宽带路由器了,无论从硬件性能和软件功能都不能满足要求,这时就要采用企业级的路由器了,
下面就以cisco 的路由器配置以接入adsl 网络。
网络示意图如下:


上图是企业的边界路由器采用以太网接口连接ADSL-modem,重点是配置连接ADSL modem 的接口和连接内部网的接口。
为了支持pppoe,IOS 其版本必须具有ADSL+PLUS 特性集。
以下配置适用cisco 路由器:
第一步:先配置vpdn(由于ADSL 是通过虚拟拨号来实现所以要在路由器启用vpdn 功能)
在全局模式下启用:
Router(config)#vpdn enable
Router(config)#vpdn-group adsl-pppoe (为pppoe 启动vpdn 进程,新建一个名字是adsl-pppoe)
Router(config-vpdn)#request-dialin (pppoe 客户端向pppoe 终结设备请求一个连接)
Router(config-vpdn-req-in)#protocol pppoe (设置拨号协议为pppoe)
第二步: 配置路由器连接adsl modem 的接口
Router(config)#interface fa0/0
Router(config-if)#no shut
Router(config-if)#pppoe enable (激活pppoe)
Router(config-if)#pppoe-client dial-pool-number 1 (pppoe 拨号使用常用的拨号1 号池)
第三步:建立逻辑拨号连接
Router(config)#interface dialer 1
Router(config-if)#ip address negotiated (从ISP 里自动获取IP 地址)
Router(config-if)#ip mtu 1492 (修改mtu 值以适用于adsl 网络)
Router(config-if)#ip nat outside (启用NAT 转换,并设置该端口为外部端口)
2
Router(config-if)#encap ppp (封装ppp 协议)
Router(config-if)#dialer pool 1 (设置该接口使用1 号池拨号)
Router(config-if)#dialer-group 1 (绑定感兴趣的IP 流量)
Router(config-if)#ppp authentication pap callin (启用ppp 的pap 验证方式)
Router(config-if)#ppp pap sent cisco password cisco (这里设置自己已经在ISP 申请得到的用户名和密码)
第四步:设置访问列表允许的IP 和NAT 转换
Router(config)#access-list 1 permit any (设置内部网的所有机器都能访部外部网络)
Router(config)#ip nat inside source list 1 interface dialer1 overload (使用了dialer1 端口的动态地址转换)
第五步:设置感兴趣的IP 流量通过
Router(config)#dialer-list 1 protocol ip permit
第六步:设置默认路由到ISP
Router(config)#ip route 0.0.0.0 0.0.0.0 dialer 1
第七步:设置企业的内部网络,可以根据企业内部有多少个内部网络连接到路由器的LAN 口来确定,
Router(config)#interface fa1/1
Router(config)#ip nat inside (设置内部NAT)
Router(config)#ip address x.x.x.x x.x.x.x 也可以由dhcp 服务器分配
最后将以上的配置用命令copy runn start 保存到路由器的NVRAM 中。
经过以上的配置,内部所有机器就可以通过cisco 的路由器拨号到adsl 来上互联网。而用通过这样方式来上网,速度和稳定性更有
保证,因为它采用专用的路由器设备来负责数据分组的转发,这也是企业用户经常采用的一种方式。
完整的配置如下:
adsl_router#show run
Building configuration...
Current configuration : 1113 bytes
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname adsl_router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$HRgM$G.7pkLSPlXSQsYGE5yDjK0
!
no aaa new-model
3
resource policy
ip subnet-zero
ip cef
no ip domain lookup
vpdn enable
interface FastEthernet0/0
no ip address
duplex half
pppoe enable
pppoe-client dial-pool-number 1
!
interface Dialer1
ip address negotiated
ip mtu 1492
ip nat outside
ip virtual-reassembly
encapsulation ppp
dialer pool 1
dialer-group 1
ppp authentication pap callin
ppp pap sent-username cisco password 7 0822455D0A16
!
ip classless
ip route 0.0.0.0 0.0.0.0 Dialer1
!
no ip http server
no ip http secure-server
!
ip nat inside source list 1 interface Dialer1 overload
!
access-list 1 permit any
dialer-list 1 protocol ip permit
control-plane
gatekeeper
shutdown
!
!
line con 0
4
exec-timeout 0 0
password 7 070C285F4D06415D
logging synchronous
login
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
5
CISCO路由器连接ADSL之PPPoE配置
发送到手机 | 收藏
全屏阅读模式 字体: 小 | 大
说明:
很多公司使用ADSL宽带线路作为备份线路,同时作为内部上网的分流线路。这有两种配
置:一种是cisco路由器连接ethernet接口连接ADSL的modem;一种是在cisco路由器上安装ADSL
WIC卡,直接连接ADSL电话线。
Cisco路由器连接ADSL modem的PPPoE配
置:........................................................ 1
Cisco路由器连接ADSL WIC卡之PPPoE配
置:........................................................ 3
hostname bjsite
!
ip subnet-zero
no ip domain-lookup
!
vpdn enable
no vpdn logging
!
vpdn-group 1
request-dialin
protocol pppoe
!
interface Ethernet0/0
ip address 192.168.0.1 255.255.255.0
ip nat inside
no ip mroute-cache
!
!
!
!
interface Ethernet0/1
no ip address
pppoe enable
pppoe-client dial-pool-number 1
!
interface Dialer1
6
ip address negotiated
ip nat outside
ip mtu 1492
encapsulation ppp
no ip mroute-cache
dialer pool 1
dialer-group 1
ppp authentication pap
ppp pap sent-username dg48907653@163.gd password xxxxxxxx
!
ip classless
no ip http server
!
dialer-list 1 protocol ip permit
ip nat inside source list 1 interface Dialer1 overload
ip route 0.0.0.0 0.0.0.0 dialer1
access-list 1 permit 192.168.0.0 0.0.0.255
!
line con 0
exec-timeout 0 0
transport input none
line vty 0 4
login
!
end
Cisco路由器连接ADSL WIC卡之PPPoE配置:
vpdn-group pppoe
request-dialin
!--- we are the PPPoE client requesting to establish
!--- a session with the aggregation unit (6400 NRP).
protocol pppoe
!
!--- internal Ethernet network.
!
interface FastEthernet0
ip address 10.92.1.182 255.255.255.0
ip nat inside
7
!--- DSL interface.
!
interface ATM0
no ip address
no atm ilmi-keepalive
bundle-enable
dsl operating-mode auto
hold-queue 224 in
!--- All defaults.
!--- PPPoE runs on top of AAL5SNAP, but the
!--- encap aal5snap command is not used.
!
interface ATM0.1 point-to-point
pvc 1/1
pppoe-client dial-pool-number 1
!--- pvc 1/1 is an example value that must be changed
!--- to match the value used by the ISP.
!
!--- The PPPoE client code ties into a dialer interface upon
!--- which a virtual-access interface is cloned.
!
interface Dialer1
ip address negotiated
ip mtu 1492
!--- Ethernet MTU default = 1500 (1492 + PPPoE headers = 1500)
ip nat outside
encapsulation ppp
8
dialer pool 1
!--- Ties to atm interface.
ppp authentication chap callin
ppp chap hostname <username>
ppp chap password <password>
!
!--- The ISP will instruct you regarding
!--- the type of authentication to use.
!--- To change from PPP CHAP to PPP PAP,
!--- replace the following three lines:
!--- ppp authentication chap callin
!--- ppp chap hostname <username>
!--- ppp chap password <password>
!--- with the following two lines:
!--- ppp authentication pap callin
!--- ppp pap sent-username <username> password <password>
!--- For NAT we are going to overload on the Dialer1
!--- interface and add a default route out
!--- since dialer ip address can change.
ip nat inside source list 1 interface Dialer1 overload
ip classless
ip route 0.0.0.0 0.0.0.0 dialer1
no ip http server
!
access-list 1 permit 10.92.1.0 0.0.0.255