前言:

題目很簡明易瞭了,一般在家庭使用的小烏龜(ADSL)

通常在上網時需要透過PPPOE的協定,輸入你的帳號密碼才能連線

現在要做的就是如何使用CISCO ROUTER,取代ADSL在做的事情

這個的好處在於可以給每個Client端一組使用帳號,通過驗證以後才能上網


環境說明:


這是每個家庭裡使用ADSL的基本環境,也許還接了台IP分享器
111.jpg 


這是使用ROUTER取代ADSL功能的環境
222.jpg 


設備說明:

1.ROUTER 2621(非XM型)

Version :

#show ver
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-IK9O3S3-M), Version 12.3(26), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by cisco Systems, Inc.
Compiled Mon 17-Mar-08 15:23 by dchih


ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)


*** uptime is 1 day, 4 hours, 35 minutes
System returned to ROM by power-on
System image file is "flash:c2600-ik9o3s3-mz.123-26.bin"

2.NB一台 


接下來用running-config

一步一步拆解每個指令所代表的意思


#show run
Building configuration...


Current configuration : 1772 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ***                                      (router名稱自定)
!
boot-start-marker
boot-end-marker
!
enable password 123456                     
!
memory-size iomem 10
aaa new-model
!
!
aaa group server radius pppoe          (設定AAA 群組 開啟遠端認證的協議 )
 server 192.168.0.182 auth-port 1645 acct-port 1646
(設定遠端認證的IP位置及port)
!
aaa authentication login ray local
aaa session-id common
ip subnet-zero
ip cef
!
!
ip domain name ******
!
ip audit po max-events 100
vpdn enable                (開啟VPDN(Visual Private Dail-up Network))
!
!
vpdn-group pppoe   (設置VPDN群組協議)
 accept-dialin            (允許撥號進入)
  protocol pppoe       (協議方式)
  virtual-template 1   (開啟虛擬模組)
 pppoe limit per-vlan 300 (限定Vlan最大使用人數300,不設定也可)
!
!
!
!
!
!
!
!
!
!
!
!
!
username ray password 0 123456                      
username rayliu privilege 3 password 0 123456
username russell password 0 g8mark
(寫入使用者帳號及密碼,此為認證PPPOE時要輸入的帳密)
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.0.182 255.255.255.0 (連至Internet的網段)
 ip nat outside    (設定NAT出口)
 speed 100         (速率)
 full-duplex          (全雙工)
!
!
interface FastEthernet0/1
 no ip address (不輸入IP位置)
 speed 100      (速率)
 full-duplex       (全雙工)
 pppoe enable (開啟PPPOE協定)
!
!
!
interface Virtual-Template1 (進入虛擬模組介面)
 mtu 1492 (1492=1500-8byte標頭)                  (請參考維基網站http://zh.wikipedia.org/wiki/MTU)
 ip unnumbered FastEthernet0/0 (在虛擬模組下的IP都跟fa0/0借介面使用)
 ip nat inside                            (設置NAT入口)
 peer default ip address pool adsl (從IP池中發出未使用的IP,給虛擬介面使用者)
 ppp authentication chap (設定點對點的驗證方式(point to point)
 ppp ipcp dns 192.168.0.254 (設定虛擬介面的DNS位置)
!
ip local pool adsl 192.168.50.10 192.168.50.250 (設定一組發給虛擬模組使用的IP)
ip nat pool dnat 192.168.0.182 192.168.0.190 netmask 255.255.255.0(在後面講解)
ip nat inside source list 1 pool dnat(在後面講解)
no ip http server  (關閉HTTP SERVER ,與本主旨無關,不關也沒差)
ip http authentication local (認證使用cisco本機的帳號密碼)
no ip http secure-server (與本題無關)
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.0.254   (將所有IP設置路由指向出口的另一端)
!
!
access-list 1 permit 192.168.50.0 0.0.0.255 (設置ACL)
!
radius-server host 192.168.0.182 auth-port 1645 acct-port 1646 key 88 99 
(設定radius(遠端驗證服務)的IP位置和port) *AAA group 和radius都要相同 
!

!
!

privilege configure all level 3 router(與本題無關)
!
line con 0
 password 123456
line aux 0
line vty 0 4
 password 123456
 transport input ssh
(與本題無關)

!
!
end

 

電腦使用PPPOE認證操作:(Win 7)

從網路共用和中心進入→設定新的連線或網路→建立新連線→寬頻(PPPOE)→在此輸入你的帳號密碼(連線名稱自己填)
111.jpg  

 

認證成功,就大功告成啦!
222.jpg  


PS.

雖然說會使用router來做環境的朋友們,代表你們已經有一定的底,但還是要提醒一下

我設置對外的IP位置(fa0/0)是因為前面還有防火牆,所以可以使用Private IP,

對外IP設定主要還是要看各位朋友前端的環境,千萬別跟著使用Private IP

免得想破了頭也不知道為啥網路不通。

_____________________________________________________________________________________________________________________________


後記:

如果你這時候PPPOE已經驗證通過,卻還是不能上網,代表還有一段NAT必須設定

你在將IP位置送往fa0/0,到Internet的過程當中,並不會轉換成Public IP,ADSL就會將你的封包丟棄

這樣,下面的設定值就稍為看一下吧!


此以Dynamic NAT 做為參考

access-list 1 permit 192.168.50.0 0.0.0.255
(這組原本設置的ACL,要再利用來做NAT的轉換)

ip nat pool dnat 192.168.0.182 192.168.0.190 netmask 255.255.255.0
(設置一個或一組可以連到Internet的網路)
!
ip nat inside source list 1 pool dnat
(將ACL和可以連外的IP池組合起來,放在入口端)


基本上,到這裡就告一段落了,祝各位測試順利


arrow
arrow
    全站熱搜

    RAY大人 發表在 痞客邦 留言(1) 人氣()