配置PPPoE拨号双链路负载分担示例
组网需求
如图1所示,设备作为企业出口网关,通过PPPoE拨号双上行接入Internet,链路1和链路2的出口路由采用等价路由进行负载分担。设备上配置NAT实现企业私网用户访问Internet。
配置思路
采用如下的配置思路:
- 在Dialer1接口和Dialer2接口下配置CHAP认证,实现设备通过PPP认证分别与PPPoE Server1和PPPoE Server2建立连接。
- 配置拨号方式为自动拨号方式,这样,连接断开后,每隔一段时间设备会自动再次尝试建立拨号连接。
- 配置NAT功能,实现局域网内的用户可以访问外网。
- 配置等价路由,基于源IP地址进行负载分担。
操作步骤
1、配置Dialer1接口,用户名和密码为用户向运营商获取接入网络的用户名和密码
<Huawei> system-view [Huawei] sysname Router [Router] interface dialer 1 [Router-Dialer1] dialer user user2 [Router-Dialer1] dialer bundle 1 [Router-Dialer1] ppp chap user user1@system [Router-Dialer1] ppp chap password cipher YsHsjx_202206 [Router-Dialer1] ip address ppp-negotiate [Router-Dialer1] quit
2、配置Dialer2接口,用户名和密码为用户向运营商获取接入网络的用户名和密码
[Router] interface dialer 2 [Router-Dialer2] dialer user user2 [Router-Dialer2] dialer bundle 2 [Router-Dialer2] ppp chap user user1@system [Router-Dialer2] ppp chap password cipher YsHsjx_202206 [Router-Dialer2] ip address ppp-negotiate [Router-Dialer2] quit
3、建立PPPoE会话
[Router] interface gigabitethernet 2/0/0 [Router-GigabitEthernet2/0/0] pppoe-client dial-bundle-number 1 [Router-GigabitEthernet2/0/0] quit [Router] interface gigabitethernet 3/0/0 [Router-GigabitEthernet3/0/0] pppoe-client dial-bundle-number 2 [Router-GigabitEthernet3/0/0] quit
4、配置局域网用户通过NAT转换将私网地址转换为公网地址,进行拨号上网
[Router] acl number 3002 [Router-acl-adv-3002] rule 5 permit ip source 192.168.10.0 0.0.0.255 [Router-acl-adv-3002] quit [Router] interface dialer 1 [Router-Dialer1] nat outbound 3002 [Router-Dialer1] quit [Router] interface dialer 2 [Router-Dialer2] nat outbound 3002 [Router-Dialer2] quit
5、配置到PPPoE Server的等价路由,基于源IP地址进行负载分担
[Router] ip route-static 0.0.0.0 0 dialer 1 [Router] ip route-static 0.0.0.0 0 dialer 2 [Router] ip load-balance hash src-ip
6、配置Dialer1接口拨号失败时转换为Down状态,自动切换为Dialer2接口进行拨号
[Router] interface dialer 1 [Router-Dialer1] dialer number 1 autodial [Router-Dialer1] quit [Router] quit
7、验证配置结果
# 在PPPoE Client上执行命令display pppoe-client session summary,查看PPPoE会话状态和配置信息。根据显示信息判断会话状态是否正常(状态为UP表示正常)、配置是否正确(是否和之前的数据规划和组网一致)。
<Router> display pppoe-client session summary PPPoE Client Session: ID Bundle Dialer Intf Client-MAC Server-MAC State 1 1 1 GE2/0/0 00e0fc577510 0819a6cd0680 UP 1 2 2 GE3/0/0 00e0fc577511 001109141bd3 UP