Debian 9.6不使用接口中定义的静态IP


0

我有以下配置:

root@pihole:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

allow-hotplug enp0s4
iface enp0s4 inet static
address 192.168.2.225
netmask 255.255.255.0
gateway 192.168.2.1

当它应该是.225时,IP以某种方式分配给192.168.2.110:

root@pihole:~# systemctl restart networking.service
root@pihole:~# ifconfig
enp0s4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.110  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::2a0:98ff:fe2a:67fe  prefixlen 64  scopeid 0x20<link>
        ether 00:a0:98:2a:67:0e  txqueuelen 1000  (Ethernet)
        RX packets 5322438  bytes 1348940213 (1.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 333698  bytes 66021804 (62.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

有什么建议为什么会这样?这个配置正在运行......然后几天后它改为.110。

编辑:添加'ip a'命令的输出,因为这表明IP被设置为'secondary':

2: enp0s4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:a0:98:2a:67:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.110/24 brd 192.168.2.255 scope global enp0s4
       valid_lft forever preferred_lft forever
    inet 192.168.2.225/24 brd 192.168.2.255 scope global secondary enp0s4
       valid_lft forever preferred_lft forever
    inet6 fe80::2a0:98ff:fe2a:670e/64 scope link
       valid_lft forever preferred_lft forever

什么是状态ifup@enp0s4.servicesystemd-networkd.service
grawity

我不确定你是什么意思?它在ifconfig中显示“up”。
Ted Scheckler

我还添加了“ip a”的输出,显示.225 IP作为次要...我不知道这意味着什么
Ted Scheckler
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.