进入到网卡配置目录
cd /etc/netwrok/
vim interfaces
网卡配置信息
source /etc/network/interfaces.d/*.conf
auto lo
iface lo inet loopback
allow-hotplug eth0
auto eth2
allow-hotplug eth2
iface eth2 inet static
address 100.100.100.1
netmask 255.255.0.0
以上配置文件是一个完整的配置文件。添加IP地址,只需要添加以下的配置信息即可。
auto eth2
allow-hotplug eth2
iface eth2 inet static
address 100.100.100.1
netmask 255.255.0.0
添加完IP地址后,重启网卡
sudo service networking restart
本文介绍如何在Linux系统中配置静态IP地址。通过编辑配置文件/etc/network/interfaces并添加指定的网卡配置信息,可以为系统设置静态IP地址。完成配置后,重启网络服务使更改生效。
8592

被折叠的 条评论
为什么被折叠?



