[MASOCH-L] Problemas para configurar enlace Embratel

Hamilton Vera hamilton at theforce.com.br
Sun Aug 15 16:45:57 BRT 2010


Caio, coloquei no servidor um script no /root , mas infelizmente perdi
conexão com servidor.


Se resolver dê um retorno.


[]'s

Hamilton Vera


Em 15 de agosto de 2010 16:20, Hamilton Vera <hamilton at theforce.com.br>escreveu:

> Olá Marcelo, essa configuração eu já tinha feito, porém não funcionou:
>
>
> eth0      Link encap:Ethernet  HWaddr 00:24:01:9d:8e:14
>           inet addr:201.73.81.142  Bcast:201.73.81.143
> Mask:255.255.255.252
>           inet6 addr: fe80::224:1ff:fe9d:8e14/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:6062 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:5731 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1090632 (1.0 MiB)  TX bytes:614920 (600.5 KiB)
>           Interrupt:19 Base address:0xd400
>
> eth1      Link encap:Ethernet  HWaddr 00:21:91:91:36:95
>           inet addr:189.xxx.xxx.xxxy  Bcast:189.3.255.15
> Mask:255.255.255.240
>           inet6 addr: fe80::221:91ff:fe91:3695/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:2520 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1899 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:417734 (407.9 KiB)  TX bytes:858854 (838.7 KiB)
>           Interrupt:18 Base address:0xd000
>
>
> O IP que eu coloquei na eth1 é o default gateway das máquinas.
>
> Também já fiz o teste de colocar um IP da rede 189.xxx.xxx.xxx/28 na eth0 e
> utiliza-lo como default gateway das máquinas, mas nenhum sucesso:
>
> eth0      Link encap:Ethernet  HWaddr 00:24:01:9d:8e:14
>           inet addr:201.73.81.142  Bcast:201.73.81.143
> Mask:255.255.255.252
>           inet6 addr: fe80::224:1ff:fe9d:8e14/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:6062 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:5731 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1090632 (1.0 MiB)  TX bytes:614920 (600.5 KiB)
>           Interrupt:19 Base address:0xd400
>
> eth0:0    Link encap:Ethernet  HWaddr 00:24:01:9d:8e:14
>           inet addr:189.xxx.xxx.1  Bcast:189.3.255.15  Mask:255.255.255.240
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           Interrupt:19 Base address:0xd400
>
> eth1      Link encap:Ethernet  HWaddr 00:21:91:91:36:95
>           inet addr:189.xxx.xxx.2  Bcast:189.3.255.15  Mask:255.255.255.240
>           inet6 addr: fe80::221:91ff:fe91:3695/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:2520 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1899 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:417734 (407.9 KiB)  TX bytes:858854 (838.7 KiB)
>           Interrupt:18 Base address:0xd000
>
> Ainda não consigo repassar da eth0 para eth1, se alguém tiver algum
> conselho agradeço.
>
> Obrigado.
>
>
>
> Em 15 de agosto de 2010 12:54, Marcelo da Silva <marcelo at mginformatica.com
> > escreveu:
>
> na eth1
>> vc deve ter um *IP* da rede 189.xxx.xxx.xxx/28
>> e o gateway dos hosts da rede 189.xxx.xxx.xxx/28
>> deve ser o *IP* que voce colocou na eth1
>>
>> On Sun, 15 Aug 2010 00:28:56 -0300, caio rezende <caio at theforce.com.br>
>> wrote:
>> > Senhores, boa noite.
>> >
>> > Adquirimos um link com a Embratel que fornece uma rede com 16 IPs
>> > públicos,
>> > porém por motivos que não me informaram a embratel não irá
>> disponibilizar
>> > o
>> > roteador que faz o enlace entre as redes.
>> >
>> > Para tentar resolver essa pendência instalei uma máquina linux com 3
>> > interfaces:
>> >
>> > eth0:  Enlace com a Embratel 201.73.81.142 (IP Cliente) -> 201.73.81.141
>> > (IP
>> > Embratel)
>> > eth1: Rede de IPs públicos  189.xxx.xxx.xxx/28
>> > eth2: não está em uso
>> >
>> > Já fiz as configurações básicas de iptables para habilitar forward entre
>> > as
>> > duas interfaces e habilitar o /proc/sys/net/ipv4/ip_forward.
>> >
>> > Infelizmente só consigo acessar coisas externas quando faço o
>> mascaramento
>> > pela interface de enlace, todos saem com o IP 201.73.81.142. Gostaria de
>> > saber como fazer a interface eth0 (201.73.81.142)  aceitar também os
>> > pacotes
>> > que chegam para a rede de IPs públicos (189.xxx.xxx.xxx/28) que tenho na
>> > eth1.
>> >
>> > Já verifiquei com o TCPDUMP, os pacotes destinados a rede
>> > 189.3.255.0/28estão <http://189.3.255.0/28est%C3%A3o> chegando na
>> interface eth0, porém não consigo
>> > repassar esses pacotes
>> > para a eth1.
>> >
>> > tcpdump -p -n -s 1500 -i eth0
>> >
>> > 00:02:57.247968 IP 201.73.81.142.49733 > 189.xxx.xxx.yyy.25: Flags [S],
>> seq
>> > 1840559620, win 65535, options [mss 1410,sackOK,eol], length 0
>> >
>> > tcpdump -p -n -s 1500 -i eth1
>> > <NADA>
>> >
>> > Um colega da lista Hamilton Vera sugeriu que eu olhasse novamente as
>> regras
>> > de forward, abaixo está um script bem simples que utilizo e a tabela de
>> > rotas:
>> >
>> > root at gw:~# route -n
>> > Kernel IP routing table
>> > Destination     Gateway         Genmask         Flags Metric Ref    Use
>> > Iface
>> > 201.73.81.140   0.0.0.0         255.255.255.252 U     0      0        0
>> > eth0
>> > 189.3.255.0     0.0.0.0         255.255.255.240 U     0      0        0
>> > eth1
>> > 127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0
>> lo
>> > 0.0.0.0         201.73.81.141   0.0.0.0         UG    1      0        0
>> > eth0
>> >
>> > #!/bin/sh
>> > IPTABLES="/usr/local/sbin/iptables"
>> > # Flush todas as regras
>> > $IPTABLES -F INPUT
>> > $IPTABLES -F OUTPUT
>> > $IPTABLES -F FORWARD
>> > # Limpa as regras nas tabelas filter e NAT:
>> > $IPTABLES -F
>> > $IPTABLES -t nat -F
>> > echo "Apaga qualquer chain fora do padrao nas tabelas filter e NAT:"
>> > $IPTABLES -X
>> > $IPTABLES -t nat -X
>> > # Seta a politica padrao da tabela filter:
>> > $IPTABLES -P INPUT ACCEPT
>> > $IPTABLES -P OUTPUT ACCEPT
>> > $IPTABLES -P FORWARD ACCEPT
>> > # Seta a politica padrao na tabela NAT:
>> > $IPTABLES -t nat -P PREROUTING ACCEPT
>> > $IPTABLES -t nat -P POSTROUTING ACCEPT
>> > $IPTABLES -t nat -P OUTPUT ACCEPT
>> > #########################
>> > # CONFIGURACOES FINAIS:
>> > #########################
>> > #$IPTABLES -t nat -A POSTROUTING -o eth1   -j MASQUERADE
>> > $IPTABLES -A FORWARD -i eth1 -o eth2 -m state --state
>> > NEW,ESTABLISHED,RELATED -j ACCEPT
>> > $IPTABLES -A FORWARD -i eth2 -o eth1 -m state --state
>> ESTABLISHED,RELATED
>> > -j
>> > ACCEPT
>> > $IPTABLES -A FORWARD -i eth1 -o eth2 -j ACCEPT
>> > $IPTABLES -A FORWARD -i eth2 -o eth1 -j ACCEPT
>> > # Habilita o IP Forward:
>> > echo 1 > /proc/sys/net/ipv4/ip_forward
>> > # Enable TCP SYN Cookie Protection
>> > echo 1 >/proc/sys/net/ipv4/tcp_syncookies
>> > # Enable broadcast echo protection
>> > echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
>> > echo "Iptables Started"
>> >
>> >
>> > Fico imensamente grato por qualquer ajuda.
>> >
>> > Caio
>> > __
>> > masoch-l list
>> > https://eng.registro.br/mailman/listinfo/masoch-l
>> __
>> masoch-l list
>> https://eng.registro.br/mailman/listinfo/masoch-l
>>
>
>
>
> --
> http://hvera.wordpress.com
>



-- 
http://hvera.wordpress.com


More information about the masoch-l mailing list