您的位置:首页 > 其它

Cisco 路由器上ADSL拨号设置

2010-10-14 10:32 316 查看
在CSDN上还是第一篇博客,就写一篇简单的ciscoDSL拨号设置文章吧! 方便于新手对cisco路由器的设置!

 

配置过程
重要: 在开始前,请结束PC上可能监控COM端口的所有程序。 设备例如PDA和数字照相机在系统托盘经常安置程序,使
COM端口不可用于配置Cisco DSL路由器。
连接Cisco DSL路由器和PC
控制台连接用反转电缆建立Cisco DSL路由器的控制台端口到PC的COM端口的连接。 包括在Cisco DSL路由器上的控制台电缆是一个平
的浅蓝色电缆。 关于反转电缆的管脚引线或者一RJ-45到DB9转换器的管脚引线的更多信息,请参见控制台和Aux端口的线缆指南。
连接Cisco控制台电缆一端的RJ-45接头到Cisco DSL路由器的控制台端口。
1.
连接控制台电缆另一端的RJ-45接头到RJ-45-DB9转换器。
2.
连接DB9接头到PC的打开的COM端口。
3.
开始并且设置超级终端请完成以下步骤:

 

启动PC上的超级终端程序。
1.
设置超级终端会话。
2.
为会话分配一个名称并且点击OK。
a.
在Connect To窗口,请点击Cancel。
b.
选择File > Properties。
c.
从属性窗口,请入Connect Using列表并且选择连接控制台电缆的DB9末端的COM端口。
d.
从属性窗口单击配置并且填写这些值:
e.
比特 / 秒 9600
Data bits: 8
奇偶校验: 无
Stop bits: 1
Flow Control: 无
单击 Ok。         f.
从Call菜单,单击Disconnect。
g.
从Call菜单,单击Call。
h.
请按Enter直到在超级终端窗口看到一个路由器提示。
i.

清除在Cisco DSL路由器的现有配置
请完成以下步骤:
在路由器提示窗口输入enable进入特权模式。
1.
Router>enable
Router#
!--- The # symbol indicates that you are in privileged mode.
清除路由器上的现有配置。
2.
Router#write erase
重新载入路由器,它会以一个空白启动配置启动。
3.
Router#reload
System configuration has been modified. Save? [yes/no]:no
Proceed with reload? [confirm]yes
!--- The router reload can take a few minutes.
在路由器重新载入了后,再进入特权模式。
4.
Router>enable
Router#

配置Cisco DSL路由器
完成以下步骤。
配置service timestamp以适当地记录和显示在故障排除部分的debug 输出。
1.
Router#configure terminal
Router(config)#service timestamps debug datetime msec
Router(config)#service timestamps log datetime msec
Router(config)#end

当配置路由器时,禁用在Cisco DSL路由器的logging console为了抑制也许被触发的控制台信息。
2.
Router#configure terminal
Router(config)#no logging console
Router(config)#end

配置ip routing、ip subnet-zero和ip classless以在路由配置选项中提供灵活性。
3.
Router#configure terminal
Router(config)#ip routing
Router(config)#ip subnet-zero
Router(config)#ip classless
Router(config)#end

配置全局Point-to-Point Protocol over Ethernet (PPPoE)参数。
4.
Router#configure terminal
Router(config)#vpdn enable
Router(config)#no vpdn logging
Router(config)#vpdn-group pppoe
Router(config-vpdn)#request-dialin
Router(config-vpdn-req-in)#protocol pppoe
Router(config-vpdn-req-in)#end

在Cisco DSL路由器以太网接口上配置的一个IP地址和子网掩码。
5.
对于网络地址转换(NAT) : (可选)请在以太网接口启用NAT Inside。
Router#configure terminal
Router(config)#interface ethernet 0
Router(config-if)#ip tcp adjust-mss 1452
!--- If the ip tcp adjust-mss 1452 command is not supported, try
!--- ip adjust-mss 1452. If this command is not supported,
!--- upgrade to the latest Cisco DSL Router software or follow the
!--- procedure in the Possible Required Configuration Steps on the PC.

Router(config-if)#ip address <ip address> <subnet mask>
!--- For NAT:
Router(config-if)#ip nat inside
Router(config-if)#no shut
Router(config-if)#end

配置有ATM永久虚拟电路(PVC)、封装类型和拨号池的Cisco DSL路由器ATM接口。
6.
Router#configure terminal                            或                        Router#configure terminal
Router(config)#interface  ATM 0                                              Router(config)#interface  ethernet 1

Router(config-if)#pvc <vpi/vci>                                                Router(config-if)#pppoe-client dial-pool-number 1
Router(config-if-atm-vc)#pppoe-client dial-pool-number 1       Router(config-if)#no shut
Router(config-if-atm-vc)#no shut
Router(config-if-atm-vc)#end

配置点对点协议的Cisco DSL路由器拨号接口在ATM (PPPoA)为了使动态IP地址已分配。
7.
对NAT : (选项)请启用在拨号接口的NAT外部。
Router#configure terminal
Router(config)#interface dialer 1
Router(config-if)#ip address negotiated
Router(config-if)#mtu 1492
Router(config-if)#no ip directed-broadcast
!--- For NAT:
Router(config-if)#ip nat outside
Router(config-if)#encapsulation ppp
Router(config-if)#dialer pool 1
Router(config-if)#ppp chap hostname <username>
Router(config-if)#ppp chap password <password>
Router(config-if)#ppp pap sent-username <username> password <password>
Router(config-if)#end

配置一个默认路由使用拨号1作为出站接口。
8.
Router#configure terminal
Router(config)#ip route 0.0.0.0 0.0.0.0 dialer1
Router(config)#end

对NAT : 配置在Cisco DSL路由器的全局Nat命令允许共享拨号接口的动态公网IP地址。
9.
Router#configure terminal
Router(config)#ip nat inside source list 1 interface dialer1 overload
Router(config)#access-list 1 permit <ip network address of ethernet0><wildcard mask>
Router(config)#end

可选配置
NAT池,如果ISP提供了额外的IP地址。
Router(config)#ip nat inside source list 1 interface dialer1 overload
Router(config)#ip nat pool <nat pool name> <first ip address><last ip address> netmask <subnet mask>
Router(config)#end
静态NAT,如果互联网用户需要对内部服务器的访问。
Router(config)#ip nat inside source static tcp <inside ip address of server>{80 or 25} <outside well-known ip address of server> {80 or 25} extendable
Router(config)#end

对动态主机配置协议(DHCP) : (选项)请配置Cisco DSL路由器作为IP地址池的DHCP服务器,为连接到Cisco DSL路由器以太网
接口的主机分配IP 地址。 DHCP服务器动态地分配IP地址、域名服务器(DNS)和默认网关IP地址到主机。
10.
Router#
4000
configure terminal
Router(config)#ip dhcp excluded-address <ip address of ethernet0>
Router(config)#ip dhcp pool <dhcp pool name>
Router(dhcp-config)#network <ip network address of ethernet0> <subnet mask>
Router(dhcp-config)#default-router <ip address of ethernet0>
Router(dhcp-config)#dns-server <ip address of primary dns server>
<ip address of secondary dns server>
Router(dhcp-config)#end

启用在Cisco DSL路由器上的logging console,并且把所有更改写入内存。
11.
Router#configure terminal
Router(config)#logging console
Router(config)#end
*Jan 1 00:00:00.100: %SYS-5-CONFIG_I: Configured from console by console
Router#write memory
Building configuration... [OK]
Router#

配置
!--- Comments contain explanations and additional information.
service timestamps debug datetime msec
service timestamps log datetime msec
vpdn enable
no vpdn logging
vpdn-group pppoe
 request-dialin
  protocol pppoe
!
!
ip subnet-zero
!
!--- For DHCP:
ip dhcp excluded-address <ip address of ethernet0>
ip dhcp pool <dhcp pool name>
network <ip network address of ethernet0> <subnet mask>
default-router <ip address of ethernet0>
dns-server <ip address of dns server>
!
interface ethernet0
no shut
ip address <ip address> <subnet mask>
ip tcp adjust-mss 1452
!--- If the ip tcp adjust-mss 1452 command is not supported, try
!--- this configuration statement:
!--- ip adjust-mss 1452
!--- If this command is not supported in your current Cisco DSL Router software
!--- release, either upgrade to the latest Cisco DSL Router software or follow the
!--- procedure in Possible Required Configuration Steps on the PC.
!--- For NAT:
ip nat inside
no ip directed-broadcast
!
interface atm0
no shut
no ip address
bundle-enable
dsl operating-mode auto
!
interface atm0.1 point-to-point
no ip address
no ip directed-broadcast
no atm ilmi-keepalive
pvc <vpi/vci>
pppoe-client dial-pool-number 1
!--- Common PVC values supported by ISPs are 0/35 or 8/35.
!--- Confirm your PVC values with your ISP.
!
!
interface dialer1
ip address negotiated
mtu 1492
!--- For NAT:
ip nat outside
encapsulation ppp
dialer pool 1
ppp chap hostname <username>
ppp chap password <password>
ppp pap sent-username <username> password <password>
!
!--- For NAT:
ip nat inside source list 1 interface dialer1 overload
!--- If you have a pool (a range) of public IP addresses provided
!--- by your ISP, you can use a NAT Pool. Replace
!--- ip nat inside source list 1 interface dialer1 overload
!--- with these two configuration statements:
!--- ip nat inside source list 1 pool <nat pool name> overload
!--- ip nat pool <nat pool name> <first ip address>
!---  <last ip address> netmask <subnet mask>
!--- If Internet users require access to an internal server, you can
!--- add this static NAT configuration statement:
!--- ip nat inside source static tcp <inside ip address of server> {80 or 25}
!--- <outside well-known ip address of server> {80 or 25} extendable
!--- Note: TCP port 80 (HTTP/web) and TCP port 25 (SMTP/mail) are used
!--- for this example. You can open other TCP or UDP ports, if needed.
!
ip classless
ip route 0.0.0.0 0.0.0.0 interface dialer 1
!--- For NAT:
access-list 1 permit <ip network address of ethernet0> <wildcard mask>
!--- In this configuration, access-list 1 defines a standard access list
!--- that permits the addresses that NAT translates. For example, if
!--- your private IP network is 10.10.10.0, configure
!--- access-list 1 permit 10.10.10.0 0.0.0.255 in order to allow NAT to translate
!--- packets with source addresses between 10.10.10.0 and 10.10.10.255.
!
end

验证
Router#show run
Building configuration...
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息