电话:010-62220424

传真:010-62220448

邮箱:sunny@lethbr.com

怎么样设置PPPoE server ?

怎么样设置PPPoE server

设置PPPoE server

建立PPPoE server的最低配置为:

1)定义地址池

2)定义接口侦听

3)选择认证模式(本地用户或RADIUS

4)如果选择本地认证模式,定义用户名/密码


设置步骤:

定义地址池:

ubnt@rtr1:~$ configure

 

ubnt@rtr1# edit service pppoe-server

 

ubnt@rtr1# set client-ip-pool start 100.0.0.10

 

ubnt@rtr1# set client-ip-pool stop 100.0.0.100

定义接口侦听:

ubnt@rtr1# set interface eth0

 

选择认证模式:

ubnt@rtr1# set authentication mode local

 

 

如果选择本地认证模式,定义用户名/密码:

ubnt@rtr1# set authentication local-users username bob password secret

                                                     

ubnt@rtr1# set authentication local-users username joe password secret2

 

ubnt@rtr1# commit

 

Starting pppoe-server: pppoe-server.

                                                                               

 

ubnt@rtr1# top

 

 

ubnt@rtr1# show service pppoe-server

 authentication {

     local-users {

         username bob {

             password secret

         }

         username joe {

             password secret2

         }

     }

     mode local

 }

 client-ip-pool {

     start 100.0.0.10

     stop 100.0.0.100

 }

 interface eth0

 

ubnt@rtr1# save

Saving configuration to '/config/config.boot'...

Done

 

ubnt@rtr1# exit

Exit

或者可以选择添加DNS服务器:

ubnt@rtr1:~$ configure

 

ubnt@rtr1# set service pppoe-server dns-servers server-1 8.8.8.8

 

ubnt@rtr1# commit

 

Restarting pppoe-server: pppoe-server.

 

ubnt@rtr1# save ; exit

Saving configuration to '/config/config.boot'...

Done

exit

ubnt@rtr1:~$

查看是否有连接的PPPoE客户端:

ubnt@rtr1:~$ show pppoe-server

Active PPPoE server sessions:

 

User       Time      Iface    Remote IP       TX pkt/byte   RX pkt/byte

---------- --------- -------- --------------- ------ ------ ------ ------      

joe        00h35m02s pppoes0  100.0.0.11         178  14.1K    178  13.3K

bob        00h00m19s pppoes1  100.0.0.12          28   2.3K     29   1.9K

 

 

踢掉用户"joe":

ubnt@rtr1:~$ clear pppoe-server user joe

ubnt@rtr1:~$ show pppoe-server

Active PPPoE server sessions:

 

User       Time      Iface    Remote IP       TX pkt/byte   RX pkt/byte

---------- --------- -------- --------------- ------ ------ ------ ------

bob        00h01m02s pppoes1  100.0.0.12          29   2.4K     30   2.0K

配置PPPoE客户端

在另一台路由器,我们将配置PPPoE客户端。对于客户端,最低配置出口的用户名和密码。例如:

ubnt@rtr2:~$ configure

 

ubnt@rtr2# set interfaces ethernet eth1 pppoe 0 user-id joe

 

ubnt@rtr2# set interfaces ethernet eth1 pppoe 0 password secret2

 

ubnt@rtr2# commit

 

ubnt@rtr2# show interfaces ethernet eth1 pppoe

 pppoe 0 {

     password secret2

     user-id joe

 }

ubnt@rtr2# save ; exit

Saving configuration to '/config/config.boot'...

Done

 

ubnt@rtr2# exit

Exit

为了验证,我们有一个连接,我们会做“show interfaces”:

ubnt@rtr2:~$ show interfaces

Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down

Interface    IP Address                        S/L  Description

---------    ----------                        ---  -----------

eth0         -                                 u/D

eth1         -                                 u/u

eth2         -                                 u/D

lo           127.0.0.1/8                       u/u

             ::1/128

pppoe0       100.0.0.10                        u/u

我们可以看到pppoe0被分配100.0.0.10

如果你想从PPPoE服务器断开连接:

ubnt@rtr2:~$ disconnect interface pppoe0

Bringing interface pppoe0 down...

重新连接:

ubnt@rtr2:~$ connect interface pppoe0

Bringing interface pppoe0 up...

ubnt@rtr2:~$

电话:010-62220424

传真:010-62220448

邮箱:sales@lethbr.com

服务时间:9:00—18:00

地址:北京市海淀区中关村南大街9号理工科技大厦903

微信公众号