LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2020, 05:27 AM   #1
jorism
LQ Newbie
 
Registered: Mar 2020
Posts: 1

Rep: Reputation: Disabled
redhat 7 policy based routing fails


On a redhat 7 system we want to be able to choose the source interface for outgoing traffic based on which interface the traffic came in. We tried using ip rule and ip route. Even the most simple rule like this does not work (tcp only shows incoming SYN packets).

This is the config:

ip rule
0: from all lookup local
32761: from all iif eth0 lookup outgoing
32766: from all lookup main
32767: from all lookup default

ip route show table outgoing
default via 10.82.191.33 dev eth0
For incoming packets from a certain host, let's say 168.63.129.16, in only see incoming SYN packets. I get the impression that the ip rule is not triggered or working. Difficult to debug!

Help (please) ! Help?

The available interfaces;

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0d:3a:38:fc:c2 brd ff:ff:ff:ff:ff:ff
inet 10.82.191.37/28 brd 10.82.191.47 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20d:3aff:fe38:fcc2/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0d:3a:aa:61:07 brd ff:ff:ff:ff:ff:ff
inet 10.82.191.4/27 brd 10.82.191.31 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet 10.82.191.7/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:2
valid_lft forever preferred_lft forever
inet 10.82.191.5/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:0
valid_lft forever preferred_lft forever
inet 10.82.191.6/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:1
valid_lft forever preferred_lft forever
inet6 fe80::20d:3aff:feaa:6107/64 scope link
valid_lft forever preferred_lft forever
 
Old 03-25-2020, 07:45 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,742

Rep: Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982Reputation: 7982
Quote:
Originally Posted by jorism View Post
On a redhat 7 system we want to be able to choose the source interface for outgoing traffic based on which interface the traffic came in. We tried using ip rule and ip route. Even the most simple rule like this does not work (tcp only shows incoming SYN packets).

This is the config:
ip rule
0: from all lookup local
32761: from all iif eth0 lookup outgoing
32766: from all lookup main
32767: from all lookup default

ip route show table outgoing
default via 10.82.191.33 dev eth0
For incoming packets from a certain host, let's say 168.63.129.16, in only see incoming SYN packets. I get the impression that the ip rule is not triggered or working. Difficult to debug! Help (please) ! Help? The available interfaces;
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0d:3a:38:fc:c2 brd ff:ff:ff:ff:ff:ff
    inet 10.82.191.37/28 brd 10.82.191.47 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20d:3aff:fe38:fcc2/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0d:3a:aa:61:07 brd ff:ff:ff:ff:ff:ff
    inet 10.82.191.4/27 brd 10.82.191.31 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet 10.82.191.7/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:2
       valid_lft forever preferred_lft forever
    inet 10.82.191.5/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:0
       valid_lft forever preferred_lft forever
    inet 10.82.191.6/27 brd 10.82.191.31 scope global secondary noprefixroute eth1:1
       valid_lft forever preferred_lft forever
    inet6 fe80::20d:3aff:feaa:6107/64 scope link
       valid_lft forever preferred_lft forever
Did you read the Red Hat knowledgebase about how to do this?
https://access.redhat.com/documentat...ing-networking

..and this page with a working solution:
https://access.redhat.com/solutions/1257153
 
  


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
routing protocol based on based geo -cast routing in vehicular ad hoc netwok Adaramola ojo jayeola Linux - Wireless Networking 1 06-02-2016 08:53 AM
Configure my Redhat directory server password policy and account lockout policy arunplanet Linux - Newbie 4 10-06-2012 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:17 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