Below is the content of mac2vlan file in freeradius.
When I uncomment this line 00:01:02:03:04:05,VLAN1
it logs a parsing error
including configuration file /etc/raddb/modules/mac2vlan
/etc/raddb/modules/mac2vlan[10]: Parse error after "00:01:02:03:04:05"
Errors reading /etc/raddb/radiusd.conf
What is the correct syntax?
# -*- text -*-
#
# $Id$
# A simple file to map a MAC address to a VLAN.
#
# The file should be in the format MAC,VLAN
# the VLAN name cannot have spaces in it, for example:
#
00:01:02:03:04:05,VLAN1
# 03:04:05:06:07:08,VLAN2
# ...
passwd mac2vlan {
filename = ${confdir}/mac2vlan
format = "*VMPS-Mac:=VMPS-VLAN-Name"
delimiter = ","
}
I know it's been a while since this was posted, but for the next guy (or gal) that stumbles across this posting looking for help as I did, hopefully will find value in my answer.
The
/etc/raddb/modules/mac2vlan
file only shows an example of what the mac2vlan file should look like.The actual mac2vlan file is referenced in this script:
You should have (or create as I had to) a mac2vlan file in
/etc/raddb
/ using the syntax referenced above. Do not uncomment anything in/etc/raddb/modules/mac2vlan
file.I should also mention, that the version of freeradius I am using, the path is actually
/etc/freeradius
not/etc/raddb
as referenced above.Looks like it is complaining about a line with a comment, which is missing a
#
character at the start of the line. Additionally, the last line probably shouldn't have been a comment, so the#
character on the last line need to be removed.