最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Arch linux操作系统之网络应用实例
时间:2015-05-09 编辑:简简单单 来源:一聚教程网
介绍一下如果进行网络配置。
[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
配置动态网络:
[root@Arch ~]# systemctl enable dhcpcd@eno16777736.service
配置静态网络:
[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
相关文章
- Linux 编程之进程fork()详解及实例 07-31
- Linux中fork的执行的实例详解 07-07
- 实例讲解Linux系统中硬链接与软链接的创建 12-16
- Linux基础之部分命令使用实例 11-08
- 浅析linux中epoll入门实例 04-23
- linux下awk命令语法及使用实例教程 11-25