Openmediavault 基于Debian Linux 所以 和 Debian 方法是一样的
chmod 777 /etc/network/interfaces
ifconfig命令如果无效或找不到 输入以下命令,再尝试
sudo apt install net-tools
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.4.11 netmask 255.255.255.0 broadcast 192.168.4.255 inet6 fe80::2e0:4cff:fe44:11 prefixlen 64 scopeid 0x20<link> ether 00:e0:4c:44:00:11 txqueuelen 1000 (Ethernet) RX packets 81722 bytes 13731156 (13.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 102165 bytes 43986352 (41.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
/etc/network
interfaces文件目录 修改自动获取
auto enp2s0 iface enp2s0 inet dhcp
固定地址
auto enp2s0 iface enp2s0 inet static address 192.168.4.11 netmask 255.255.255.0 gateway 192.168.4.1 dns-nameservers 8.8.8.8 source-directory /etc/network/interfaces.d
参考链接 https://www.cnblogs.com/zhouhbing/p/4300733.html