板子上面一共有五个网口,我要实现网口的配置功能,前台页面会把配置以json形式传送到后台,
我后台拿到json串后就会去配置网络.
现在我发现,我在/etc/network/interfaces里面写的配置只在启动时有效,
我更改/etc/network/interfaces里面eth0的IP地址.并重启网络服务/etc/init.d/networking restart.期望eth0的IP会变为我更改的IP.
但是结果它没有变,还是原来系统启动时读取/etc/network/interfaces时eth0的IP地址,也就是说.我更改ip并重启网络服务时,它并没有去读修改过的/etc/network/interfaces
有没有人碰到过这种情况?谢谢.
/etc/network/interfaces文件:
代码: 全选
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d
#source /etc/network/interfaces.d/*.cfg
auto eth0
iface eth0 inet static
address 192.168.0.232
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
allow-hotplug eth1
iface eth1 inet static
address 192.168.1.91
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
allow-hotplug eth2
iface eth2 inet static
address 192.168.2.91
network 192.168.2.0
netmask 255.255.255.0
broadcast 192.168.2.255
gateway 192.168.2.1
allow-hotplug eth3
iface eth3 inet static
address 192.168.3.91
network 192.168.3.0
netmask 255.255.255.0
broadcast 192.168.3.255
gateway 192.168.3.1
allow-hotplug eth4
iface eth4 inet static
address 192.168.4.91
network 192.168.4.0
netmask 255.255.255.0
broadcast 192.168.4.255
gateway 192.168.4.1