如何在Alpine Linux上设置静态IP?

内容纲要

如何在Alpine Linux上设置静态IP?

alpine和其他的常用linux系统配置网络是不一样的,具体如下

vi /etc/network/interfaces

file

默认是dhcp,我们需要修改为static,address是ip地址,netmask子网掩码,gateway网关地址

auto eth0
iface eth0 inet static
address 192.168.0.188
netmask 255.255.255.0
gateway 192.168.0.1

file

重启网络服务

/etc/init.d/networking restart

file

标签

发表评论