上一篇文章介绍了archlinux的系统安装:http://note.t4x.org/basic/arch-linux-installing/,此次介绍一下如果进行网络配置。
0 1 2 3 4 5 6 7 8 9 10 11 |
[root@Arch ~]# ls /sys/class/net/ #查看有哪些可用网络 eno16777736 lo [root@Arch ~]# ip addr add 1.1.1.21/24 dev eno16777736 #给接口eno16777736配置ip为1.1.1.21 子网掩码位255.255.255.0 [root@Arch ~]# ip link set eno16777736 up #启动网卡,不然无法启动相关路由 [root@Arch ~]# ip route add default via 1.1.1.2 #设置默认路由、网关 [root@Arch ~]# pacman -S openssh #安装ssh,不然无法使用xshell等工具进行远程链接。 [root@Arch ~]# systemctl start sshd #启动sshd服务,不是ssh哦! [root@Arch ~]# systemctl enable sshd Created symlink from /etc/systemd/system/multi-user.target.wants/sshd.service to /usr/lib/systemd/system/sshd.service. [root@Arch ~]# systemctl | grep sshd sshd.service loaded active running OpenSSH Daemon #sshd服务运行中 sshdgenkeys.service loaded active exited SSH Key Generation |
配置动态网络:
0 |
[root@Arch ~]# systemctl enable dhcpcd@eno16777736.service |
配置静态网络:
0 1 2 3 4 5 6 7 8 9 10 11 |
[root@Arch /]# cd /etc/netctl/ [root@Arch netctl]# cp examples/ethernet-static eno16777736 [root@Arch netctl]# egrep -v "#" eno16777736 Description='A basic static ethernet connection' Interface=eno16777736 Connection=ethernet IP=static Address=('1.1.1.21/24') Gateway='1.1.1.2' DNS=('114.114.114.114') [root@Arch netctl]# netctl enable eno16777736 Created symlink from /etc/systemd/system/multi-user.target.wants/netctl\@eno16777736.service to /usr/lib/systemd/system |
THE END SourceByrd's Weblog-https://note.t4x.org/basic/arch-linux-network/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!