Score:0

One interface take all the IP addresses and the other one use none

cn flag

I built my first custom kernel and have a few problem with it (see this other post).

I configured with /etc/network/interfaces one ip address on each physical interface of the computer. The commande ip a show the IP addresses on each interfaces.

debian@debian:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 64:70:02:11:67:a4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.1/24 brd 192.168.5.255 scope global enp7s0
       valid_lft forever preferred_lft forever
    inet6 fe80::6670:2ff:fe11:67a4/64 scope link
       valid_lft forever preferred_lft forever
3: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 00:1c:c0:94:71:d1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.2/24 brd 192.168.5.255 scope global enp0s25
       valid_lft forever preferred_lft forever
    inet6 fe80::21c:c0ff:fe94:71d1/64 scope link
       valid_lft forever preferred_lft forever
debian@debian:~$
debian@debian:~$ 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

# The primary network interface
allow-hotplug enp7s0
#iface enp7s0 inet dhcp
iface enp7s0 inet static
address 192.168.5.1/24


allow-hotplug enp0s25
#iface enp0s25 inet dhcp
iface enp0s25 inet static
address 192.168.5.2/24


debian@debian:~$

enp0s25 = intel interface enp7s0 = realtek interface

The problem is the following :

  • When I connect an ethernet cable to the intel interface (driver e1000e), i can ping both ip addresses (even if the other interface is down).

  • When I connect an ethernet cable to the realtek tp-link interface (driver r8169), i can't ping any of the ip addresses (including the IP associated to it). The interface goes up when a cable is connected to it.

I searched a bit and I can't find a similar problem to mine. Do you know why there is a difference between what linux is prompting and what really happen with the interfaces ?

Edit : The problem is not related to the custom kernel, it also appear in the default Debian 4.19 kernel version. But they were working like a charm with a with a PfSense.

Edit 2 : The current route table (can change after the networking service is restarted and the realtek interface is upped before the intel interface).

debian@debian:~$ ip route
192.168.5.0/24 dev enp0s25 proto kernel scope link src 192.168.5.2
192.168.5.0/24 dev enp7s0 proto kernel scope link src 192.168.5.1
debian@debian:~$
np flag
Does it works normally with default Debian kernel?
Nikita Kipriyanov avatar
za flag
So, why there is no contents of `interfaces` file and, perhaps, `ip addr` output in the post?
cn flag
I edited the post to answer your questions.
A.B avatar
cl flag
A.B
related to [weak host model](https://en.wikipedia.org/wiki/Host_model) and requiring policy routing when using multiple NICs with IP addresses in the same IP LAN. ARP is probably involved too.
cn flag
@A.B Weak host model seems to accept traffic destinated to both interface on both interfaces. Can it accept it only one of the interfaces (like in my case) ? Can computer change a host model between the OS you implement ?
A.B avatar
cl flag
A.B
I'm confused by a detail: enp0s25 = Intel. Is that the second interface? Because then "even if the second interface is down" doesn't make sense (and how should I interpret it? administratively set down or something else?). Can you edit your question and clarify which interface is Tp-Link which interface is Intel and which is first interface which is second interface? Can you verify your observations? They could have changed meanwhile, but as long as everything is coherent I'd have an explanation available.
A.B avatar
cl flag
A.B
Also can you add the output of this command? `ip route`.
cn flag
@A.B I understand my case scenario. As you said, the routing table play a major role in the problem I have. Linux send a traffic response through the first interface of the routing table matching the destination. Coupled with the weak host model, the computer recieve traffic on both interfaces but send a response to only one (depending on the route table).
Nikita Kipriyanov avatar
za flag
You put two different NICs into the same LAN. Yes, Linux uses weak host model and it is wrong setup in that model. Why you did that, what you tried to achieve? (In anticipation of the answer, redundancy is achieved *differently*.)
A.B avatar
cl flag
A.B
Yes, except only one interface receives traffic from a given peer too, not even always the same as the one for the reply (ARP flux...). Beside this same question as Nikita Kipriyanov: what's the goal? (mind https://xyproblem.info/ )
cn flag
I will use the PRP module enabled during the kernel compilation. The protocole will handle the interfaces as both in the same network. Putting the interfaces in the same network myself was a mistake, as the service wasn't enabled to properly avoid this problem.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.