lartc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* forwarding/routing traffic (+nat) to gw in a custom routing table
@ 2019-11-08 15:48 Marc Roos
  2019-11-08 17:27 ` Leroy Tennison
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Roos @ 2019-11-08 15:48 UTC (permalink / raw)
  To: lartc


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











^ permalink raw reply	[flat|nested] 2+ messages in thread

* forwarding/routing traffic (+nat) to gw in a custom routing table
  2019-11-08 15:48 forwarding/routing traffic (+nat) to gw in a custom routing table Marc Roos
@ 2019-11-08 17:27 ` Leroy Tennison
  0 siblings, 0 replies; 2+ messages in thread
From: Leroy Tennison @ 2019-11-08 17:27 UTC (permalink / raw)
  To: lartc

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@vger.kernel.org <lartc-owner@vger.kernel.org> on behalf of Marc Roos <M.Roos@f1-outsourcing.eu>

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

To: lartc <lartc@vger.kernel.org>

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@datavoiceint.com
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.
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-08 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 15:48 forwarding/routing traffic (+nat) to gw in a custom routing table Marc Roos
2019-11-08 17:27 ` Leroy Tennison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).