一、局域網主機開機自動獲取IP地址
安裝好base base-devel後,默認開機是獲取不了IP地址,需要啓動dhcpcd服務
輸入如下命令可開機自動獲取IP地址:
sudo systemctl enable dhcpcd
二、RP-PPPoE 撥號上網
1、安裝撥號軟件包
sudo pacman -Sy ppp rp-pppoe
2、配置撥號賬號
[root@Arch-PC ~]# pppoe-setup
>>> Enter your pppoe user name :test # 撥號賬戶
>>> Enter eth ethernet interface connected to the DSL modem (default eth0) :eth0 # 撥號網卡,可用:ip link 查看
>>> 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
3、pppoe client 配置文件
/etc/ppp/pppoe.conf # 撥號配置文件
/etc/ppp/pap-secrets # 撥號賬號跟密碼保存位置
4、開始撥號上網
sudo pppoe-start
5、取消撥號上網
sudo pppoe-stop
6、開機自動撥號
sudo systemctl enable adsl
三、Netctl 撥號上網(Arch Linux自帶)
詳細請參數官方文檔:https://wiki.archlinux.org/index.php/Netctl_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
1、從實例中複製 pppoe 作爲 adsl 撥號的配置
sudo cp /etc/netctl/examples/pppoe /etc/netctl/adsl # 文件名隨意,後邊需要這個文件名作爲參數
2、只需修改這兩行中的用戶名和密碼
/etc/netctl/adsl
USER='[email protected]'
PASSWORD='very secret'
3、啓用配置文件
sudo netctl enable adsl # adsl就是步驟1中的文件名,以下相同
4、創建開機systemd啓動服務
sudo netctl reenable adsl
5、開機啓動撥號服務
sudo systemctl enable [email protected]
5、列出可以連接的網絡
sudo netctl list
6、嘗試撥號
sudo netctl start adsl
7、取消撥號
sudo netctl stop adsl