本帖最后由 9527★冬瓜版 于 2013-10-20 09:22 编辑
首先配置VPDN router(config)#vpdn enable(启用路由器的虚拟专用拨号网络-vpnd) router(config)#vpdn-group office (建立一个vpdn 组 office) router(config-vpdn)#request-dialin(初始化一个vpnd tunnel,建立一个请求拨入的vpdn子组,) router(config-vpdn-req-in)#protocol pppoe (vpdn子组使用pppoe建立会话隧道 但是我的2821 是 12.4 的ios 这条敲不上) 第二配置路由器与ADSL 猫的连接端口 router(config)#interface fastEthernet 0/1 router(config-if)#no ip address router(config-if)#pppoe enable 允许以太接口运行pppoe router(config-if)#pppoe-client dial-pool-number1将以太接口的pppoe拨号客户端加入拨号池1 3、ADSL配置拨号 router(config)#interface dialer1 (配置逻辑拨号接口) router(config-if)#ip address negotiated (从adsl服务商动态协商得到ip地址) router(config-if)#ip nat outside (为该接口启用NAT ) router(config-if)#encapsulation ppp (为该接口封装PPP协议) router(config-if)#dialer pool 1 (该接口使用1号拨号池进行拨号) router(config-if)#dialer-group 1 (该命令对于pppoe是意义不大的) router(config-if)#ppp authentication pap callin (启用ppp pap验证) router(config-if)#$t-username fsDSL XXXXgd password XXXXX(XXX为申请ADSL的用户名和口令) 这样基本就齐了,但是你还要设置内部网络的NAT以及默认路由,算了我都贴上吧 配置NAT: router(config)#access-list 1 permit 10.10.10.0 0.0.0.255 router(config)#ip nat inside source list 1 interface dialer 1 overload 配置默认路由 router(config)ip route 0.0.0.0 0.0.0.0 Dialer1 公网IP地址获得了 但是无法正常上网
设备配置情况 R2821#show run Building configuration... Current configuration : 15242 bytes ! ! Last configuration change at 00:36:23 UTC Sun Oct 20 2013 ! version 15.0 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! hostname R2821 ! boot-start-marker boot-end-marker ! enable secret 5 $1$L9Bt$Bh710XYjHsNMaREg//sa// ! no aaa new-model ! dot11 syslog ip source-route ! ! ip cef ip dhcp excluded-address 192.168.10.1 192.168.10.100 ip dhcp excluded-address 192.168.20.1 ip dhcp excluded-address 192.168.30.1 ip dhcp excluded-address 192.168.50.1 ip dhcp excluded-address 192.168.16.1 192.168.16.100 ip dhcp excluded-address 192.168.16.118 ip dhcp excluded-address 192.168.16.124 ip dhcp excluded-address 192.168.40.1 192.168.40.100! ! ip dhcp pool 123 network 192.168.16.0 255.255.255.0 default-router 192.168.16.1 dns-server 202.96.209.133 8.8.8.8 ! ! no ip domain lookup no ipv6 cef multilink bundle-name authenticated ! ! ! vpdn enable ! vpdn-group office ! ! voice-card 0 ! ! interface GigabitEthernet0/0 no ip address duplex auto speed auto ! interface GigabitEthernet0/0.1 description LAN encapsulation dot1Q 1 native ip address 192.168.10.1 255.255.255.0 secondary ip address 192.168.16.1 255.255.255.0 ip nat inside ip virtual-reassembly ! ! interface GigabitEthernet0/1 no ip address duplex auto speed auto pppoe enable group global 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 ppp authentication pap callin ppp pap sent-username ad48943103 password 7 101B514A534F435258 no cdp enable ! ip forward-protocol nd no ip http server no ip http secure-server ! ! ip nat inside source list 100 interface Dialer1 overload ip route 0.0.0.0 0.0.0.0 Dialer1 ip route 10.0.0.0 255.0.0.0 172.16.0.1 ! ip access-list standard vty permit 192.168.50.200 permit 192.168.10.200 permit 192.168.16.200 permit 192.168.16.201 permit 192.168.16.202 permit 192.168.20.200 deny any ! ip access-list extended ap20 permit ip 192.168.20.0 0.0.0.255 any ip access-list extended ip-mac permit udp any eq bootps any eq bootpc permit udp any eq bootpc any eq bootps ! access-list 99 permit 192.168.16.0 0.0.0.255 access-list 99 permit 192.168.10.0 0.0.0.255 access-list 99 permit 192.168.20.0 0.0.0.255 access-list 99 permit 192.168.30.0 0.0.0.255 access-list 99 permit 192.168.40.0 0.0.0.255 access-list 100 permit ip any any access-list 101 permit ip 192.168.20.0 0.0.0.255 any no cdp run ! snmp-server community 123456 RO ! ! control-plane ! ! |