root
Well-Known Member
- Joined
- Dec 31, 2012
- Messages
- 1,153
- Reaction score
- 71
- Points
- 48
- PPP over Ethernet là một sự phát triển dựa trên kỹ thuật PPP truyền thống.
- PPPoE cung cấp khả năng kết nối nhiều host trong mạng qua một thiết bị chuyển mạch vào một DSLAM, để cung cấp một kết nối PPPoE, mỗi phiên PPP phải học địa chỉ Ethernet của remote peer và thiết lập một danh định duy nhất.
- PPPoE gồm 2 pha: Discovery và Session:
- Discovery: khi một router muốn khởi tạo 1 phiên PPPoE, nó phải xác định địa chỉ MAC của thiết bị bên kia (Lát nửa debug sẽ cho thấy điều này) và thiết lập một PPPoE Session-ID. Trong quá trình này, CPE sẽ tìm các DSLAM và chọn một cái để sử dụng. Khi quá trình này chấm dứt, cả CPE và DSLAM đều sẽ có thông tin mà nó sử dụng để xây dựng kết nối PPPoE. Khi PPPsession được thiết lập thì cả CPE và DSLAM sẽ phải phân phát tài nguyên của mình cho một PPP virtual interface.
- Session: khi được thiết lập thì dữ liệu sẽ được gửi.
- Khi cty các bạn or nhà bạn kéo 1 đường ADSL, FTTH... thì nhà cung cấp dịch vụ sẽ cấp cho bạn 1 modem như Draytek vigor 200. Nếu bình thường với lượng user ít thì vigor 200 như mô hình dưới có thể hoạt động tốt
- Nhưng sau 1 thời gian cty của bạn có số lượng nhân viên tăng lên, nhiều server hơn ... lúc này cty bạn cần 1 con Router WAN để xử lý đầu WAN thật tốt. Để nâng cao performence của hệ thống, ví dụ mình sẽ triển khai con 2911 của Cisco thay thế cho con vigor 200
II. Cấu hình
1. Lấy các thông số draytek
- Để config pppoe thì việc đầu tiên bạn cần có username/password của nhà cung cấp dịch vụ cấp cho bạn
Code:
[COLOR=#ff0000]username[/COLOR]: svuit
[COLOR=#ff0000]password[/COLOR]: svuit.vn
- Báo cho ISP cập nhập ISP, cách này thì hơi thụ động
- Cách thứ 2 là chúng ta thực hiện chức năng Clone MAC, nghĩa là lấy MAC modum cũ gắn qua cho con Modem mới (lừa tình ISP )
- Bật tính năng pppoe trên interface f0/0 của Router
[TABLE="class: outer_border, width: 700"]
[TR]
[TD]Router(config)#int f0/0
Router(config-if)#no ip address
Router(config-if)#ip tcp adjust-mss 1452
// bật pppoe trên interface f0/0 nối với server
Router(config-if)#pppoe enable
//sử dụng dialer 1 để giao tiếp với server
Router(config-if)#pppoe-client dial-pool-number 1
Router(config-if)#no shutdown[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 700"]
[TR]
[TD] //tạo và cấu hình dialer 1
Router(config-if)#interface dialer 1
//nhận ip động từ ISP
Router(config-if)#ip address negotiated
//đóng gói qua giao thức ppp
Router(config-if)#encapsulation ppp
//khai báo line ADLS, FTTH...
Router(config-if)#dialer pool 1
Router(config-if)#dialer-group 1
Router(config-if)#no cdp enable[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 700"]
[TR]
[TD]Router(config-if)#ppp authentication pap chap callin
//username và pass mà ISP cấp cho bạn
Router(config-if)#ppp pap sent-username svuit password svuit.vn
//tên của thiết bị, các bạn lưu ý tên này sẽ được dùng để xác thực với ISP
Router(config-if)#ppp chap hostname svuit
//password của ISP cấp
Router(config-if)#ppp chap password svuit.vn
Router(config-if)#exit[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]Router(config)#int f0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 800"]
[TR]
[TD]//Default route về ISP
Router(config)#ip route 0.0.0.0 0.0.0.0 dialer 1
// NAT overload inside ra internet
Router(config)#access-list 1 permit any
Router(config)#ip nat inside source list 1 interface dialer 1 overload
Router(config)#int dialer 1
Router(config-if)#ip nat outside
Router(config-if)#int f0/1
Router(config-if)#ip nat inside[/TD]
[/TR]
[/TABLE]
- Xem tiến trình ppp
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]Router#debug ppp authentication
Router#debug ppp negotiation[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]Router#show pppoe session all
Router#show pppoe packets[/TD]
[/TR]
[/TABLE]
Code:
Router(config-if)#
Sep 28 04:50:00.903: %DIALER-6-BIND: Interface Vi2 bound to profile Di1
Sep 28 04:50:00.907: %LINK-3-UPDOWN: Interface Virtual-Access2, changed state to up
Sep 28 04:50:00.907: Vi2 PPP: Sending cstate UP notification
Sep 28 04:50:00.907: Vi2 PPP: Processing CstateUp message
Sep 28 04:50:00.907: PPP: Alloc Context [3078BCBC]
Sep 28 04:50:00.907: ppp2 PPP: Phase is ESTABLISHING
Sep 28 04:50:00.907: Vi2 PPP: Using dialer call direction
Sep 28 04:50:00.907: Vi2 PPP: Treating connection as a callout
Sep 28 04:50:00.907: Vi2 PPP: Session handle[C8000002] Session id[2]
Sep 28 04:50:00.907: Vi2 LCP: Event[OPEN] State[Initial to Starting]
Sep 28 04:50:00.907: Vi2 PPP: No remote authentication for call-out
Sep 28 04:50:00.907: Vi2 LCP: O CONFREQ [Starting] id 1 len 10
Sep 28 04:50:00.907: Vi2 LCP: MagicNumber 0xDA899778 (0x0506DA899778)
Sep 28 04:50:00.907: Vi2 LCP: Event[UP] State[Starting to REQsent]
Sep 28 04:50:01.003: Vi2 LCP: I CONFREQ [REQsent] id 52 len 18
Sep 28 04:50:01.003: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.003: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.003: Vi2 LCP: O CONFNAK [REQsent] id 52 len 8
Sep 28 04:50:01.003: Vi2 LCP: MRU 1500 (0x010405DC)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfReq-] State[REQsent to REQsent]
Sep 28 04:50:01.003: Vi2 LCP: I CONFACK [REQsent] id 1 len 10
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0xDA899778 (0x0506DA899778)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfAck] State[REQsent to ACKrcvd]
Sep 28 04:50:01.003: Vi2 LCP: I CONFREQ [ACKrcvd] id 53 len 18
Sep 28 04:50:01.003: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.003: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.003: Vi2 LCP: O CONFNAK [ACKrcvd] id 53 len 8
Sep 28 04:50:01.003: Vi2 LCP: MRU 1500 (0x010405DC)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfReq-] State[ACKrcvd to ACKrcvd]
Sep 28 04:50:01.003: Vi2 LCP: I CONFREQ [ACKrcvd] id 54 len 18
Sep 28 04:50:01.003: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.003: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.003: Vi2 LCP: O CONFNAK [ACKrcvd] id 54 len 8
Sep 28 04:50:01.003: Vi2 LCP: MRU 1500 (0x010405DC)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfReq-] State[ACKrcvd to ACKrcvd]
Sep 28 04:50:01.003: Vi2 LCP: I CONFREQ [ACKrcvd] id 55 len 18
Sep 28 04:50:01.003: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.003: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.003: Vi2 LCP: O CONFNAK [ACKrcvd] id 55 len 8
Sep 28 04:50:01.003: Vi2 LCP: MRU 1500 (0x010405DC)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfReq-] State[ACKrcvd to ACKrcvd]
Sep 28 04:50:01.003: Vi2 LCP: I CONFREQ [ACKrcvd] id 56 len 18
Sep 28 04:50:01.003: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.003: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.003: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.003: Vi2 LCP: O CONFNAK [ACKrcvd] id 56 len 8
Sep 28 04:50:01.003: Vi2 LCP: MRU 1500 (0x010405DC)
Sep 28 04:50:01.003: Vi2 LCP: Event[Receive ConfReq-] State[ACKrcvd to ACKrcvd]
Sep 28 04:50:01.007: Vi2 LCP: I CONFREQ [ACKrcvd] id 57 len 18
Sep 28 04:50:01.007: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.007: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.007: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.007: Vi2 LCP: Sent too many CONFNAKs. Switch to CONFREJ
Sep 28 04:50:01.007: Vi2 LCP: O CONFREJ [ACKrcvd] id 57 len 8
Sep 28 04:50:01.007: Vi2 LCP: MRU 1492 (0x010405D4)
Sep 28 04:50:01.007: Vi2 LCP: Event[Receive ConfReq-] State[ACKrcvd to ACKrcvd]
Sep 28 04:50:01.007: Vi2 LCP: I CONFREQ [ACKrcvd] id 58 len 14
Sep 28 04:50:01.007: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.007: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.007: Vi2 LCP: O CONFACK [ACKrcvd] id 58 len 14
Sep 28 04:50:01.007: Vi2 LCP: AuthProto PAP (0x0304C023)
Sep 28 04:50:01.007: Vi2 LCP: MagicNumber 0x1C76AC29 (0x05061C76AC29)
Sep 28 04:50:01.007: Vi2 LCP: Event[Receive ConfReq+] State[ACKrcvd to Open]
Sep 28 04:50:01.031: Vi2 PPP: No authorization without authentication
Sep 28 04:50:01.031: Vi2 PPP: Phase is AUTHENTICATING, by the peer
Sep 28 04:50:01.031: Vi2 PAP: Using hostname from interface PAP
Sep 28 04:50:01.031: Vi2 PAP: Using password from interface PAP
Sep 28 04:50:01.031: Vi2 PAP: O AUTH-REQ id 1 len 23 from "F005969.bdg"
Sep 28 04:50:01.031: Vi2 LCP: State is Open
Sep 28 04:50:01.299: Vi2 PAP: I AUTH-ACK id 1 len 5
Sep 28 04:50:01.299: Vi2 PPP: Phase is FORWARDING, Attempting Forward
Sep 28 04:50:01.299: Vi2 PPP: Phase is ESTABLISHING, Finish LCP
Sep 28 04:50:01.303: Vi2 PPP: Phase is UP
Sep 28 04:50:01.303: Vi2 IPCP: Protocol configured, start CP. state[I
Router#
Router#
Router#
Router#nitial]
Sep 28 04:50:01.303: Vi2 IPCP: Event[OPEN] State[Initial to Starting]
Sep 28 04:50:01.303: Vi2 IPCP: O CONFREQ [Starting] id 1 len 10
Sep 28 04:50:01.303: Vi2 IPCP: Address 0.0.0.0 (0x030600000000)
Sep 28 04:50:01.303: Vi2 IPCP: Event[UP] State[Starting to REQsent]
Sep 28 04:50:01.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access2, changed state to up
Sep 28 04:50:01.303: Vi2 IPCP: I CONFNAK [REQsent] id 1 len 10
Sep 28 04:50:01.303: Vi2 IPCP: Address 113.x.x.x
Router#
Router#
Router#(0x030671A2D4E7)
Sep 28 04:50:01.303: Vi2 IPCP: O CONFREQ [REQsent] id 2 len 10
Sep 28 04:50:01.303: Vi2 IPCP: Address 113.x.x.x (0x030671A2D4E7)
Sep 28 04:50:01.303: Vi2 IPCP: Event[Receive ConfNak/Rej] State[REQsent to REQsent]
Sep 28 04:50:01.303: Vi2 IPCP: I CONFACK [REQsent] id 2 len 10
Sep 28 04:50:01.303: Vi2 IPCP: Address 113.x.x.x (0x030671A2D4E7)
Sep 28 04:50:01.303: Vi2 IPCP: Event[Receive ConfAck] State[REQsent to ACKrcvd]
Sep 28 04:50:01.403: Vi2 IPCP: I CONFREQ [ACKrcvd] id 185 len 10
Sep 28 04:50:01.403: Vi2 IPCP: Address 123.x.x.x (0x03067B1C1C01)
Sep 28 04:50:01.407: Vi2 IPCP: O CONFACK [ACKrcvd] id 185 len 10
Sep 28 04:50:01.407: Vi2 IPCP: Address 123.x.x.x (0x03067B1C1C01)
Sep 28 04:50:01.407: Vi2 IPCP: Event[Receive ConfReq+] State[ACKrcvd to Open]
Sep 28 04:50:01.415: Vi2 IPCP: State is Open
Sep 28 04:50:01.415: Di1 IPCP: [COLOR=#ff0000]Install negotiated IP interface address 113.x.x.x[/COLOR]
Sep 28 04:50:01.415: [COLOR=#ff0000]Di1 Added to neighbor route AVL tree: topoid 0, no address 123.x.x.x[/COLOR]
[COLOR=#ff0000]Sep 28 04:50:01.415: Di1 IPCP: Install route to 123.x.x.x[/COLOR]
[COLOR=#ff0000]Sep 28 04:50:10.935: %SYS-5-CONFIG_I: Configured from console by consoledubug [/COLOR]