How can I route network traffic such that the packets go out via the same interface they came in?

Solution Verified - Updated -


  • How can I forward network packets to the same network interface from where it came from?
  • Two interfaces are both connected to internet which is provided by different ISPs. How can I make the network packets go back via the interface where they came from?
  • How to assign two IP for two NIC with two diffrent subnet (two different gateway). How to add two gateway on a single machine.


  • Red Hat Enterprise Linux
  • System connected to Internet via multiple network interfaces on different networks/ISPs
  • System connected to the same subnet via multiple network interfaces

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.