Comprei recentemente um PC barebone e estou tentando configurá-lo como meu roteador / servidor doméstico. Eu tenho tentado alguns tutoriais, mas sem sucesso e agora estou desistindo ..
Suponho que o motivo esteja no design da minha rede, mas não tenho certeza.
Por favor me ajude ou me dê algumas dicas ... Como configurar o gateway eth0?
Geralmente, meu design de rede é assim.
Roteador ISP:
192.168.0.1 é o endereço local do ISP
myRouter: // (que estou tentando configurar)
root@gdn:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="15.04 (Vivid Vervet)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.04"
VERSION_ID="15.04"
root@gdn:~# cat /etc/networks
#link-local 169.254.0.0
LAN 192.192.1.0
WLAN 192.192.2.0
OUT 192.168.0.0
O Config é o seguinte:
encaminhamento ativado:
root@gdn:~# sysctl net.ipv4.conf.all.forwarding
net.ipv4.conf.all.forwarding = 1
/ etc / network / interfaces:
root@gdn:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug wlan0
#"WAN"
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.224
network 192.168.0.0
broadcast 192.168.0.31
gateway 192.168.0.1
#LAN
auto eth1
iface eth1 inet static
address 192.192.1.1
netmask 255.255.255.224
network 192.192.1.0
broadcast 192.192.1.31
gateway 192.168.0.1
#dns-nameservers 192.192.1.1
#wireless
auto wlan0
iface wlan0 inet static
pre-down pkill hostapd
address 192.192.2.1
netmask 255.255.255.224
network 192.192.2.0
broadcast 192.192.2.31
gateway 192.168.0.1
#dns-nameservers 192.192.2.1
sleep 1
post-up hostapd /etc/hostapd/hostapd.conf &
dhcpd.conf
ddns-update-style none;
option domain-name "home.network";
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.192.1.0 netmask 255.255.255.224 {
range 192.192.1.2 192.192.1.30;
option domain-name-servers gdn.home.network;
option domain-name "home.network";
option subnet-mask 255.255.255.224;
option routers 192.192.1.1;
option broadcast-address 192.192.1.31;
}
subnet 192.192.2.0 netmask 255.255.255.224 {
range 192.192.2.2 192.192.2.30;
option domain-name-servers gdn.home.network;
option domain-name "home.network";
option subnet-mask 255.255.255.224;
option routers 192.192.2.1;
option broadcast-address 192.192.2.31;
}
roteamento:
root@gdn:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.192.1.0 0.0.0.0 255.255.255.224 U 0 0 0 eth1
192.192.2.0 0.0.0.0 255.255.255.224 U 0 0 0 wlan0
iptables (transparente)
root@gdn:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Testes:
Eu consegui fazer ping entre as sub-redes eth1 e wlan0, mas não consigo efetuar ping na internet / 192.168.0.1
Eu posso pingar todas as interfaces no meu roteador (eth0, eth1, wlan0).
Pinging 192.192.1.1 from 192.192.1.2 with 32 bytes of data:
Reply from 192.192.1.1: bytes=32 time=1ms TTL=64
Pinging 192.192.2.1 from 192.192.1.2 with 32 bytes of data:
Reply from 192.192.2.1: bytes=32 time=1ms TTL=64
Pinging 192.168.0.2 from 192.192.1.2 with 32 bytes of data:
Reply from 192.168.0.2: bytes=32 time=1ms TTL=64
mas:
Pinging 192.168.0.1 from 192.192.1.2 with 32 bytes of data:
Request timed out.
e
Pinging google.com [216.58.209.46] from 192.192.1.2 with 32 bytes of data:
Request timed out.
A Internet funciona bem no roteador:
root@gdn:~# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=4.86 ms
root@gdn:~# ping google.com
PING google.com (216.58.209.78) 56(84) bytes of data.
64 bytes from ldn02s06-in-f14.1e100.net (213.38.109.78): icmp_seq=1 ttl=55 time=9.66 ms
Como configurar o gateway eth0?
Obrigado antecipadamente por qualquer dica ...