cisco路由器共享企業網連接ADSL配置實例.pdf

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 [email protected] 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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章