On 2013-10-03, Grant Edwards <grant.b.edwa...@gmail.com> 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

FWIW, it turns out using that facility wasn't appropriate.  The
iptables rules were dependent on info that's only available after the
interface comes up and obtains its configuration via DHCP.  So
everyting (both 'ip' commands and 'iptables' commands ended up in
/etc/conf.d.net in the postup() function for setup and the predown()
function for teardown.

-- 
Grant


Reply via email to