Eu tenho um servidor Ubuntu 10.04 com 2 dispositivos ethernet, eth0 e eth1.
- o eth0 tem um IP estático de 192.168.1.210
- eth1 tem um IP estático se 192.168.1.211
O servidor DHCP (que também serve como gateway de internet) fica em 192.168.1.1.
O problema que tenho agora é quando eu conectei os dois IPs internamente, mas não consigo conectar-me à Internet a partir do servidor. Se eu desconectar um dos dispositivos (por exemplo, eth1), ele funcionará, sem problemas. (Além disso, recebo o mesmo resultado quando executo sudo ifconfig eth1 down
).
Pergunta, como posso configurá-lo para que eu possa ter os dois dispositivos eth0 e eth1 funcionando bem na mesma rede, mas também permitir acesso à internet? (Estou aberto a impor todo o tráfego inet passando por um único dispositivo ou por meio de ambos, sou flexível).
A partir da minha pesquisa no Google, parece que posso ter um problema único (ou não popular), por isso não consegui encontrar uma solução. Isso é algo que as pessoas geralmente não fazem? A razão que eu quero fazer uso de ambos os dispositivos ethernet é porque eu quero executar serviços de tráfego local diferentes em ambos para dividir a carga, por assim dizer ...
Obrigado antecipadamente.
UPDATE
Conteúdo de / etc / network / interfaces:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# The secondary network interface
#auto eth1
#iface eth1 inet dhcp
(Nota: acima, eu comentei as duas últimas linhas porque achei que estava causando problemas ... mas não resolveu)
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
UPDATE 2
Eu fiz uma mudança no arquivo / etc / network / interfaces como sugerido por Kevin. Antes de eu exibir o conteúdo do arquivo e a tabela de rotas, quando eu estou logado no servidor (através do SSH), eu não consigo pingar um servidor externo, então este é o mesmo problema que me levou a postar essa pergunta.
Eu executei uma reinicialização do /etc/init.d/networking depois de fazer as alterações no arquivo.
Conteúdo de / etc / network / interfaces:
# The loopback network interface auto lo iface lo inet loopback
# The primary network interface
auto eth0 iface eth0 inet dhcp
address 192.168.1.210
netmask 255.255.255.0
gateway 192.168.1.1
# The secondary network interface
auto eth1 iface eth1 inet dhcp
address 192.168.1.211
netmask 255.255.255.0
saída do ifconfig
eth0 Link encap:Ethernet HWaddr 78:2b:cb:4c:02:7f
inet addr:192.168.1.210 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::7a2b:cbff:fe4c:27f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6397 errors:0 dropped:0 overruns:0 frame:0
TX packets:683 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:538881 (538.8 KB) TX bytes:85597 (85.5 KB)
Interrupt:36 Memory:da000000-da012800
eth1 Link encap:Ethernet HWaddr 78:2b:cb:4c:02:80
inet addr:192.168.1.211 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::7a2b:cbff:fe4c:280/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5799 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:484436 (484.4 KB) TX bytes:1184 (1.1 KB)
Interrupt:48 Memory:dc000000-dc012800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:635 errors:0 dropped:0 overruns:0 frame:0
TX packets:635 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:38154 (38.1 KB) TX bytes:38154 (38.1 KB)
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0