Zend certified PHP/Magento developer

Debian 9 assigning WAN IP to local interface configured for LAN static IP assignment

I recently upgraded my homelab with some 10Gbe equipment, and everything is going swimmingly with the exception of my 10G interface on my primary server (Debian 9). Both eno1 (my backup LOM interface) and the 10G interface (ens4f0) are assigned to static IPs on the same subnet (with different metrics to prioritize the 10G NIC). At start up everything is great – the interfaces get their static IPs, routes are all good, everything is gravy.

However, when I ssh from my Windows workstation to the server, the IP address on my 10G interface (ens4f0) is immediately updated to be that of my WAN IP. I can’t for the life of me figure out what is causing this.

When I checked the system logs, the only thing I found that referenced the WAN IP was the avahi-daemon. I’ve never seen this assign IPs to an interface, but I mostly use /etc/hosts and direct IP access within my home so disabled avahi to see if that would resolve the issues. It did not help. The next time I ssh’ed into my server, the IP changed to my WAN IP again. On reboot, the IPs are assigned correctly to match my config files, but when I ssh into the server the ens4f0 IP is changed to my WAN IP.

Sample logs before I disabled the avahi service:

daemon.log:Aug  7 15:30:11 server systemd[1]: Started Session 34 of user XXX.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: Withdrawing address record for 192.168.0.75 on ens4f0.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: Leaving mDNS multicast group on interface ens4f0.IPv4 with address 192.168.0.75.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: Interface ens4f0.IPv4 no longer relevant for mDNS.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: Joining mDNS multicast group on interface ens4f0.IPv4 with address 162.206.xxx.xxx.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: New relevant interface ens4f0.IPv4 for mDNS.
daemon.log:Aug  7 15:30:11 server avahi-daemon[854]: Registering new address record for 162.206.xxx.xxx on ens4f0.IPv4.
root@server:~# ip a list ens4f0
3: ens4f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0f:53:0e:31:78 brd ff:ff:ff:ff:ff:ff
    inet 162.206.xxx.xxx/16 brd 162.206.255.255 scope global ens4f0
       valid_lft forever preferred_lft forever
    inet6 fe80::20f:53ff:fe0e:3178/64 scope link
       valid_lft forever preferred_lft forever

Since disabling avahi-daemon, I no longer see any thing in /var/log/* referencing the IP change, but the IP change does still happen. Any suggestions on where else to look?

Note: I can recreate this at any time:

  1. Bring up ens4f0 on server using static IP config. All is good
  2. ssh to server (targeting any interface; i.e. eno1 [192.168.0.74] or ens4f0 [192.168.0.75]). Attempting to ssh to ens4f0 actually terminates the session as soon as my connection is accepted.
  3. IP address on ens4f0 is now my WAN IP.

Environment:

  • Dedicated PFSense box as my router & primary gateway
    • WAN : 162.206.xxx.xxx
    • LAN : 192.168.0.1
  • HP Z420 with SolarFlare 10Gbe SFP+ card (server); Debian 9
    • LOM : 192.168.0.74/24 metric 100
    • 10G : 192.168.0.75/24 metric 0

General config details & examples.

root@server:~#cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
root@server:~# cat /etc/network/interfaces.d/eno1
auto eno1
iface eno1 inet static
        address 192.168.0.74/24
        gateway 192.168.0.1
        metric 100
root@server:~# cat /etc/network/interfaces.d/ens4f0
auto ens4f0
iface ens4f0 inet static
        address 192.168.0.75/24
        gateway 192.168.0.1
        metric 0
root@server:~# ip a list ens4f0
3: ens4f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:0f:53:0e:31:78 brd ff:ff:ff:ff:ff:ff

root@server:~# ifup -v ens4f0
ifup: parsing file /etc/network/interfaces.d/eno1
ifup: parsing file /etc/network/interfaces.d/ens4f0

ifup: configuring interface ens4f0=ens4f0 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 192.168.0.75/255.255.255.0 broadcast 192.168.0.255       dev ens4f0 label ens4f0
/bin/ip link set dev ens4f0   up
/bin/ip route add default via 192.168.0.1 metric 0 dev ens4f0 onlink
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-autoipd
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/ethtool
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant

root@server:~# ip a list ens4f0
3: ens4f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0f:53:0e:31:78 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.75/24 brd 192.168.0.255 scope global ens4f0
       valid_lft forever preferred_lft forever
    inet6 fe80::20f:53ff:fe0e:3178/64 scope link
       valid_lft forever preferred_lft forever

Things that I’ve done to this point (and where I still stand now):

  1. Removed DHCP from all interfaces and changed over to static assignment.
  2. Disabled network-manager.
  3. Removed the avahi-daemon service (I use /etc/hosts or raw IP for the most part, so not strictly needed)

2 things are escaping me:

  1. Why is my interface IP changing when I ssh in?
  2. Why is it being assigned to my WAN IP?

Appreciate any help, folks!