Netgate SG-1000 microFirewall

Author Topic: defining hostnames per mac?  (Read 264 times)

0 Members and 1 Guest are viewing this topic.

Online lovingHDTV

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
    • View Profile
defining hostnames per mac?
« on: December 06, 2017, 05:38:55 pm »
Is there a way to alias a mac address with a hostname?  I don't want to statically assign every device, but it would be nice to see a nice hostname in the dhcp leases table instead of android-<random>

I know how to do it which a static DHCP, but didn't know if you can just assign a hostname.

thanks,
david

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9247
  • Karma: +1054/-308
    • View Profile
Re: defining hostnames per mac?
« Reply #1 on: December 06, 2017, 06:21:10 pm »
How is it supposed to know what hostname to give what MAC address if you don't program either the DHCP server or the device itself?

You don't have to set a static IP address. You can just set the MAC address and the hostname.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Online lovingHDTV

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
    • View Profile
Re: defining hostnames per mac?
« Reply #2 on: December 06, 2017, 06:50:20 pm »
I've no issue providing the name.  I just didn't know if I could do it in the DHCP setting and not put an IP.

I'll give that a go.

thanks

Online lovingHDTV

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
    • View Profile
Re: defining hostnames per mac?
« Reply #3 on: December 06, 2017, 07:11:58 pm »
Creating a static map without IP added an entry, but it doesn't map to the assigned IP address.  unless I did something wrong.

I'll have to see if I can setup the hostname on the devices.


Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9247
  • Karma: +1054/-308
    • View Profile
Re: defining hostnames per mac?
« Reply #4 on: December 06, 2017, 07:13:02 pm »
If you don't set an IP address it will get an address out of the pool.

What, exactly, do you want to see happen?
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Online lovingHDTV

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
    • View Profile
Re: defining hostnames per mac?
« Reply #5 on: December 06, 2017, 07:22:33 pm »
On the line, in the DHCP lease page, show the name I create, not the one DHCP is putting in.

Offline JKnott

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +36/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #6 on: December 06, 2017, 09:21:58 pm »
Is there a way to alias a mac address with a hostname?  I don't want to statically assign every device, but it would be nice to see a nice hostname in the dhcp leases table instead of android-<random>

I know how to do it which a static DHCP, but didn't know if you can just assign a hostname.

thanks,
david

No, you cannot.  Host names refer to IP addresses, not MAC.

Just stop for a minute and consider a device on the other side of a router trying to reach that host name.  It cannot use just the MAC address to pass through a router, only an IP address will do.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14477
  • Karma: +1341/-200
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: defining hostnames per mac?
« Reply #7 on: December 07, 2017, 03:49:39 am »
"On the line, in the DHCP lease page, show the name I create, not the one DHCP is putting in."

Post a picture so this makes sense.. 
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Online lovingHDTV

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
    • View Profile
Re: defining hostnames per mac?
« Reply #8 on: December 07, 2017, 06:57:34 am »
Picture posted.

A hostname is already provided, I just want to control it.  I tried changing the device name on the device itself, but it did not change what the DHCP server uses.

thanks

Offline marjohn56

  • Sr. Member
  • ****
  • Posts: 546
  • Karma: +53/-2
    • View Profile
Re: defining hostnames per mac?
« Reply #9 on: December 07, 2017, 07:46:03 am »
if you mean the androidxxxxxx, good luck, most android devices do not allow you to change that.

However, if it's a samsung you may be able to change it by changing the device name, then remove any static entries you have for the device and then reboot the device, whilst it's rebooting - delete any leases already given to it.
« Last Edit: December 07, 2017, 08:16:53 am by marjohn56 »
pfSense 2.4.3 on Qotom Q355G4 or APU2C4 - Billion 8800NL (bridge) - ISP Zen U.K.
Please do not PM me for help. I have a life to live too.

Offline JKnott

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +36/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #10 on: December 07, 2017, 08:26:40 am »
Picture posted.

A hostname is already provided, I just want to control it.  I tried changing the device name on the device itself, but it did not change what the DHCP server uses.

thanks

Once you've configured a static DHCP address for the phone, you can create another host name that points to the same address.

Offline Chrismallia

  • Full Member
  • ***
  • Posts: 266
  • Karma: +20/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #11 on: December 07, 2017, 08:30:32 am »
I think what the guy wants is to give the original hostname a friendly name in pfsense,  without changing the hostname from the device itself  or without giving static IPs to the devices, in pfsense I do not think there is a way of giving a device a friendly name without giving a static IP

Offline JKnott

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +36/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #12 on: December 07, 2017, 08:57:14 am »
I think what the guy wants is to give the original hostname a friendly name in pfsense,  without changing the hostname from the device itself  or without giving static IPs to the devices, in pfsense I do not think there is a way of giving a device a friendly name without giving a static IP

Quite so and any device making a DNS query will expect an IP, not MAC, address back.  So, his only option is to map a DHCP address to the MAC address and then add a DNS entry with the desired host name pointing to that address.

Offline Chrismallia

  • Full Member
  • ***
  • Posts: 266
  • Karma: +20/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #13 on: December 07, 2017, 09:11:47 am »
He is not trying to eliminate a IP address, just leave it to DHCP not static but in the Firewall  he renames a device to a friendlier  name, 1  example if viewing flows in ntong it will not show up as android something but as tim mobile phone (infact in ntongng you can rename the device just for ntong )this can be done for sure in some firewalls as I did it myself using other firewall it gives you the option to edit the hostname to your  liking, but Note if you give a friendly name its just for your viewing/reports in the firewall you cant use the friendly name to resolve or ping the device, I think that is what is confused here
« Last Edit: December 07, 2017, 09:20:10 am by Chrismallia »

Offline JKnott

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +36/-4
    • View Profile
Re: defining hostnames per mac?
« Reply #14 on: December 07, 2017, 09:39:39 am »
Does pfSense support a CNAME alias?  If so, he could create an alias for the Android-* name.  I do that with my firewall WAN address.  It's host name is dependent on the computer & modem MAC addresses.  So, I created an alias for it on my public DNS.