1 |
On 2013-10-03, Grant Edwards <grant.b.edwards@×××××.com> wrote: |
2 |
|
3 |
> Let's say you wanted to configure routing of TCP packets based on destination |
4 |
> port like in this example: |
5 |
> |
6 |
> http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.netfilter.html |
7 |
> |
8 |
> [which contains a series of 'ip' and 'iptables' commands to get packets |
9 |
> destined for port 25 to use a specific gateway.] |
10 |
> |
11 |
> How do do this the "right" way on a Gentoo system? |
12 |
> |
13 |
> Based on reading http://www.gentoo.org/doc/en/home-router-howto.xml, I think |
14 |
> I've figured out how to do the iptables part: you enter the 'iptables' |
15 |
> commands by hand to get the iptables set up the way you want, then you do |
16 |
> this: |
17 |
> |
18 |
> # /etc/init.d/iptables save |
19 |
> # rc-update add iptables default |
20 |
|
21 |
FWIW, it turns out using that facility wasn't appropriate. The |
22 |
iptables rules were dependent on info that's only available after the |
23 |
interface comes up and obtains its configuration via DHCP. So |
24 |
everyting (both 'ip' commands and 'iptables' commands ended up in |
25 |
/etc/conf.d.net in the postup() function for setup and the predown() |
26 |
function for teardown. |
27 |
|
28 |
-- |
29 |
Grant |