2024年3月31日发(作者:)

华为防火墙-USG--PPPoE拨号配置

一、 掌握目标

1、在华为 USG 上 PPPOE 服务器的配置

2、在华为 USG 上 PPPOE 客户端的配置(工作上常用)

3、配置 NAT(上网使用)

4、默认路由+策略配置

二、 拓扑

三、 配置过程

1、在华为 USG 上 PPPOE 服务器的配置

(1)用户配置与地址池

[PPPOE-server]aaa

[PPPOE-server-aaa]local-user test password cipher test

[PPPOE-server-aaa]local-user test service-type ppp

[PPPOE-server-aaa]ip pool 1 123.1.1.2 123.1.1.254

(2)虚拟模板接口

[PPPOE-server]interface g0/0/0

[PPPOE-server-GigabitEthernet0/0/0]ip address 123.1.1.1 24

[PPPOE-server]interface Virtual-Template 1

[PPPOE-server-Virtual-Template1]ppp authentication-mode chap

[PPPOE-server-Virtual-Template1]ip address unnumbered interface g0/0/0

[PPPOE-server-Virtual-Template1]remote address pool 1

[PPPOE-server]interface g0/0/0

[PPPOE-server-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1

说明:G0/0/0 接口已经加入对应的 Zone 了,否则需要加入后才能正常工作。

2、在华为 USG 上 PPPOE 客户端的配置(工作上常用)

(1)拨号规则定义

[PPPOE-Client]dialer-rule 1 ip permit

(2)拨号接口配置

[PPPOE-Client]interface Dialer 1

[PPPOE-Client-Dialer1]dialer user test(用该帐号拨号)

[PPPOE-Client-Dialer1]dialer-group 1 (对应规则 1)

[PPPOE-Client-Dialer1]dialer bundle 1(后续 bundle 调用在接口)

[PPPOE-Client-Dialer1]ip address ppp-negotiate

[PPPOE-Client-Dialer1]ppp chap user test

[PPPOE-Client-Dialer1]ppp chap password cipher test

(3)物理接口调用

[PPPOE-Client]interface GigabitEthernet 0/0/0

[PPPOE-Client-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1

(4)注意事项

有的版本需要把拨号接口加入到对应的 zone,有的版本则不需要,所以如果看到拨号

一直没有成功,可以把拨号接口加入

到 Zone。

[PPPOE-Client]firewall zone untrust

[PPPOE-Client-zone-untrust]add interface Dialer 1

3、配置 NAT(上网使用)

[PPPOE-Client]nat-policy interzone trust untrust outbound

[PPPOE-Client-nat-policy-interzone-trust-untrust-outbound]policy 0

[PPPOE-Client-nat-policy-interzone-trust-untrust-outbound-0]policy

192.168.1.0 mask 24

source

[PPPOE-Client-nat-policy-interzone-trust-untrust-outbound-0]action source-nat

[PPPOE-Client-nat-policy-interzone-trust-untrust-outbound-0]easy-ip Dialer 1

说明:这里 NAT 规定了从 192.168.1.0/24 网段来的流量进行源 NAT 转换,使用的是

拨号接口的公网地址。

4、默认路由+策略配置

默认路由是为了访问 internet 用的,如果内网跨网段了,也需要写回程路由,而策略的

话,对于型号不一样,默认策略也不

一样,有的是全部允许放行了,有得没有默认策略,都是 deny 的,需要自己放行。

[PPPOE-Client]ip route-static 0.0.0.0 0 Dialer 1

[PPPOE-Client]policy interzone trust untrust outbound

[PPPOE-Client-policy-interzone-trust-untrust-outbound]policy 0

[PPPOE-Client-policy-interzone-trust-untrust-outbound-0]action permit

说明:这里是允许了全部的内网网段能主动访问外网。