Enviado em 22/12/2015 - 13:38h
Pessoal, tudo bem?
Criei um servidor DHCP com VLAN e switch gerenciável usando o dot1q.
Segui os tutoriais:
https://www.vivaolinux.com.br/artigo/DHCP-e-VLANs-no-CentOS-65-Instalacao-e-configuracao?pagina=1
https://www.vivaolinux.com.br/artigo/Criando-Redes-Locais-Virtuais-(VLANs)-com-Linux?pagina=1
O meu cliente DHCP obtém a Vlan normalmente, o problema é que não tem acesso a internet.
O IP distribuído pela interface ETH0, funciona normalmente, mas o da subinterface ETH0.10 não.
Segue meus arquivos de configuração:
1) cat /etc/sysconfig/network-scripts/ifcfg-eth0
2) cat /etc/sysconfig/network-scripts/ifcfg-eth0.10
3) cat /etc/sysconfig/network
4) cat /etc/sysconfig/dhcpd
5) Script para criar VLAN e rotas
6) ifconfig
7) cat /etc/dhcp/dhcpd.conf
8) Interfaces do cliente Windows (ipconfig)
Criei um servidor DHCP com VLAN e switch gerenciável usando o dot1q.
Segui os tutoriais:
https://www.vivaolinux.com.br/artigo/DHCP-e-VLANs-no-CentOS-65-Instalacao-e-configuracao?pagina=1
https://www.vivaolinux.com.br/artigo/Criando-Redes-Locais-Virtuais-(VLANs)-com-Linux?pagina=1
O meu cliente DHCP obtém a Vlan normalmente, o problema é que não tem acesso a internet.
O IP distribuído pela interface ETH0, funciona normalmente, mas o da subinterface ETH0.10 não.
Segue meus arquivos de configuração:
1) cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=c2f9a57c-c890-4ac2-a2d5-3ddbac85d6da
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:0C:29:BF:68:E6
IPADDR=192.168.0.10
PREFIX=24
GATEWAY=192.168.0.1
DNS1=192.168.0.20
DNS2=192.168.0.1
DNS3=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
2) cat /etc/sysconfig/network-scripts/ifcfg-eth0.10
DEVICE=eth0.10
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.0.10
PREFIX=24
GATEWAY=192.168.10.1
DNS1=192.168.0.20
DNS2=192.168.0.1
DNS3=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0.10
VLAN=yes
3) cat /etc/sysconfig/network
VLAN=yes
NETWORKING=yes
HOSTNAME=local
GATEWAY=192.168.0.1
4) cat /etc/sysconfig/dhcpd
DHCPDARGS="eth0 eth0.10";
5) Script para criar VLAN e rotas
#!/bin/bash
VCONFIG=/sbin/vconfig
$VCONFIG add eth0 10
ifconfig eth0.10 192.168.10.1 netmask 255.255.255.0 up
route add default gw 192.168.0.1
echo "Criado rota DEFAULT"
route add -net 192.168.10.0/24 gw 192.168.0.1
echo "Criado rota VLAN 10"
service network restart
service dhcpd restart
exit 0
6) ifconfig
eth0 Link encap:Ethernet Endereço de HW 00:0C:29:BF:68:E6
inet end.: 192.168.0.10 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::20c:29ff:febf:68e6/64 Escopo:Link
UP BROADCASTRUNNING MULTICAST MTU:1500 Métrica:1
RX packets:3011 errors:0 dropped:0 overruns:0 frame:0
TX packets:1169 errors:0 dropped:0 overruns:0 carrier:0
colisões:0 txqueuelen:1000
RX bytes:317391 (309.9 KiB) TX bytes:195895 (191.3 KiB)
eth0.10 Link encap:Ethernet Endereço de HW 00:0C:29:BF:68:E6
inet end.: 192.168.0.10 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::20c:29ff:febf:68e6/64 Escopo:Link
UP BROADCASTRUNNING MULTICAST MTU:1500 Métrica:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
colisões:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:900 (900.0 b)
7) cat /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 86400;
max-lease-time 604800;
authoritative;
log-facility local7;
option domain-name "local";
option domain-name-servers 192.168.0.20, 192.168.0.1, 8.8.8.8;
# Configurando escopo DHCP.
##PLACA PRINCIPAL DHCP ETH0
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.199;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
}
## VLAN 10 - ADMINISTRATIVO
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.100 192.168.10.199;
option subnet-mask 255.255.255.0;
option routers 192.168.10.1;
option broadcast-address 192.168.10.255;
}
8) Interfaces do cliente Windows (ipconfig)
Configuração de IP do Windows
Adaptador Ethernet OnBoad:
Sufixo DNS específico de conexão. . . . . . : local
Endereço IPv4. . . . . . . . . . . . . . : 192.168.0.101
Máscara de Sub-rede . . . . . . . . . . . . : 255.255.255.0
Gateway Padrão. . . . . . . . . . . . . . . : 192.168.0.1
Adaptador Ethernet OffBoard:
Sufixo DNS específico de conexão. . . . . . : local
Endereço IPv4. . . . . . . . . . . . . . . : 192.168.10.100
Máscara de Sub-rede . . . . . . . . . . . . : 255.255.255.0
Gateway Padrão. . . . . . . . . . . . . . . : 192.168.10.1