0

I am new to linux routing. I have an architecture similar to this . I realize this network architecture is fundamentally flawed however I am not permitted to change the architecture. I did some research and believe I need to create routing tables for each of the nics. However, everything I have read in regards to linux routing tables shows assigning different subnets to each nics routing table.

2 questions

1) Am I approaching this problem the right way with routing tables?

2) Is it possible to add individual IP addresses to routing tables?

  • 1
    It's hard to help if we don't know WHY this design was implemented. Saying that I would consider BRIDGING both ethernet interfaces and assigning both IP addresses to the bridge interface itself. – Tomek Jan 29 '20 at 19:12

1 Answers1

0

This network really needs to be sorted out and renumbered into different networks. There are no "nice" solutions to this problem as the entire design of IPV4 is broken.

You can add individual IP addresses to directly connected routing tables with commands (assuming VLANA connects to eth0 and VLANB to eth1) like

 ip route add 192.168.0.10 dev eth0
 ip route add 192.168.0.71 dev eth1

Note that this assumes your system is acting only as a client, and the IPs you are reaching in each system are unique. If you are running a server you need to take an entirely different approach which involves multiple routing tables rather then multiple routes in the default table. You would then select the routing table based on the interface the packets are coming in on. This is a lot harder - let me know if it needs to be added to the answer (or google policy based routing). You should not be running a server in this environment as it is fundimentally broken!

davidgo
  • 6,222
  • 3
  • 23
  • 41