Hướng dẫn ny gip cc bạn cấu hnh FTTH - PPPoE load balancing / failover giữa 2 kết nối WAN trn 1 thiết bị router Cisco. Ngoi ra, hướng dẫn ny cũng gip bạn biết cch public 1 dịch vụ từ mạng LAN ra ngoi Internet trn cả 2 kết nối WAN ny.

Để cấu hnh FTTH - PPPoE trn cc thiết bị router Cisco, chng ta cần chuẩn bị cc thng tin sau:

- Username nh mạng cung cấp, v dụ: ftth_myUsername_ISPX
- Password nh mạng cung cấp, v dụ: ftth_myPassowrd_ISPX
(X l biến với gi trị 1 hoặc 2. Tương ứng với thng tin PPPoE của 2 nh cung cấp đường truyền)

Ngoi ra, để public dịch vụ ra Internet, thng thường chng ta phải c IP WAN tĩnh. Trong v dụ ny IP WAN tĩnh của 2 nh mạng cấp cho chng ta l:

- ISP1: 118.69.53.32
- ISP2: 112.213.89.79

Ch , đối với nh mạng FTP, ngoi username, password của PPPoE, nh mạng FPT cn chứng thực thm MAC address của Khch hng. Do đ, sau khi cấu hnh xong, bạn phải điện thoại nhờ FPT cập nhật địa chỉ MAC trn hệ thống của họ.

Cc bước thực hiện:

- Định nghĩa Interface LAN
- Định nghĩa Interface WAN
- Định nghĩa Dialer Interface, dng để kết nối PPPoE đến nh mạng 2 nh mạng.
- Định nghĩa NAT để người dng trong mạng LAN c thể truy cập Internet trn 2 kết nối WAN
- Định nghĩa cc track của 2 WAN trạng thi up v down của 2 WAN để định tuyến dữ liệu từ LAN ra WAN.
- Định nghĩa IP routing
- Định nghĩa static NAT để public dịch vụ Web trong mạng LAN ra ngoi Internet thng qua 2 kết nối WAN

Sau đy l cc bước thực hiện tuần tự:

CISCO(config)# interface GigabitEthernet0/0
CISCO(config-if)#description #LAN Interface#
CISCO(config-if)#ip address 192.168.1.1
CISCO(config-if)#no shutdown
CISCO(config-if)#ip nat inside

CISCO(config)# interface GigabitEthernet0/1
CISCO(config-if)#description #WAN Interface to ISP1#
CISCO(config-if)#no ip address
CISCO(config-if)#pppoe enable group global
CISCO(config-if)#pppoe-client dial-pool-number 1
CISCO(config-if)#no shutdown

CISCO(config)# interface GigabitEthernet0/2
CISCO(config-if)#description #WAN Interface to ISP2#
CISCO(config-if)#no ip address
CISCO(config-if)#pppoe enable group global
CISCO(config-if)#pppoe-client dial-pool-number 2
CISCO(config-if)#no shutdown

CISCO(config)# interface dialer 1
CISCO(config-if)#description #Dialer interface to ISP 1#
CISCO(config-if)#ip mtu 1492
CISCO(config-if)# dialer pool 1
CISCO(config-if)# encapsulation ppp
CISCO(config-if)# ip address negotiated
CISCO(config-if)#ip nat outside
CISCO(config-if)#ppp pap sent-username ftth_myUsername_ISP1 password 0 ftth_myPassword_ISP1

CISCO(config)# interface dialer 2
CISCO(config-if)#description #Dialer interface to ISP 2#
CISCO(config-if)#ip mtu 1492
CISCO(config-if)# dialer pool 2
CISCO(config-if)# encapsulation ppp
CISCO(config-if)# ip address negotiated
CISCO(config-if)#ip nat outside
CISCO(config-if)#ppp pap sent-username ftth_myUsername_ISP2 password 0 ftth_myPassword_ISP2


CISCO(config)#access-list 100 permit ip 192.168.1.0 0.0.0.255 any


CISCO(config)#route-map isp1 permit 10
CISCO(config-route-map)#match ip address 100
CISCO(config-router-map)#match interface Dialer 1


CISCO(config)#route-map isp2 permit 20
CISCO(config-route-map)#match ip address 100
CISCO(config-router-map)#match interface Dialer 2


CISCO(config)#ip nat inside source route-map isp1 interface Dialer 1 overload
CISCO(config)#ip nat inside source route-map isp2 interface Dialer 2 overload

//Tạo Tracking-Object cho Dialer 1
CISCO(config)#ip sla monitor 100
CISCO(config-sla-monitor)#type echo protocol ipIcmpEcho 8.8.8.8 source-interface Dialer 1
CISCO(config-sla-monitor)#timeout 500
CISCO(config-sla-monitor)#frequency 3
//Tracking-Object ping Google dns 8.8.8.8 qua interface Dialer 1 mỗi 3 giy v timeout sau 500ms khng nhận được response.

//Lp lịch cho Tracking-Object thực thi tức th v lin tục
CISCO(config)#ip sla monitor schedule 100 life forever start-time now

//Track đối tượng Tracking-Object ở trn
CISCO(config)#track 100 rtr 100 reachability
CISCO(config-track)#delay down 10 up 20

//Tạo Tracking-Object cho Dialer 2
CISCO(config)#ip sla monitor 200
CISCO(config-sla-monitor)#type echo protocol ipIcmpEcho 8.8.8.8 source-interface Dialer 2
CISCO(config-sla-monitor)#timeout 500
CISCO(config-sla-monitor)#frequency 3
//Tracking-Object ping Google dns 8.8.8.8 qua interface Dialer 2 mỗi 3 giy v timeout sau 500ms khng nhận được response.

//Lp lịch cho Tracking-Object thực thi tức th v lin tục
CISCO(config)#ip sla monitor schedule 200 life forever start-time now

//Track đối tượng Tracking-Object ở trn
CISCO(config)#track 200 rtr 200 reachability
CISCO(config-track)#delay down 10 up 20


CISCO(config)#ip route 0.0.0.0 0.0.0.0 Dialer 1 track 100
CISCO(config)#ip route 0.0.0.0 0.0.0.0 Dialer 2 track 200

//Publish dịch vụ web ra Internet qua 2 WAN IP.
CISCO(config)#route-map isp1static permit 10
CISCO(config-route-map)#match interface Dialer 1

CISCO(config)#route-map isp2static permit 10
CISCO(config-route-map)#match interface Dialer 2

CISCO(config)#ip nat inside source static tcp 192.168.1.100 80 118.69.53.32 80 route-map isp1static
CISCO(config)#ip nat inside source static tcp 192.168.1.100 80 112.213.89.79 80 route-map isp2static

Bn dưới l cc lệnh dng để troubleshooting cấu hinh PPPoE, NAT v ti liệu tham khảo:

CISCO(config)#show ip interface brief
CISCO(config)#show ip nat translation
CISCO(config)#debug ppp authentication

Ngoi ra, để load balancing trn 2 đường truyền WAN cho WEB server, cc bạn cần cấu hnh record www v A cho cả 2 IP WAN của mnh.

Ti liệu tham khảo:
- NAT failover with DUAL ISP on a router Configuration Example.
- Configuring WAN Interface Failover in Cisco IOS
- Cấu hnh FTTH - PPPoE trn thiết bị router Cisco

Cc bạn cần hỗ trợ dịch vụ, thiết bị mạng Cisco, lin hệ với chung ti tại http://switch-router.com/contact/