pppoe server的設定
對于PPPoE的配置,我們可以在很多平臺和設備上完成。那么今天我們講解的就是routerOS上架設pppoe server,archlinux當pppoe client,archlinux上有一塊網(wǎng)卡eth0。那么現(xiàn)在我們就來看看具體的操作步驟吧。
目的:
archlinux pppoe撥號到pppoe server
pppoe server 配置
service name : pppoe-service
local address : 192.168.88.210
remote address : 192.168.88.211-192.168.88.220
secret name : test
secret password : 123456
caller id :
ip-->dns-->settings
primary dns : 192.168.88.89
seconday dns : 202.100.64.68
步驟如下:
Quotation
注意:
/etc/rc.conf 里注意的兩點
pppoe和eth0原來的ip配置沒有關系的,但是pppoe和routes 配置有關系,如果想使用pppoe獲得的網(wǎng)關那么就修改為 ROUTES=(!gateway)
1、安裝好這兩個包,可以先 pacman -Q | grep ppp 命令查看下是否安裝
[root@myhost ~]# pacman -S ppp rp-pppoe
2、未配置pppoe前先查看下/etc/resolv.conf,建議先備份一下文件
[root@vkill ~]# ls -l /etc/resolv.conf
lrw-r--r-- 1 root root 20 Aug 9 10:09 /etc/resolv.conf
3、配置pppoe
[root@myhost ~]# pppoe-setup
>>>enter your pppoe user name :test
>>>enter eth ethernet interface connected to the DSL modem (default eth0) :eth0
>>>enter the demand value (default no) :no
>>>enter the DNS information here :server
>>>please enter your pppoe password :123456
>>>please re-enter your pppoe password :123456
>>>choose a type of firewall :2
>>>accept these settings and adjust configuration files (y/n) :y
4、修改pppoe client配置
[root@myhost ~]# vi /etc/ppp/pppoe.conf
#幾個需要注意的地方
defaultroute=yes
#servicename如果局域網(wǎng)內有多個pppoe server時這個就有用了,如果時連接電信adsl就留空
#具體參見http://blog.vkill.net/read.php?75
servicename=pppoe-service
5、開啟連接pppoe,連接成功
[root@myhost ~]# pppoe-start
. Connected!
6、再次查看下/etc/resolv.conf,可以看到已經(jīng)變?yōu)榉栠B接了,所以在使用pppoe前還是備份下/etc/resolv.conf比較好
[root@vkill ~]# ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 20 Aug 9 10:09 /etc/resolv.conf -> /etc/ppp/resolv.conf
[root@vkill ~]# ls -l /etc/ppp/resolv.conf
-rw-r--r-- 1 root root 50 Aug 9 10:10 /etc/ppp/resolv.conf
注意:
默認pppoe-start成功后/etc/resolv.conf權限是777,/etc/ppp/resolv.conf權限是644
如果發(fā)現(xiàn)普通用戶無法使用dns時有可能就是/etc/resolv.conf權限的問題,手動修改下權限即可
[root@myhost ~]# chmod 777 /etc/resolv.conf
[root@myhost ~]# chmod 644 /etc/ppp/resolv.conf
7、ifconfig查看,可以看到多了一個ppp0連接
[root@vkill ~]# ifconfig
......
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.88.219 P-t-P:192.168.88.210 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1488 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:308 (308.0 b) TX bytes:227 (227.0 b)
8、查看當前路由
[root@myhost ~]# route
destination gateway geenmask flags metric ref use iface
......
default * 0.0.0.0 U 0 0 0 ppp0
如未看到default ... ppp0這條,需要手動創(chuàng)建,命令如下
[root@myhost ~]# route add default dev ppp0
9、查看dns,可以看到都獲取到了
[root@myhost ~]# cat /etc/resolv.conf
nameserver 192.168.88.89
nameserver 202.100.64.68
10、設置開機自動撥號
[root@myhost ~]# vi /etc/rc.conf
#添加adsl到DAEMONS就可以了,@是后臺
DAEMONS=(syslog-ng network netfs crond sshd @adsl)
11、如果pppoe server綁定了mac地址,怎么連接?
試驗時pppoe server 修改一配置
secret name : test
secret password : 123456
caller id : 00:01:23:45:67:89
首先修改/etc/rc.conf
[root@vkill ~]# vi /etc/rc.conf
......
#修改為如下設置,照個人情況
eth0="eth0 hw ether 00:01:23:45:67:89"
eth1="eth0 192.168.88.100"
INTERFACES=(eth0 eth1)
修改完成后重啟網(wǎng)絡后連接就可以了
[root@vkill ~]# /etc/rc.d/network restart
[root@vkill ~]# /etc/rc.d/adsl restart
后記:
pppoe-start 命令等價于 /etc/rc.d/adsl restart
pppoe-stop 命令等價于 /etc/rc.d/adsl stop
pppoe的密碼保存在 CHAP密碼文件 /etc/ppp/chap-secrets 中,要是pppoe密碼變根了可以直接去這個文件修改