OPNsense Forum

English Forums => General Discussion => Topic started by: z0rk on November 19, 2018, 06:47:31 PM

Title: DHCP static IP addresses for multi MAC devices
Post by: z0rk on November 19, 2018, 06:47:31 PM
Most devices have multiple MACs i.e. wired and wifi. How do I create static mappings for the _same_ hostname, but a different MAC address. It appears that's currently not possible. Could somebody please explain?

Thanks
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: GDixon on November 19, 2018, 09:21:33 PM
good question!

What i had to do in this circumstance for example is to name a laptop as  laptop-wireless and laptop-ethernet for the static dhcp leases.

I use static on OPNsense and dhcp at the device for all my lan systems. only guests or temporary systems get dhcp leases.

Not a good solution but workable for the moment.

I'm curious to know what others are doing on this dilemma.

Greg
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: z0rk on November 20, 2018, 12:16:02 AM
Quote from: GDixon on November 19, 2018, 09:21:33 PM
good question!

What i had to do in this circumstance for example is to name a laptop as  laptop-wireless and laptop-ethernet for the static dhcp leases.


I've considered this. Ok, let's say the hostname of the device is 'laptop'. When you create static DHCP mappings for the _same_devices and specify one mapping as hostname 'laptop-wireless' and hostname 'laptop-ethernet', then but what hostname will the device be known on the network? By 'laptop' (the true hostname of the device) or by 'laptop-ethernet' vs. 'laptop-wireless'? By what hostname would you ssh / ping the device? If the hostname in the static mapping is inconsequential than why the need to specify one? Mmmm... There has to be a better solution I would hope.  :o

Thanks, man
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: GDixon on November 20, 2018, 01:32:03 AM
I use static assignments so that i can ping ssh or whatever (even to a nas) by ip and not name. For me remembering a name is harder than remembering the ip .

But another good question and I'm curious to know myself if the laptop host name (as laptop on the laptop) will be overridden by the host name on OPNsense.

Looks like something to learn since i hit dead ends trying to get IPv6 working for now.
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: GDixon on November 20, 2018, 01:38:36 AM
ok, I added several names to my /etc/hosts  with different names and the same ip for the different names.

to be clear the host file i used is on the machine i use to access all others and NOT on the OPNsense box!

what happens is you can use  any of the names and they all resolve to that ip.

I use tumbleweed/ linux and have not tried it in windows yet. Have to install a windows 7 and windows 10 VMs but have been too lazy to do so for months now :)

greg

:EDIT nothing bad or funny happens that i can find
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: z0rk on November 20, 2018, 02:21:48 AM
Quote from: GDixon on November 20, 2018, 01:38:36 AM
ok, I added several names to my /etc/hosts  with different names and the same ip for the different names.
to be clear the host file i used is on the machine i use to access all others and NOT on the OPNsense box!

Well Ok, I would expect that to work; but I don't want to touch every hosts file on all of my clients. This should be handled by DHCP.
Thanks for you help. I hope a developer might have some insight.  :P
Cheers
Title: Re: DHCP static IP addresses for multi MAC devices
Post by: z0rk on November 20, 2018, 02:25:55 AM
I've found that you can create a static DHCP mapping without specifying a hostname. Not sure how that effect that would have?