From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C20D91381F3 for ; Sat, 5 Oct 2013 21:01:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B362E0B0A; Sat, 5 Oct 2013 21:01:14 +0000 (UTC) Received: from uberouter3.guranga.net (unknown [78.25.223.226]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 407D1E0ABC for ; Sat, 5 Oct 2013 21:01:13 +0000 (UTC) Received: from [192.168.151.100] (unknown [192.168.151.100]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by uberouter3.guranga.net (Postfix) with ESMTPSA id CB54D82352 for ; Sat, 5 Oct 2013 22:01:11 +0100 (BST) Message-ID: <52507E0E.7080708@thegeezer.net> Date: Sat, 05 Oct 2013 22:01:02 +0100 From: thegeezer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Where to put advanced routing configuration? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: e8d1dd6e-c81a-435f-b556-b3ad3777b982 X-Archives-Hash: 07b08e76e49b330905c9a2e04717dee4 On 10/03/2013 08:27 PM, Grant Edwards wrote: > Let's say you wanted to configure routing of TCP packets based on destination > port like in this example: > > http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.netfilter.html > > [which contains a series of 'ip' and 'iptables' commands to get packets > destined for port 25 to use a specific gateway.] > > How do do this the "right" way on a Gentoo system? > > Based on reading http://www.gentoo.org/doc/en/home-router-howto.xml, I think > I've figured out how to do the iptables part: you enter the 'iptables' > commands by hand to get the iptables set up the way you want, then you do > this: > > # /etc/init.d/iptables save > # rc-update add iptables default > > What about the 'ip' commands required to set up the tables, routes, and > rules? Do those go in a startup script somewhere? Does one just edit > /etc/iproute2/rt_tables by hand? One would assume route configuration belongs > in /etc/conf.d/net -- I've read through the advanced networking stuff in the > handbook, but it's not apparent to me where those 'ip' command belong. > in /etc/conf.d/net just add the following (adjust as appropriate) rules_eth1=( "from all to 8.8.8.8/24 lookup 101" )