#
# * This is an edited config template
# * See 
# * https://wiki.geant.org/pages/viewpage.action?pageId=121346324#Howtodeployeduroamatnationallevel(ADVANCED)-radsecproxy
# * For extra conf
#

#### Listening
ListenUDP                 *:1812
ListenTCP                 *:2083

#### LocalLogging
LogLevel                3
LogDestination          x-syslog:///LOG_LOCAL0
LoopPrevention         On


#### F-Ticks
FTicksReporting Full
FTicksMAC VendorKeyHashed
FTicksKey arandomsalt



##################################################################
#####  Client + Server for TLR or upper Proxies  #################
##################################################################

# * Add as many as possible
# * Though I think we will be restricted to only etlr[1-2].eduroam.org
# * or the african TLR

#### TLR-01
client tlr.general.all {
	host {{ TLR_IP }}
	type UDP
	secret {{ TLR_Secret }}
}

server tlr.general.all {
	host {{ TLR_IP }}
	type UDP
	secret {{ TLR_Secret }}
	statusserver on
}

#### TLR-02
client tlr.african.all {
	host {{ TLR_IP }}
	type UDP
	secret {{ TLR_Secret }}
}

server tlr.african.all {
	host {{ TLR_IP }}
	type UDP
	secret {{ TLR_Secret }}
	statusserver on
}

# * Names above after client/server are important
# * They are to used to specify the realm in the realm section



##################################################################
########  Client + Server for Member Institutions  ###############
##################################################################

# * Commenting is good practise. Helps in easier location and at times tracking

# Inst 1, added by DS - 20201102
client radius.inst.ac.ug {
	host __IP_Address___
	secret __That_secret__
	type UDP
    FTicksVISCOUNTRY UG
}

server radius.inst.ac.ug {
	host __IP_Address___
	secret __That_secret__
	type UDP
	statusserver on
}

##################################################################
########  Realms for the      Member Institutions  ###############
##################################################################

# * Name identical to the one mentioned in client+server
# * You can add more servers. Ensure that

# Realm for Inst1
realm inst.ac.ug  {
       server  radius.inst.ac.ug
       #server __second_server__
}




##################################################################
##########  Realms for the External connections  #################
##################################################################

# * In the event that you want to peer directly with an institution
# * You can add it here so that it connects directly to it
# * This won't be going through your TLR 

#### Friendly Peers
#realm ubuntunet.net  {
#       server  radius.ubuntunet.net
# * Remember that the name placed on 'server' is defined above
#       #server __second_server__
#}

# * the following entry comes after all your known realms. If other realms from your TLD show up,
# * they are not part of the confederation and would introduce loops. Therefore, they are rejected.

# * Replace ug with your Country's TLD
realm /\.ug$ {
	replymessage "Misconfigured supplicant or downstream server: uses known-bad realm in this federation!"
}

realm /^[^@]+$/ {
          replymessage "Misconfigured client: no AT symbol in realm! Rejected by this federation."
}

realm /\s/ {
    replymessage "Misconfigured client: no route to white-space realm! Rejected by this federation."
}


# DEFAULT forwarding: to the Top-Level Servers
realm   * {
	server  tlr.general.all
	server	tlr.african.all
}
