Gentoo Archives: gentoo-user-br

From: Thiago Henrique <thenrique@×××××.com>
To: gentoo-user-br@l.g.o
Subject: [gentoo-user-br] Iproute2 + 2 links + loucura !!
Date: Thu, 26 Oct 2006 13:01:11
Message-Id: b74ebede0610260600w5fe98c67x58bd5fcec317baad@mail.gmail.com
1 Galera,
2
3 Seguinte, tenho o seguinte cenario:
4
5 eth0 = speedy
6 eth1 = virtua
7 eth2 = lan
8
9 Tenho um servidor de email dentro da rede com ip 10.x.x.x, o fw faz um dnat
10 das portas 25,80 e 110 para ele....
11
12 Quero fazer com que o serviço de e-mail responda pelos 2 ips simultaneamente
13 mas nao estou conseguindo, estou usando a seguinte configuração do iproute2:
14
15 #!/bin/bash
16 #$IF1 be the name of the first interface
17 IF1=eth0
18 #$IF2 the name of the second interface
19 IF2=eth1
20 #$IP1 be the IP address associated with $IF1
21 IP1=200.xxx.xxx.xxx
22 #$IP2 the IP address associated with $IF2
23 IP2=201.xxx.xxx.xxx
24 #$P1 be the IP address of the gateway at Provider 1
25 P1=200.xxx.xxx.xxx
26 #$P2 the IP address of the gateway at provider 2
27 P2=xxx.xxx.xxx.xxx
28 #$P1_NET be the IP network $P1 is in
29 P1_NET=200.xxx.xxx.xxx
30 #$P2_NET the IP network $P2 is in
31 P2_NET=201.xxx.xxx.xxx
32 #$T1 the table 1
33 T1=speedy
34 #$T2 the table 2
35 T2=virtua
36
37 ip route add $P1_NET dev $IF1 src $IP1 table $T1
38 ip route add default via $P1 table $T1
39 ip route add $P2_NET dev $IF2 src $IP2 table $T2
40 ip route add default via $P2 table $T2
41
42 ip route add $P1_NET dev $IF1 src $IP1
43 ip route add $P2_NET dev $IF2 src $IP2
44
45 ip rule add from $IP1 table $T1
46 ip rule add from $IP2 table $T2
47
48 ip route add default scope global nexthop via $P1 dev $IF1 weight 1 \
49 nexthop via $P2 dev $IF2 weight 1
50
51 Com essa configuração os dois links funcionam no FW normalmente, o serviço
52 de email responde no virtua sem problemas, mas quando tento por exemplo um
53 telnet no ip do speedy na porta 25 ele não responde.
54
55 Alguem tem alguma ideia do que pode estar errado ??
56
57 Abraços...