我正在嘗試從我的 CentOS 7.7 最小版到我的 ISP 數據機(ISP:Unifi,馬來西亞)撥打 PPPoE 連線。
首先,我在介面頂部建立了一個 vlan(id:500)標記的 ifcfg 文件,即 eno1.500,如下所示:
IPV6INIT="yes"
DNS2="1.1.1.1"
DNS1="8.8.8.8"
IPV6_AUTOCONF="yes"
BOOTPROTO="dhcp"
ONBOOT="yes"
UUID="Same as default ifcfg of eno1"
DEVICE="eno1.500"
VLAN="yes"
然後,我使用 rp-pppoe 來處理 PPPoE 設置,並使用正確的 PPPoE 使用者名稱和密碼指向我的 vlan 標記介面 (eno1.500)。
當我發現我的 PPPoE 連線只持續了大約幾秒鐘時,結果很奇怪。日誌如下:
Remote Message: Authentication success,Welcome!
PAP authentication succeeded
local IP address xxx
remote IP address: xxx
recv (receivePacket): Network is down
recv (receivePacket): Network is down
Modem hangup
Connect time 0.7 minutes.
Connection terminated.
然後遞迴:
Remote Message: Authentication success,Welcome!
PAP authentication failed.
Modem hangup
Connection terminated.
有時PAP會再次成功連接,但稍後會失敗。
答案1
我決定使用 ip 指令新增 vlan 介面(vlan id:500):
$ ip link add link eno1 name eno1.500 type vlan id 500
為了在每次重新啟動時保留該設置,我在 下添加了命令/etc/rc.local
。
然後,pppoe-setup 並指向標記的介面 eno1.500
可能不那麼乾淨,但現在對我有用。