On Mon, Mar 20, 2023 at 03:23:15PM +0800, f...@dnsbed.com wrote:
> Hello list,
> 
> I have a networking question that I can't understand for.
> I have the Debian 11 host with two ethernet cards.
> There is public IP and gateway for each ethernet card.
> (they are public IPs from two different net address blocks.)
> 
> Say:
> eth0 ip: 193.36.132.10  gw: 193.36.132.1
> eth1 ip: 5.255.106.10 gw: 5.255.106.1
> 
> The system's default gw is the first one (eth0).
> When clients from outside access eth1 ip (such as HTTP access), they can
> reach there.
> But, the returned packages from debian server to clients are always coming
> from eth0 gw.
> I expect the returned package also come from eth1 gw (since clients are
> accessing eth1 address).
> 
> How can I setup this? Thanks for any hints.

Disclaimer: I haven't found the time to wrap my head around
that and actually run some tests. It's on my TODO. So take
this with two fists of salt.

You might want to play with /proc/sys/net/ipv4/conf/*/rp_filter [0] [1].

Cheers

[0] https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
[1] https://www.rfc-editor.org/rfc/rfc3704
-- 
t

Attachment: signature.asc
Description: PGP signature

Reply via email to