LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Force outbound reply traffic to reuse inbound non-gw NIC? (https://www.linuxquestions.org/questions/linux-networking-3/force-outbound-reply-traffic-to-reuse-inbound-non-gw-nic-15579/)

Jon- 03-04-2002 04:44 PM

Force outbound reply traffic to reuse inbound non-gw NIC?
 
Ok, a rather confusing subject... fairly simple question though..

Kernel 2.2 server. I have 2 network cards. They both have a default route (though the route used by internally generated traffic is NIC1), and they are both public IP addresses. And, can both ping a public third external host fine (ping -I<ethx> <host>. They are on different networks.

If I connect (ssh) to the second NIC IP from a unknown third network that isn't on EITHER network including the NICS, it will try to return the outbound traffic via the default gw of the first NIC (the global default route). Is there some way to force the outbound reply traffic to go back out the way it came in (control the externally generated traffic)? I'd still want outbound originating traffic to leave via the regular default route gateway.

I guess what I need is a way to filter the packets such that outbound return traffic goes back out the adapter it arrived on but outbound originating traffic goes out the regular normal default gw. Statefull routing?? :)

Thanks,
Jon

Jon- 03-04-2002 06:52 PM

Spent some time researching this, and it looks like what I'm needing isn't stateful routing, but rather policy routing. Plus, I need to recompile my kernel w/ advanced router and policy_routing enabled, and install the iproute2 software. This might allow me to do what I need.

Hopefully, IF this all works, it plays nicely w/ FreeS/WAN :))

Any input is appreciated :)

Jon- 03-05-2002 04:50 PM

For those who read this, I discovered that this solution does indeed work great. So far, the ipchains + new kernel + iproute2 + freeswan all seem to work fine together. And, it solves my original problem of needing to routing based on source IP.

RH6.2 (misc updates)
kernel 2.2.19-6.2.12
Freeswan 1.95
iproute2 001007


Thanks,
Jon


All times are GMT -5. The time now is 10:17 PM.