cd /etc/netctl/
vim enp0s8
Description='enp0s25'
Interface=enp0s25
Connection=ethernet
IP=static
Address=('192.168.123.6/24')
#Routes=('192.168.123.0/24 via 192.168.123.1')
Gateway='192.168.123.1'
DNS=('192.168.123.1')
摘自:
https://blog.csdn.net/sgzqc/article/details/46627817
需要注意,如果有不同的网关,需要根据具体的网关来修改配置。
如网关为192.168.12.1的时候,需要做对应修改。
Description='enp0s8'
Interface=enp0s8
Connection=ethernet
IP=static
Address=('192.168.15.228/24')
Gateway='192.168.12.1'
DNS=('192.168.12.1')
再比如,如果局域网内的网关不安常理出牌。也是一样。
比如网关为116.123.55.1,DNS是116.123.66.1
那么还是做对应的修改。注意,Address里的最后一个ip。是你自己设定的。
Description='enp0s8'
Interface=enp0s8
Connection=ethernet
IP=static
Address=('116.123.55.88/24')
Gateway='116.123.55.1'
DNS=('116.123.66.1')
导入备份的虚拟主机后,这里一定要记得打勾。
![](https://i-blog.csdnimg.cn/blog_migrate/adfe58074cfd4466989d4e5d5822132a.png)