LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2024, 07:37 PM   #1
14karat-lq
LQ Newbie
 
Registered: Jan 2024
Posts: 2

Rep: Reputation: 0
Diifferent inbound and outbound nics / routes


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?
 
Old 01-19-2024, 04:32 AM   #2
14karat-lq
LQ Newbie
 
Registered: Jan 2024
Posts: 2

Original Poster
Rep: Reputation: 0
I finally uncovered the solution... adding an ip rule with a custom table...

# ip rule add from 1.2.3.4 table 4
# ip route add default via 1.2.3.1 dev eth0 table 4

Can't believe that was so difficult to figure out... really simple once you've seen it work...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail AUTH/SASL2 both an outbound relay and an inbound mail server wingman007 Linux - Newbie 0 04-20-2012 02:27 PM
dspam Adding Every Mail Account - inbound and outbound - to dspam_virtual_uids mmem700 Linux - Server 2 03-12-2012 04:48 AM
linux multi wan (separate inbound and outbound) wartelz Linux - Networking 1 01-11-2007 12:40 AM
Newbie:What are inbound and outbound memory windows? halturata Programming 3 04-03-2006 02:10 PM
catch all inbound and outbound emails mitzadej Linux - Software 1 04-03-2006 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration