2021年5月28日 星期五

Setup PPPoE with nmcli

以前都是用 rp-pppoe 套件裡的 adsl-setup 來設定 PPPoE
現在比較新的 Linux 已經沒有這個套件了,要用 NetworkManager 的 nmcli 來設定
設定也很簡單,準備帳號、密碼及網路卡就行了
以下範例帳號是 xxxx@hinet.net
密碼 xxxx1234
網路卡是用 eth1
連線名稱 hinet

nmcli connection add con-name hinet type pppoe ifname eth1 username xxxx@hinet.net password xxx1234
設完就馬上連上了

某些情況可能需要調 metric,metric 較小是優先權比較大
nmcli connection modify hinet ipv4.route-metric 90

手動啟動
nmcli connection up hinet

設定開機啟動 yes or no (connection add 預設是 yes)
nmcli connection modify hinet connection.autoconnect yes
nmcli connection modify hinet connection.autoconnect no

若設定完後沒有連上,手動啟動出現: 錯誤:啟動連線失敗:無法啟動 PPP 服務
表示沒有安裝 NetworkManager-ppp 套件

沒有留言:

Linux PPPoE NAT MTU and MSS

Linux 在 PPPoE 環境下 NAT,下面的 Client 可能會有部份網站連不上, 已知 LINE 的網站 ( https://line.me ) 及 LINE 服務就有這個狀況 這個問題是因為 Client 的 MTU 1500 大於 Linux NAT WAN 端的 ...