forwarding/routing traffic (+nat) to gw in a custom routing table

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You have some ambiguities which make it difficult to respond.

When you say "natted host", where is it coming from: 192.168.122.0/24 or the "1. network" (you didn't say what it's subnet mask was) or elsewhere?  Which interface is "connected" (directly or otherwise) to the Internet?

Am I understanding you correctly that the main routing table on this system has no default route?  Although not much is sacred, I normally set up a system with a default route in the main configuration and use alternate routing tables plus rules to deal with the exceptions.

Explain a little better what you're trying to accomplish in non-configuration terms, I'm confused by your configuration specifications.  I also tried your negation approach for 'ip rule add ...' and got an error because bash decided that the negation meant that history substitution was requested.


From: lartc-owner@xxxxxxxxxxxxxxx <lartc-owner@xxxxxxxxxxxxxxx> on behalf of Marc Roos <M.Roos@xxxxxxxxxxxxxxxxx>

Sent: Friday, November 8, 2019 9:48 AM

To: lartc <lartc@xxxxxxxxxxxxxxx>

Subject: [EXTERNAL] forwarding/routing traffic (+nat) to gw in a custom routing table

 




I have two interfaces:

eth0 192.168.122.2

eth1 1.1.1.10



I have a routing table 4, with:

default via 1.1.1.1 dev eth1



I have rules:

32764:     from all to 1.1.1.10 lookup 4

32765:     from 1.1.1.10 lookup 4







If I ping from a natted host to 8.8.8.8, I am getting 

>From 192.168.122.2 icmp_seq=1 Destination Net Unreachable



If I know add this rule

ip rule add from 192.168.122.0/24 to 8.8.8.8 lookup 4



The ping starts working. However I need to have this working for 

0.0.0.0/0 except 192.168.122.0/24. How should I implement something 

like:

ip rule add from 192.168.122.0/24 to !192.168.122.0/4 lookup 4


























Leroy Tennison
Network Information/Cyber Security Specialist
E: leroy@xxxxxxxxxxxxxxxx
2220 Bush Dr
McKinney, Texas
75070
www.datavoiceint.com
This message has been sent on behalf of a company that is part of the Harris Operating Group of Constellation Software Inc.If you prefer not to be contacted by Harris Operating Group please notify us.
This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or 
confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
 



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux