Routing response packets from IP/32 based on incoming interface incoming NIC
2
votes
1
answer
1372
views
I have a Rhel 8.7 machine with 2 NICs in different subnets. Let's say
eth1-IP:10.10.10.4/24 ,gateway:10.10.10.1
. This gateway is also the default gateway for this vm, and a second NIC: eth2, IP:10.10.20.2 , gateway:10.10.20.254
.
**Situation** : This machine already has multiple static routes configured, and my guess is, present in the main routing table, routes I don't want to somehow break.
There is a specific IP (10.10.30.33)that needs to connect via ssh (icmp also is allowed, and used for testing) on both nics. As I have the default gateway on eth1, this IP which is in a different subnet entirely can connect to the eth1 Ip :10.10.10.4 but not on eth2:10.10.20.2 without any modification. When I set up a static route to switch response packets to go through eth2 gateway instead of default gateway, there is reachability but connection is no longer possible on the interface with the default gateway , the connection that before the static route was added worked.
**GOAL**: Route-only response traffic for specific IP based on the incoming interface. If 10.10.30.33 tries to reach 10.10.10.4 response should be sent on eth1, if it tries 10.10.20.2 it should send on eth2 response packets. Basically, I want both these machine interfaces to be accessible for 10.10.30.33 at the same time.
Asked by l0cal
(21 rep)
Apr 1, 2023, 04:50 PM
Last activity: May 25, 2023, 07:30 PM
Last activity: May 25, 2023, 07:30 PM