-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Linux escreveu:
> Ola Pessoal,
>
> Eu estou precisando de colocar um servidor para trabalhar em tres
> sub-redes diferentes. O servidor não vai rotear nada entres as
> redes.
>
> O servidor tem tres placas de rede. A configuração está assim:
>
> cat /etc/sysconfig/network-scripts/ifcfg-eth0 ONBOOT=yes
> TYPE=Ethernet DEVICE=eth0 BOOTPROTO=none NETMASK=255.255.255.0
> IPADDR=192.168.100.12
>
> cat /etc/sysconfig/network-scripts/ifcfg-eth1 ONBOOT=yes
> TYPE=Ethernet DEVICE=eth1 BOOTPROTO=none NETMASK=255.255.255.240
> IPADDR=192.168.10.8
>
> cat /etc/sysconfig/network-scripts/ifcfg-eth2 ONBOOT=yes
> TYPE=Ethernet DEVICE=eth2 BOOTPROTO=none NETMASK=255.255.255.0
> IPADDR=10.0.1.10
>
> cat /etc/sysconfig/network NETWORKING=yes
> HOSTNAME=centos.domain.local GATEWAY=192.168.100.34
>
> route Kernel IP routing table Destination   Gateway Genmask
> Flags Metric Ref    Use Iface 192.168.10.0  *       255.255.255.240
> U     0      0        0 eth2 192.168.100.0 *       255.255.255.0
> U     0      0        0 eth0 10.0.1.0      *       255.255.255.0
> U     0      0        0 eth3 default       192.168.100.34  0.0.0.0
> UG    0      0        0 eth0
>
> Eu só estou conseguindo pingar as máquinas da rede 192.168.100.0.
> As outras redes não funcionam. O problema, ou melhor, a minha
> pergunta é como é que eu faça para poder adicionar os routedores
> para as outras redes?
>
> Eu tentei com o route add -net 10.0.1.0 netmask 255.255.255.0
> gateway 10.0.1.254 dev eth3
>
> Mas a tabela de roteamento fica assim: route Kernel IP routing
> table Destination   Gateway Genmask         Flags Metric Ref    Use
> Iface 192.168.10.0  *       255.255.255.240 U     0      0        0
> eth2 192.168.100.0 *       255.255.255.0   U     0      0        0
> eth0 10.0.1.0      *       255.255.255.0   U     0      0        0
> eth3 10.0.1.0      10.0.1.254 255.255.255.0   UG    0   0        0
> eth3 default       192.168.100.34  0.0.0.0         UG    0      0
> 0 eth0
>
> com duas entradas para a rede 10.0.1.0 e, eu acho que por causa
> disto, não consigo pingar nada.
>
> Se eu apago a entrada da rede 10.0.1.0 antes de incluir o roteador
> certo, recebo um erro.
>
> route Kernel IP routing table Destination   Gateway Genmask
> Flags Metric Ref    Use Iface 192.168.10.0  *       255.255.255.240
> U     0      0        0 eth2 192.168.100.0 *       255.255.255.0
> U     0      0        0 eth0 10.0.1.0      *       255.255.255.0
> U     0      0        0 eth3 default       192.168.100.34  0.0.0.0
> UG    0      0        0 eth0
>
>

Boa tarde,
Vamos suporte que você tenha 3 interfaces, eth0, eth1 e eth2, que iram
ficar da seguinte forma:

ifconfig eth0 inet 192.168.100.254 netmask 255.255.255.0
route add default gw 192.168.100.253

ifconfig eth1 inet 192.168.1.254 netmask 255.255.255.0
ifconfig eth2 inet 10.1.1.254 netmask 255.255.255.0

Se você precisa adicionar uma rota para a rede 10.1.2.0/24 que está no
router 192.168.100.253, você faz o seguinte

route add -net 10.1.2.0 netmask 255.255.255.0 gw 192.168.100.253

Ou seja, agora existe uma rota na interface eth0 para a rede 10.1.2.0/24

ok?

ABraço,


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
 
iD8DBQFG9AU6bjyCr4Ixg0wRAruRAKCdI7MxarGdbBmanRS6OpocIKWQdwCfViIy
l0/V6nJDnTnUUZpSHXymvL0=
=f8a6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------------
Esta lista é patrocinada pela Conectiva S.A. Visite http://www.conectiva.com.br

Arquivo: http://bazar2.conectiva.com.br/mailman/listinfo/linux-br
Regras de utilização da lista: http://linux-br.conectiva.com.br
FAQ: http://www.zago.eti.br/menu.html

Responder a