Tag Archives: radius

Unifi USG Radius default vlan

on USG

/config/scripts/post-config.d/radius_default_vlan.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# radius_default_vlan.sh
# This script goes in /config/scripts/post-config.d
 
 
if [[ -z "$1" ]] ; then
    echo "* * * * * root /config/scripts/post-config.d/radius_default_vlan.sh cron" > /etc/cron.d/radius_default_vlan
    exit 0
fi
 
 
 
if grep -q "DEFAULT Auth-Type" "/etc/freeradius/users" ; then
    exit 0
fi
 
cat >> /etc/freeradius/users <<EOF
 
DEFAULT Auth-Type := Accept
    Tunnel-Type             = 13,
    Tunnel-Medium-Type      = 6,
    Tunnel-Private-Group-Id = 1
 
EOF
 
service freeradius restart

install

1
2
chmod +x /config/scripts/post-config.d/radius_default_vlan.sh
/config/scripts/post-config.d/radius_default_vlan.sh

remove

1
2
rm /etc/cron.d/radius_default_vlan
rm /config/scripts/post-config.d/radius_default_vlan.sh