<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Thanks Tomek!<div><br></div><div>VLAN in linux are worked by kernel modules, so if Kea uses raw sockets, probabily VLAN is marked/worked AFTER Kea. I still not 100% sure, but my guess is that Kea was receiving all packets at least two times, one for each interface. After that config change, everything is working.</div><div>About IP on interface, I don't have this problem, since my subnet for each interface has the same IP range for hosts and server.</div><div><br><br><div><span name="x"></span>Jonis Maurin CearĂ¡<br>Analista de Sistemas<br>FEA-RP<br>Help Desk +55 (16) 3315-3898<br>Audiovisual +55 (16) 3315-3927<br>Desenv. Sistemas +55 (16) 3315-4485<br>Infraestrutura +55 (16) 3315-8539 / 0672<br>Atendimento Web: http://suporte.fearp.usp.br<span name="x"></span><br></div><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Tomek Mrugalski" <tomasz@isc.org><br><b>Para: </b>"Jonis Maurin Ceara" <jonis@fearp.usp.br><br><b>Cc: </b>kea-users@lists.isc.org<br><b>Enviadas: </b>Sexta-feira, 20 de Maio de 2016 6:33:01<br><b>Assunto: </b>Re: [Kea-users] Can't get KEA to work here - VLAN issues<br><br>On 19.05.2016 19:29, Jonis Maurin Ceara wrote:<br>> Actually, I need some explanations from experts....<br>> DHCP works on Layer 2? And VLAN's, works on layer 2 too?<br>I don't have much experience with VLANs, so not sure if what I have for<br>you would be useful or not. DHCPv4 component of Kea by default uses raw<br>sockets. This means that it dissects incoming packets on its own. One<br>side effect is that raw sockets receive packets before kernel stack<br>processes it. In particular, iptables are not effective and Kea would<br>receive the traffic, even if iptables drop it. I do not know how VLAN<br>support is implemented in Linux kernel, but I presume it may be similar.<br><br>> This is what I have:<br>> One VM with only one interface.....this interface has VLAN 227 as<br>> untagged and a lot of other VLAN"s tagged, including VLAN 209<br>> On OS of this VM (CentOS 7), I have two interfaces:<br>> <br>> eth0 => 'normal interface', configured with static IP and nothing<br>> related to VLAN. Untagged VLAN = 227, but receives a lot of other tagged<br>> VLAN's. network-id = 1025 for this IP range/VLAN<br>> eth0.209 => interface configured with VLAN ID 209.  Network-id = 1024<br>> for this range/VLAN.<br>> <br>> In Kea configuration, I had:<br>> */"interfaces-config": {/*<br>> */    "interfaces": [ "eth0", "eth0.209" ]/*<br>> */  },/*<br>> and nothing more.<br>> The 'problem' is that Kea is seeing more traffic on eth0....I mean, Kea<br>> is receiving DHCP requests from ALL other VLAN's that is tagged, even if<br>> my linux is not configured for these VLAN's. So I'm guessing that Kea is<br>> intercepting DHCP packages before my linux could 'ignore' these tagged<br>> packets on eth0 (I could see this on log with debug). Since my VLAN 209<br>> came untagged to interface eth0.209 and tagged to interface eth0, I<br>> think Kea is guetting crazy with same packet on both network cards and<br>> subnets.<br>> <br>> I have added 'interface' to specific subnetworks and It's working for now. <br>That's good to hear. So is Kea doing what you wanted it to do?<br><br>I'm afraid that any improvements for VLAN are out of scope for the<br>current 1.1 milestone. So you'll have to work with what is there in the<br>code now. However, there are couple things you may possibly find useful.<br><br>1. You can switch Kea to use UDP sockets rather than raw sockets. This<br>should work great if you have relays, but may be not optimal if you have<br>directly connected clients. See Section 7.2.4 of the User's Guide for<br>details (the parameter name is dhcp-socket-type).<br><br>2. You mentioned using interface parameter in subnet definition. This is<br>working in Kea 1.0, but has some flaws. In particular, it will not work<br>if your IP address on the interface does not match the subnet range.<br>This has been improved recently. If you're interested, the code is<br>currently available on trac4308 branch. You can get it from github.<br>It will be on master branch soon. With this change, only the interface<br>name has to match, not the addresses configured on it. You may give it a<br>try if you experience problems with the interface selection in the 1.0 code.<br><br>Hope that helps,<br>Tomek<br><br></blockquote><br></div></div></body></html>