Article 6HZAB Diifferent inbound and outbound nics / routes

Diifferent inbound and outbound nics / routes

by
14karat-lq
from LinuxQuestions.org on (#6HZAB)
I've been searching for a while and haven't found anything specific to what I'm seeing, so I'm hoping for a miracle here...

I have a CentOS 7.9 machine running multiple nics. For simplicity I'll only use 2 of them as an example.

There is one forward facing receive only (eth1.) The second is for outbound traffic only (eth0.)

My conundrum is when I receive from and send to the same outside address. If I specify a route for the address to the outbound nic, then that IP can't connect to the inbound nic.
I'll use an IP of say 6.7.8.9 trying to connect here to our address on eth1.

The routes are like so...
default via 1.2.3.129 dev eth1
6.7.8.0/24 via 1.2.3.1 dev eth0

With the eth0 route in place, 6.7.8.9 can not connect to eth1.
Without it 6.7.8.9 can connect fine but when I try to connect to 6.7.8.9 it will just attempt to send out eth1 and gets blocked.

I'm sure there's a simple solution to this, but I sure can't find it...

Any help here?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments