Arch Linux网络配置、Arch Linux自动获取IP、Arch Linux拨号上网

一、局域网主机开机自动获取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

 

发布了46 篇原创文章 · 获赞 20 · 访问量 29万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章