0

I have something I do not understand and is not working for me. So I hope that someone here can help me with this.

The situation is that I have one server with to network interfaces each in their own separated physical network.

Now I have configured one network interface, say en1, with the IP 10.0.0.11/24 and the other with IP 10.0.0.12/24. (Please don't ask why they are in the same network, that is a whole different question and belief me, it is needed.)

The yaml config is the following:

network:
  ethernets:
    en1:
      dhcp4: false
      addresses: [10.0.0.11/24]
      routes:
        - to: 0.0.0.0/0
          via: 10.0.0.254
      nameservers:
        addresses: [10.0.0.251]
    en2:
      dhcp4: false
      addresses: [10.0.0.12/24]
  version: 2

Now the weird thing that I do not understand, is that the IP 10.0.0.12 is available via the en1 network. So if I ping the 10.0.0.12 address from a computer connected to the en1 network, it responds, even though the en2 is physically not connected to the same network.

This is a problem, because the 10.0.0.12 address is also used on the en1 network and therefore this causes a conflict in the network. (And no, I am afraid I cannot just use another IP address.)

So how do I separate these networks en1 and en2? What am I missing here?

arnby
  • 1
  • 1
  • What is the physical network device these two NICs are plugged into? Is it a switch or a hub? – Rowshi Jul 29 '22 at 16:50
  • 1
    Look at policy based routing, you should be able to bind responses to the interface they arrived on which will help. – hardillb Jul 29 '22 at 16:51
  • One is connected to a switch, the other is currently directly connected to another server. I wil take a look at policy based routing to see if I can bind the responses. That sounds like a good option. – arnby Jul 29 '22 at 17:45
  • It seems I could also really use some help with building this policy bases routing. I can find how to build a rule for an IP as a source, but I don't know understand how to set a device as a source and destination. – arnby Jul 31 '22 at 08:27
  • Your problem is that the server has no way of knowing what interface to send a packet out of for packets destined to the local networks. Even if you could route one set of IP addresses out one interface and a different set out the other, what happens when two devices have the same IP on two different networks? What you’re asking for is not technically possible. Like it or not, you MUST change your IP and subnetting strategy. – Appleoddity Aug 02 '22 at 06:54

0 Answers0