用户名:  密码:   
您当前的位置:首页 > 电脑与网络 >  交换机,路由,AC > 

华为AR161路由配置内网IP及PPP拔号

上次修改时间: 2021-01-06 14:52:29      来源:网络总结      作者:钢铁长陈
上一页      路径:DSD\Learn\路由与交换机\关于配置方面问题\      下一页

PPP拔号命令行配置

https://forum.huawei.com/enterprise/zh/thread-407737.html
一、WAN侧配置

1. 配置PPPoE拨号接口
<AR> system-view                                                          //先从用户视图切换到系统视图再进行配置
[AR] interface dialer 1                                                   //创建并进入Dialer接口
[AR-Dialer1] dialer user abc                                              //启动共享DCC功能
[AR-Dialer1] dialer bundle 1           //
[AR-Dialer1] dialer number 1 autodial                                     //配置拨号失败时将dialer接口状态转换为Down

说明:因为电信服务器可能使用CHAP或PAP两种不同认证方式,下面同时配置CHAP和PAP两种认证方式的用户名和密码
[AR-Dialer1] ppp chap user bnnz1847565                                   //配置CHAP认证方式的用户名
[AR-Dialer1] ppp chap password cipher 11111111                           //配置CHAP认证方式的密码
[AR-Dialer1] ppp pap local-user bnnz1847565 password cipher 11111111     //配置PAP认证方式的用户名和密码

[AR-Dialer1] tcp adjust-mss 1200                                          //配置接口的TCP最大报文段长度为1200字节
[AR-Dialer1] ip address ppp-negotiate
[AR-Dialer1] ppp ipcp dns admit-any
[AR-Dialer1] quit

//
[AR] interface gigabitethernet 0/0/4                                       //进入WAN口(GE1)建立PPPoE会话
[AR-GigabitEthernet0/0/4] pppoe-client dial-bundle-number 1                //dial-bundle-number编号需要和dialer bundle编号一致
  注:可以用undo pppoe-client dial-bundle-number 1来删除绑定
[AR-GigabitEthernet0/0/4] quit
 

2. 配置默认路由
[AR] ip route-static 0.0.0.0 0.0.0.0 dialer 1

 
3. 配置NAT功能
[AR] acl number 3000         //新建编号为3000的acl规则 
[AR-acl-adv-3000] rule permit ip      //允许所有IP包通过
[AR-acl-adv-3000] quit
[AR] interface dialer 1         //进入dialer1接口
[AR-Dialer1] nat outbound 3000       //将前面新的规则绑定到拔号的接口
[AR-Dialer1] quit


二、LAN侧配置
配置接口IP和DHCP服务器(为PC分配IP)
说明:LAN口是二层接口不能直接配置IP,由于它默认属于VLAN 1,需要为其创建VLANIF1接口再配置IP。
[AR] dhcp enable                                                             //打开DHCP总开关
[AR] interface vlanif 1                                                      //创建VLANIF1接口,并配置IP和子网掩码
[AR-Vlanif1] ip address 192.168.1.1 255.255.255.0       //
[AR-Vlanif1] dhcp select interface                                           //启用接口地址池方式的DHCP服务器功能
[AR-Vlanif1] dhcp server dns-list 114.114.114.114                            //配置DNS服务器为公共的DNS(114.114.114.114)
[AR-Vlanif1] return

 
配置成功后显示配置如下
===============================================================================
[gaoxin]interface dialer 1
[gaoxin-Dialer1]dis this
[V200R010C10SPC700]
#
interface Dialer1
 link-protocol ppp
 ppp chap user bnnz1847565
 ppp chap password cipher %^%#{4+]5VWNkR2Sn\QjYC!Q$XEz5)uaP;@D~TXNi(KV%^%#
 ppp pap local-user bnnz1847565 password cipher %^%#/^bwUB=B;'GXX,D$'c{@%A}h40r+W#eG<g0X9#U&%^%#
 ppp ipcp dns admit-any
 ppp ipcp dns request
 tcp adjust-mss 1200
 ip address ppp-negotiate
 dialer user arweb
 dialer bundle 1
 dialer-group 1
 nat static protocol tcp global current-interface 9877 inside 192.168.8.200 3389 netmask 255.255.255.255
 nat static protocol tcp global current-interface ftp inside 192.168.8.200 ftp netmask 255.255.255.255
 nat static protocol tcp global current-interface 8088 inside 192.168.8.200 www netmask 255.255.255.255
 nat static protocol tcp global current-interface 1723 inside 192.168.8.200 1723 netmask 255.255.255.255
 nat static protocol tcp global current-interface 8001 inside 192.168.8.230 8000 netmask 255.255.255.255
 nat static protocol tcp global current-interface 8002 inside 192.168.8.240 8000 netmask 255.255.255.255
 nat outbound 2999
 ddns apply policy 2078cz7094.51mypc.cn
#
return