DHCP leases.

General questions.
Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

DHCP leases.

Post by Darkness » October 22nd, 2019, 6:44 am

Hi guys.

This is my DHCP configuration.
Image

I have a problem, I currently need to grant the same IP for two different MACs.

You will wonder why, this is because I want to give the same IP to the Ethernet network card as to the wireless card.
I require this configuration because I am going to connect by cable from the office or by Wi-Fi at any Access Point by the company. Both configurations from the green part and I want to use the same IP so that all the configurations and rules of the fw are applied in both interfaces without having to create everything in duplicate (for two different ip).

Both will never be working at the same time, so there should be no IP conflict.

But when introducing them in the IPFire concessions, IPFire underline the IP as duplicate although the MAC is different.
Image

I think that's why it doesn't work for me. Although it should be that, as I mentioned, they will never serve the same IP at the same time for both interfaces.

Can I do what I'm looking for? How can I do it?

-------------------------
Hola chicos,

Esta es mi configuracion DHCP.
**ver foto arriba**

Tengo un problema, actualmente necesito conceder la misma IP para dos MAC distintas.

Os preguntareis porque, esto es porque quiero dar la misma IP a la tarjeta de red Ethernet que a la tarjeta wireless.
Requiero esta configuración porque me voy a conectar por cable desde la oficina o por wifi en cualquier Access Point por la empresa. Ambas configuraciones desde la parte verde y quiero utilizar la misma IP para que todas las configuraciones y reglas del fw se apliquen en ambas interfaces sin tener que crear todo por duplicado (para dos ip distintas).

Ambas no van a estar funcionando a la vez nunca, por lo que no debería haber conflicto de IP.

Pero al introducirlas en las concesiones de IPFire, me subraya como duplicada la IP aunque la MAC es diferente.
**ver foto arriba**

Creo que es por eso que no me funciona. Aunque debería puesto que, como os comenté, nunca van a servir la misma IP a la vez para ambas interfaces.

Se puede hacer lo que busco? Como puedo hacerlo?

ChrisK
Posts: 86
Joined: November 10th, 2014, 7:19 am

Re: DHCP leases.

Post by ChrisK » October 22nd, 2019, 7:36 am

Hi,

if I get the guys at the ISC mailinglist right, this should be possible: https://lists.isc.org/pipermail/dhcp-us ... 03917.html
Also, the IPFire seems to generate the corrent config:

Code: Select all

host fix1 #
{
        hardware ethernet 01:02:03:04:06:06;
        fixed-address 192.168.1.1;
}

host fix2 #
{
        hardware ethernet 02:03:04:05:06:07;
        fixed-address 192.168.1.1;
}
Are you sure that it really does not work? You should take into account the the APR-cache in the clients/switches/etc. may still hold the old assignment of MAC<>IP and needs to be refreshed until the IP traffic can flow again.
This, of course, also affects the DHCP-requests and responses. So maybe it just needs a few seconds after switching the endpoint until the configuration works?

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 22nd, 2019, 8:56 am

I think it should work too...

My DHCP.CONF actually have this config:

Code: Select all

host fix1 # David_ETH
{
        hardware ethernet 10:e7:c6:e5:5c:57;
        fixed-address 172.16.197.6;
}

host fix2 # David_WIFI
{
        hardware ethernet f8:63:3f:c2:d5:1c;
        fixed-address 172.16.197.6;
}


I have tried this several times, and I have waited several minutes after connecting but for some reason it fails to give me the IP address.

if I connect the Ethernet first it gives me the IP correctly but when making the change to the wireless it does not assign me the ip .. it gives me a 169.x.x.x .... (and vice versa the same).


The AccesPoint it's a microtik rb951. Maybe I have bad the AP configuration, but i think that it's fine.

ChrisK
Posts: 86
Joined: November 10th, 2014, 7:19 am

Re: DHCP leases.

Post by ChrisK » October 22nd, 2019, 10:23 am

I don't know that MikroTik-router, but some guesses:
- Is the device really running in bridge mode (aka Access Point)? If it is running in routing mode, the DHCP-requests will not pass the internal NAT.
- Maybe the router filters/blocks DHCP-traffic coming through the LAN-IF in the internal DHCP is disabled?
- Does that router offer a mode call "DHCP relay"? If so, you should enable it and set the IP of the IPFire as server.

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: DHCP leases.

Post by BeBiMa » October 22nd, 2019, 10:29 am

How did you mix the ethernet and the wireless net?
These are two distinct interfaces and routing should have clue for decision of destination interface for the doubled IP.
Image
Unitymedia Cable Internet ( 32MBit )

User avatar
Arne.F
Core Developer
Core Developer
Posts: 8519
Joined: May 7th, 2006, 8:57 am
Location: BS <-> NDH
Contact:

Re: DHCP leases.

Post by Arne.F » October 22nd, 2019, 10:43 am

You cannot simply switch from ethernet to wlan because the IP is marked as used for some time. You have to release the IP before switch. If you simply disconnect the IP is reserved to the MAC Address until the dhcp lease is expired.
Arne

Support the project on the donation!

Image

Image

Image
PS: I will not answer support questions via email and ignore IPFire related messages on my non IPFire.org mail addresses.

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 23rd, 2019, 10:26 am

ChrisK wrote:
October 22nd, 2019, 10:23 am
I don't know that MikroTik-router, but some guesses:
- Is the device really running in bridge mode (aka Access Point)? If it is running in routing mode, the DHCP-requests will not pass the internal NAT.
- Maybe the router filters/blocks DHCP-traffic coming through the LAN-IF in the internal DHCP is disabled?
- Does that router offer a mode call "DHCP relay"? If so, you should enable it and set the IP of the IPFire as server.
Hi bro, thanks for the reply.

- Yes, the device is running on bridge.
- The internal DHCP is disabled, and I think that the router isn't block the traffic.
- I try some configurations, with DHCP relay and without it. I try too with the "UPnP" but doesn't work.

Here you have two screenshoots.


Image
Image

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 23rd, 2019, 10:33 am

BeBiMa wrote:
October 22nd, 2019, 10:29 am
How did you mix the ethernet and the wireless net?
These are two distinct interfaces and routing should have clue for decision of destination interface for the doubled IP.
I think I havent understood well.

The interfaces are different, with two different network cards. One ethernet and another wireless.

Both are configured to receive IP by DHCP.

In the IPFire I have made the concession for both interfaces.

Image

And these are NEVER connected at the same time, we choose one or other depending on the place where we connect.

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: DHCP leases.

Post by BeBiMa » October 23rd, 2019, 10:38 am

Thus your green and blue net are identical in the IP defintion?
Image
Unitymedia Cable Internet ( 32MBit )

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 23rd, 2019, 10:40 am

Arne.F wrote:
October 22nd, 2019, 10:43 am
You cannot simply switch from ethernet to wlan because the IP is marked as used for some time. You have to release the IP before switch. If you simply disconnect the IP is reserved to the MAC Address until the dhcp lease is expired.

So what would be the best way to do this? Can I force this automatically?

I need to connect with both cards with the same IP, and in a transparent way for the user due to their level.


Maybe if I set the lease time to one minute on IPFire?

Image

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 23rd, 2019, 10:41 am

BeBiMa wrote:
October 23rd, 2019, 10:38 am
Thus your green and blue net are identical in the IP defintion?
No, my blue network is 172.24.20.1/24 and my green network is 172.16.192.1/18.

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: DHCP leases.

Post by BeBiMa » October 23rd, 2019, 10:58 am

But both IP definitions are from Green.

I've just checked such a configuration. If I define a "wireless MAC" with a green IP, the device doesn't get this IP but a dynamic lease from blue.
Image
Unitymedia Cable Internet ( 32MBit )

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 23rd, 2019, 11:52 am

BeBiMa wrote:
October 23rd, 2019, 10:58 am
But both IP definitions are from Green.
Yes.
I connect via cable from the office and via wireless around the office.
But both connections are to the green part.

Green Network -> 172.16.192.1 / 18
With DHCP enabled, dhcp range 172.16.192.200 - 172.16.192.250
Current fixed leases:
b8:69:f4:78:1a:56 172.16.192.18 MicroTik_David
10:e7:c6:e5:5c:57 172.16.197.6 David_ETH
f8:63:3f:c2:d5:1c 172.16.197.6 David_WIFI
Acces Point -> 172.16.192.18 / 18

DHCP IP -> 172.16.197.6 / 18


------------------------

So, I can't do it?
I Think This should work because the connection to IPFire really is through the wire, since the wireless connection is made to the access point..

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 24th, 2019, 6:28 am

Checking the logs of my IPFire see this:
DHCPDISCOVER from f8:63:3f:c2:d5:1c via 192.168.88.1: unknown network segment
This MAC is from the wireless card, and 192.168.88.1 is the LAN ip of my Microtik access point.

Can anyone tell me something?

****

To try to solve it, I made a static route 192.168.88.0/24 -> 172.16.192.18. But dosn'¡t work
Try to made a static route 192.168.88.0/24 -> 172.16.192.1 but nothing again...

Darkness
Posts: 27
Joined: June 27th, 2019, 6:23 am

Re: DHCP leases.

Post by Darkness » October 24th, 2019, 8:00 am

This is the scenary:
Image

This is my DHCP cfg on IPFire:
Image

I have this static route (needed? Should be to 192.1 or 192.18?).
Image

And my current fixed leases:
Image

The MikroTik cfg (With DHCP relay enabled).
Image

This is the IP that I have where I should have the 172.16.197.6:
Image

On IPFire > System Log > DHCP Server can see this msg:
Image

On the ARP ipfire table, I haven't register for 172.16.197.6.


Green Wired: IP lease (172.16.197.6) work, Internet work.
Orange Wireless: IP lease (172.16.197.6) fail. Internet don't work.
Wired from MikroTik to PC_Client: IP static (192.168.88.2), Internet work.

Post Reply